我在使用谷歌提供的IABHelper的应用程序计费版本3中遇到了间歇性的问题。
在开始新的购买之前,我会使用queryInventoryAsync检查未使用的购买。如果找到,我会消费任何未消费的购买,并开始一个新的事务,如果没有,直接开始一个新的事务。99%的时间它都工作得很好。
有时,当queryInventoryAsync没有返回未使用的购买时,以下launchPurchaseFlow会失败,并返回以下响应: 7: Item already。
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说用户拥有。
奇怪的是,等待一段时间(有时几分钟,有时更长),问题就会自行解决。
有没有人有过类似的经历?
作为参考,我使用的是3月15日最后更新的IABHelper版本。
发布于 2014-05-09 15:25:15
清除Google Play服务应用程序在移动设备中的缓存。它可能会为你工作。
https://stackoverflow.com/questions/15542687
复制相似问题