IAB错误您已经拥有了这个项目 [英] IAB Error You already owned this item

查看:382
本文介绍了IAB错误您已经拥有了这个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


现在我正在开发一个小游戏与谷歌的应用内结算服务。

I'm now developing a small game with Google's in-app billing service.

和我提及谷歌的样本项目的琐碎的驱动器。
让我在从谷歌播放购买物品问你连接中断。

And I reference to Trivial Drive of Google's sample project. Let's me ask you about connection interruption during Purchase Items from Google Play.

据发射正常的互联网连接的采购流程时,没关系。

It's OK when launching purchase flow with normal internet connection.

我测试了这个样子。
只要购买流程启动后,断开网络连接(拔掉路由器的LAN)。
约2-3分钟后,它显示了连接超时。
在商家账户,转账完成。
但是,当我查询所有拥有的物品,还有这个ID(最近购买)的无独资项目。
当我试图再次购买这个项目,它显示错误,您已经拥有了这个项目。

I tested like this. As soon as purchase flow is launched, disconnect the internet connection (by unplugging the routers' LAN). After about 2-3 minutes, It shows Connection time out. In merchant account, Money transfer is done. But when I query All owned items, there is no owned item of this ID (purchased recently). And when I try to purchase again this item, It shows "Error You already owned this item".

我该如何解决这个问题?
任何人都遇到过这样的问题吗?

How can I solve this problem? Anybody encountered like this problem?

请帮助。
鸭preciate所有的意见和帮助。

Please Help. Appreciate to all comments and helps.

由于..........

Thanks..........

推荐答案

在谷歌IAP流要求你做一个购买后调用 consumePurchase() API。

The Google IAP flows requires you to call a consumePurchase() API after doing a purchase.

您需要做的是调用 getPurchases() API,这将返回采购清单与 purchaseToken 。然后,你需要通过他们迭代,并调用 consumePurchase() API用于购买未使用的产品。

What you need to do is to call the getPurchases() API, this will return a list of purchases along with a purchaseToken. Then you need to iterate through them and call the consumePurchase() API for the purchased, unconsumed products.

有关更多的参考,看API 参考

For more reference, look at the API reference.

这篇关于IAB错误您已经拥有了这个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆