IABHelper。 queryInventoryAsync返回没有购买,但推出的产品流失败,"项目已拥有"品流、项目、IABHelper、queryInventoryAsync

2023-09-05 05:35:31 作者:薄如纸

我遇到一个间歇性的问题,在应用程序内结算版本使用IABHelper 3由谷歌提供的。

I'm experiencing an intermittent problem with In App Billing Version 3 using IABHelper as provided by Google.

在启动一个新的采购我检查未用完的采购与queryInventoryAsync。如果发现我消耗任何未使用的采购,并开始一个新的事务,如果不是直接去启动一个新的事务。 99%的时间正常工作。

Before Launching a new purchase I check for unconsumed purchases with queryInventoryAsync. If found I consume any unconsumed purchases and begin a new transaction, if not go directly to start a new transaction. 99% of the time it works fine.

有时候,当queryInventoryAsync返回任何未使用的购买,以下launchPurchaseFlow失败,响应:7:项目已经拥有

Occasionally when queryInventoryAsync returns no unconsumed purchases, the following launchPurchaseFlow fails with Response : 7: Item already owned.

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

queryInventoryAsync是说用户不拥有该项目,但launchPurchaseFlow说用户一样。

queryInventoryAsync is saying the user does not own the item, but launchPurchaseFlow says the user does.

后,奇怪的是等待(有时是几分钟,有时甚至更多)的问题自行解决。

Strangely after a wait (sometimes a few minutes, sometimes more) the problem resolves itself.

任何人都经历了类似的话?

Has anyone experienced anything similar?

有关引用我使用IABHelper的最后更新于3月15日,该版本

For reference I'm using the version of IABHelper last updated on March 15.

推荐答案

谷歌做了明确的缓存播放服务的应用程序在移动。它可能为你工作。

Do clear cache of Google Play Service app in mobile. It may work for you.