IABHelper.queryInventoryAsync不返回任何购买,但启动产品流失败并显示"已拥有的项目"

Byr*_*ron 18 android in-app-billing

我正在使用Google提供的IABHelper在In App Billing Version 3中遇到间歇性问题.

在启动新购买之前,我使用queryInventoryAsync检查未使用的购买.如果发现我消耗任何未消耗的购买并开始新的交易,如果不是直接开始新的交易.99%的时间它工作正常.

有时,当queryInventoryAsync未返回未使用的购买时,以下launchPurchaseFlow将失败并显示响应:7:项已经拥有.

INFO    [IABHelper] Starting async operation: refresh inventory
INFO    [IABHelper] Querying owned items, item type: inapp
INFO    [IABHelper] Package name: jp.co.mycompany.myapp
INFO    [IABHelper] Calling getPurchases with continuation token: null
INFO    [IABHelper] Owned items response: 0
INFO    [IABHelper] Continuation token: null
INFO    [IABHelper] Querying SKU details.
INFO    [IABHelper] queryPrices: nothing to do because there are no SKUs.
INFO    [IABHelper] Querying owned items, item type: subs
INFO    [IABHelper] Package name: jp.co.mycompany.myapp
INFO    [IABHelper] Calling getPurchases with continuation token: null
INFO    [IABHelper] Owned items response: 0
INFO    [IABHelper] Continuation token: null
INFO    [IABHelper] Querying SKU details.
INFO    [IABHelper] queryPrices: nothing to do because there are no SKUs.
INFO    [IABHelper] Ending async operation: refresh inventory

INFO    [IABHelper] Constructing buy intent for jp.co.mycompany.myapp.myitem, item type: inapp
INFO    [IABHelper] Launching buy intent for jp.co.mycompany.myapp.myitem Request code: 1001
INFO    [IABHelper] Ending async operation: launchPurchaseFlow
INFO    [IABHelper] Purchase canceled - Response: 7:Item Already Owned
Run Code Online (Sandbox Code Playgroud)

queryInventoryAsync表示用户不拥有该项,但launchPurchaseFlow表示该用户具有该项.

在等待(有时是几分钟,有时甚至更多)后奇怪地解决了问题.

有没有人经历过类似的事?

作为参考,我使用的是3月15日最新更新的IABHelper版本.

Haf*_*ain 1

清除移动设备中 Google Play 服务应用程序的缓存。它可能对你有用。