在谷歌恢复交易应用内第3版

2023-09-12 22:59:36 作者:顾你安稳

我有一个应用程序和它工作正常,现在我要实现我的应用程序恢复交易方法。我没有找到这个方法现在,我怎么可以致电或定义或进行其他方法在应用程序内版本3.恢复交易我搜索净,但没有发现相关的溶胶或信息。

I have an app and its working fine now i want to implement restore transactions method in my app. I did not find this method now how can i can call or define or make other method to restore transaction in in-app version 3. I searched on net but did not find relevant sol or info.

推荐答案

您可以使用 getPurchases恢复交易() API

Bundle ownedItems = mService.getPurchases(3, mContext.getPackageName(),
                itemType, continueToken);

 ArrayList mySkus, myPurchases, mySignatures;
 mySkus = ownedItems.getStringArrayList(RESPONSE_INAPP_ITEM_LIST);
 myPurchases = ownedItems.getStringArrayList(RESPONSE_INAPP_PURCHASE_DATA_LIST);
 mySignatures = ownedItems.getStringArrayList(RESPONSE_INAPP_PURCHASE_SIGNATURE_LIST);

会列出您拥有的项目,你可以用它来验证购买相应的数据。

will list the items that you own and the corresponding data that you can use to verify the purchases.

虽然你把这个电话,一定要

While you make this call, be sure to

使用您用来进行购买的谷歌ID。 在不使用静态产品ID(android.test.purchased,android.test.refunded ...)。您可以使用您在您的IAB测试帐号创建的测试-ID的。 使用适当的产品类型和您的应用程序的包名。
相关推荐