为您的 Android 应用授权 Google Wallet Android SDK
Google Wallet API 提供了 Android SDK,可让您更轻松地使用原生代码直接在 Android 应用中集成 Google 钱包功能。
如需使用 Google 钱包 Android SDK,您必须提供 Android 应用的软件包名称以及应用签名证书的 SHA-1 指纹。这些凭据用于向您的应用授予发布权限,并对您的应用向 Google Wallet API 发送的请求进行身份验证。
1. 获取签名证书的 SHA-1 指纹
如需获取签名证书的 SHA-1 指纹,请按照 Google Play 服务文档中的说明,使用以下任一方法检索该指纹:
签名证书的 SHA-1 指纹类似于以下内容:
DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09
2. 在 Google 钱包控制台中为应用授权
获得 SHA-1 指纹后,请执行以下操作,在 Google 钱包控制台中为您的 Android 应用授权。
- 前往 Google Pay & Wallet Console。
- 在左侧导航栏中,点击“Google Wallet API”以打开 Google 钱包控制台。
- 点击“其他功能”标签页。
- 在“应用权限”框中,点击“+ 添加应用”按钮。
- 输入应用的软件包名称和 SHA-1 指纹。
- 点击“添加应用”。
如果您的软件包名称和应用显示在“应用权限”框中,则表示您的应用有权使用 Google Wallet Android SDK 向 Google Wallet API 发送请求。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-13。
[null,null,["最后更新时间 (UTC):2024-08-13。"],[[["The Google Wallet API offers an Android SDK for native app integration of Google Wallet features."],["You need your app's package name and SHA-1 fingerprint for authorization and authentication."],["Authorize your app by providing these credentials in the Google Wallet console under 'Additional features' \u003e 'App Permissions'."]]],["The Google Wallet Android SDK requires app authorization using the app's package name and SHA-1 fingerprint. Retrieve the fingerprint via `keytool` or Gradle. Then, in the Google Pay & Wallet console, navigate to the 'Google Wallet API' section, and under 'App Permissions,' add your app details, including the package name and the obtained SHA-1 fingerprint. This process authorizes the app to use the Google Wallet API.\n"]]