问题描述
我有一个应用程序,我已经在用户打开应用程序时进行了应用程序购买我在第一次购买时检查是否发生使用 launchPurchaseFlow(使用自动调用)因为这个打开的对话框在应用程序中购买(我称之为第一次使用此方法,因为假设用户已经在应用程序购买中重新安装了应用程序,因此检查购买是否发生此方法已经购买,因此我可以知道不显示添加)所以我怎么称之为这种方法并在第一次忽略购买对话框?我在 launchPurchaseFlow 方法中做了什么改变 IabHelper.java
提前谢谢....
I have one application in that i have put In App Purchase when User open Application i check first time In Purchase happen or not using launchPurchaseFlow(using automatic call) because of this open Dialog of In App purchase(i am call this methode first time because suppose user have done in app purchase he is reinstalling App so check in Purchase happen or not this methode give response Already Purchase so i can know not to display add ) so how can i call this methode and ignore the in purchase dialog first time ? what change i do in launchPurchaseFlow methode of IabHelper.java
Thanks in Advance....
推荐答案
您应该而不是launchPurchaseFlow。
You should query for purchased items instead of launchPurchaseFlow.
Bundle ownedItems = mService.getPurchases(3, getPackageName(),
"inapp", null);
要查询活动订阅,请使用getPurchases方法,再次使用产品类型参数设置为
subs。
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);
这篇关于如何在没有打开购买对话框的情况下在我的Android应用程序中验证用户已完成购买?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!