如何在不打开购买对话框的情况下验证用户已经在我的 Android 应用程序中完成购买?
How can I verify user has already done in purchase In my Android App without open Purchase Dialog?
我有一个应用程序,因为我在用户打开应用程序时放入了应用程序购买我检查第一次购买发生或不使用 launchPurchaseFlow(使用自动调用) 因为这个打开应用程序内购买对话框(我第一次调用此方法,因为假设用户已经完成应用程序购买,他正在重新安装应用程序,所以检查是否发生购买此方法给出响应已经购买所以我可以知道不显示添加)所以如何我可以第一次调用此方法并忽略购买对话框吗?我在 launchPurchaseFlow 方法中做了什么改变 IabHelper.java
在此先感谢....
您应该 query for purchased items 而不是 launchPurchaseFlow。
To retrieve information about purchases made by a user from your app,
call the getPurchases method on the In-app Billing Version 3 service.
Pass in to the method the In-app Billing API version (“3”), the
package name of your calling app, and the purchase type (“inapp” or
"subs").
Bundle ownedItems = mService.getPurchases(3, getPackageName(),
"inapp", null);
The Google Play service returns only the purchases
made by the user account that is currently logged in to the device.
To query for active subscriptions, use the getPurchases method, again
with the product type parameter set to "subs".
Bundle activeSubs = mService.getPurchases(3, "com.example.myapp",
"subs", continueToken);
我有一个应用程序,因为我在用户打开应用程序时放入了应用程序购买我检查第一次购买发生或不使用 launchPurchaseFlow(使用自动调用) 因为这个打开应用程序内购买对话框(我第一次调用此方法,因为假设用户已经完成应用程序购买,他正在重新安装应用程序,所以检查是否发生购买此方法给出响应已经购买所以我可以知道不显示添加)所以如何我可以第一次调用此方法并忽略购买对话框吗?我在 launchPurchaseFlow 方法中做了什么改变 IabHelper.java
在此先感谢....
您应该 query for purchased items 而不是 launchPurchaseFlow。
To retrieve information about purchases made by a user from your app, call the getPurchases method on the In-app Billing Version 3 service. Pass in to the method the In-app Billing API version (“3”), the package name of your calling app, and the purchase type (“inapp” or "subs").
Bundle ownedItems = mService.getPurchases(3, getPackageName(),
"inapp", null);
The Google Play service returns only the purchases made by the user account that is currently logged in to the device.
To query for active subscriptions, use the getPurchases method, again with the product type parameter set to "subs".
Bundle activeSubs = mService.getPurchases(3, "com.example.myapp",
"subs", continueToken);