首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >IABHelper。queryInventoryAsync未返回任何购买,但启动产品流失败,并显示"Item Already“

IABHelper。queryInventoryAsync未返回任何购买,但启动产品流失败,并显示"Item Already“
EN

Stack Overflow用户
提问于 2013-03-21 16:36:48
回答 1查看 3.7K关注 0票数 18

我在使用谷歌提供的IABHelper的应用程序计费版本3中遇到了间歇性的问题。

在开始新的购买之前,我会使用queryInventoryAsync检查未使用的购买。如果找到,我会消费任何未消费的购买,并开始一个新的事务,如果没有,直接开始一个新的事务。99%的时间它都工作得很好。

有时,当queryInventoryAsync没有返回未使用的购买时,以下launchPurchaseFlow会失败,并返回以下响应: 7: Item already。

代码语言:javascript
复制
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版本。

EN

回答 1

Stack Overflow用户

发布于 2014-05-09 15:25:15

清除Google Play服务应用程序在移动设备中的缓存。它可能会为你工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15542687

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档