简体   繁体   English

应用内结算是否需要在用户的设备上安装 Google Play 服务?

[英]Does in-app billing require Google Play services to be installed on the user's device?

The setup docs for in-app billing show you need to add the in-app billing library to your Android project.应用内计费的设置文档显示您需要将应用内计费库添加到您的 Android 项目中。 Presumably that calls Google Play's servers to query and make in-app purchases on your app's behalf.大概是调用 Google Play 的服务器来代表您的应用查询和进行应用内购买。

The setup docs for using Google Play APIs don't mention in-app billing;使用 Google Play API 的设置文档没有提到应用内结算; whereas you would have to add a dependency on Google Play if you wanted to display ads or use Google Analytics for example.而例如,如果您想展示广告或使用 Google Analytics,则必须添加对 Google Play 的依赖项。

So, taking these 2 pieces of info together, does this mean your app does not need Google Play services to be present on the user's device for your app to use in-app billing successfully?因此,服用这些2个信息结合在一起,这是否意味着你的应用程序并不需要谷歌Play服务目前用户对你的应用设备上的应用内结算成功地使用? I suspect the answer's "No, you don't need Google Play services to be installed", but it would be good to have confirmation of this.我怀疑答案是“不,您不需要安装 Google Play 服务”,但最好确认一下。

The user's device must have a Google Play Service in order to use in-App Billing.用户的设备必须具有 Google Play 服务才能使用应用内结算。

Your application accesses the In-app Billing service using an API that is exposed by the Google Play app that is installed on the device.您的应用程序使用由安装在设备上的 Google Play 应用程序公开的 API 访问应用内结算服务。 The Google Play app then conveys billing requests and responses between your application and the Google Play server.然后,Google Play 应用程序在您的应用程序和 Google Play 服务器之间传送计费请求和响应。 In practice, your application never directly communicates with the Google Play server.实际上,您的应用程序从不直接与 Google Play 服务器通信。 Instead, your application sends billing requests to the Google Play app over interprocess communication (IPC) and receives responses from the Google Play app.相反,您的应用程序通过进程间通信 (IPC) 向 Google Play 应用程序发送计费请求,并接收来自 Google Play 应用程序的响应。 Your application does not manage any network connections between itself and the Google Play server.您的应用程序不管理其自身与 Google Play 服务器之间的任何网络连接。

In-app Billing Version 3 is the latest version, and it maintains very broad compatibility across the range of Android devices. In-app Billing Version 3 是最新版本,它在 Android 设备范围内保持非常广泛的兼容性。 In-app Billing Version 3 is supported on devices running Android 2.2 (API level 8) or higher that have the latest version of the Google Play app installed (a vast majority of active devices).运行 Android 2.2(API 级别 8)或更高版本且安装了最新版Google Play 应用的设备绝大多数活动设备)支持应用内结算版本 3。

You might also want to check theIn-app Billing Version Notes :您可能还想查看应用内结算版本说明

The In-app Billing API is versioned, with each version offering additional features to your app. In-app Billing API 是有版本的,每个版本都为您的应用提供附加功能。 API support is provided by the Google Play Store app. API 支持由 Google Play Store 应用程序提供。 On most devices, the Google Play Store app is updated automatically to support newer versions of the API.在大多数设备上,Google Play 商店应用会自动更新以支持更新版本的 API。

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM