Android 应用内结算网络访问

发布于 2024-11-09 20:40:22 字数 143 浏览 0 评论 0原文

我想知道应用内计费 api 在检查用户是否购买了商品时是否需要访问互联网。

我想使用应用内计费来销售游戏关卡,但不想在用户每次开始玩关卡时都访问互联网。

market有没有缓存机制可以避免每次都调用服务器?我需要在我的应用程序上实现它吗?

I would like to know if the in-app billing api needs to have internet access when checking if the user have purchased an item or not.

I want to sell game levels using the in-app billing but don't want to access the internet everytime the user starts playing the level.

Does market have any cache mechanism to avoid calling the server everytime? Do I need to implement it on my app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揽清风入怀 2024-11-16 20:40:22

有两种类型的购买。托管和非托管。托管产品只能购买一次,但非托管产品可以购买任意多次。

市场应用程序没有这样的缓存。例如,您有一个托管产品 ID 设置,并且您作为用户已经购买了它。下次您请求市场应用程序购买同一商品时,它将返回一个响应,显示“已购买”。

对于非托管项目,它仅执行事务。
在这两种情况下,都需要互联网

您可以自行决定如何在本地保存交易,并通过检查是否确实需要进行另一次购买来启动购买。

There are two types of purchases. Managed and unmanaged. Managed products can only be bought once, however unmanaged products can be bought any number of times.

There is no caching as such by the market app. Say for example, you have a managed product ID setup, and you a user has already bought it. The next time you request the market app to buy the same item, it will return with a response, saying "already purchased".

In case of unmanaged items, it just carries out the transaction.
In both the cases, internet is required.

It's upto you how you save the transactions locally, and initiate a purchase by checking if you really need to do another purchase.

顾铮苏瑾 2024-11-16 20:40:22

您甚至不需要互联网许可即可使用应用内结算。市场会为你解决这个问题。

You don't even need the Internet permission to use in-app billing. Market will take care of that for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文