+-
android – 新的Voided Purchases API的用例是什么?
谷歌刚推出 Voided Purchases API

The Google Play Voided Purchases API allows you to revoke access to in-app products that are associated with purchases that a user has voided. The user can void a purchase in the following ways:

The user requests a refund for their order. The user cancels their order. An order is charged back.

但是,我对用例感到困惑.

目前,我有一个应用程序与非消费类应用内购买项目(一次性购买).

每当我的应用程序启动时,我将使用以下代码检查用户是否已购买该项目.

https://github.com/googlesamples/android-play-billing/blob/master/TrivialDrive/app/src/main/java/com/example/android/trivialdrivesample/MainActivity.java#L243

我希望如果用户决定取消他们的采购订单,inventory.getPurchase将在下次应用启动期间返回null.

那么,Voided Purchases API如何适用于“用户已决定取消其采购订单”案例?

我想通过使用onQueryInventoryFinished,我们可以确定用户当前拥有哪个项目?

最佳答案
Voided Purchases API旨在供使用后端服务器进行购买实现的应用程序使用.例如:多人游戏中的特殊项目,虚拟货币或升级的成员资格级别.

在这些情况下,服务器否则将不知道先前履行的购买不再有效.这个新API允许服务器查询无效购买,然后撤销已经履行的任何项目/货币/成员资格.

在您描述的仅客户端方案中,此API将毫无用处.

点击查看更多相关文章

转载注明原文:android – 新的Voided Purchases API的用例是什么? - 乐贴网