Android的耗材:"已经拥有该项目"但inventory.hasPurchase()是假的 [英] Android consumable: "already own that item" but inventory.hasPurchase() is false

查看:353
本文介绍了Android的耗材:"已经拥有该项目"但inventory.hasPurchase()是假的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我坚持与谷歌在应用程序第三版 - 我测试了购买不消耗(例如,当购买和消费之间的应用程序崩溃) - 我现在没有找到出路

I'm stuck with Google In App v3 - I tested a purchase without consumption (e.g. when app crashes between buying and consuming) - now I don't find a way out.

如果我试图再次购买,它说:你已经拥有该项目。但是,当我测试的所有权,它说我不拥有它:

If I try to buy again, it says 'you already own that item'. But when I test for ownership, it says I don't own it:

Inventory inv = mHelper.queryInventory(false, null);
inv.getPurchase(sku); // null
inv.hasPurchase(sku); // false

我可以不消耗任何东西,因为我没有购买消费。如何在这里进行呢?

I can't consume something either, as I don't have a purchase to consume. How to proceed here?

修改 重现它像下面这样:购买应用内耗材,然后禁用网络连接。在此之后,您无法再次购买该产品几个小时。刚刚从Play商店(钻石挖掘机佐贺)一个流行的应用程序进行测试,我有完全相同的行为。难道真的没有可能性,以避免/解决这个问题?

EDIT Reproduce it like the following: purchase in-app consumable, then disable internet connection. After that, you're not able to purchase the product again for some hours. Just tested with a popular app from the play store (Diamond Digger Saga), I had the exact same behaviour. Is there really no possibility to avoid/solve this?

推荐答案

我就遇到了这个确切的问题。我曾在电话上的两个谷歌帐户,其中一个是开发者帐号(这是我愚蠢地用我的个人账户),另一个这是我在开发者控制台中注册的测试帐号。我已经删除,并从我的账号在手机上,这让我从我的应用程序进行试买重新添加的开发者账户,心想如果开发者帐户是这份榜单上第二个将使用第一个进行购买。

I ran into this exact problem. I had two Google accounts on the phone, one which was the developer account (which I foolishly used my personal account for) and another which was the test account I registered in the developer console. I had removed and re-added the developer account from my accounts on the phone, which allowed me to make test-purchases from my app, thinking if the developer account was the second on this list it would use the first for purchases.

唉,后一对夫妇的应用程序,我遇到了你的问题的奔跑。我放弃了试图同时拥有,并从我的手机中取出的开发者账户。而令人难以置信的不便,这种摆脱了这个问题,让我来测试购买,消费,查询等。

Alas, after a couple of runs of the app I ran into your issue. I gave up trying to have both and removed the developer account from my phone. While incredibly inconvenient, this got rid of this problem and allowed me to test purchase, consume, query, etc.

这篇关于Android的耗材:"已经拥有该项目"但inventory.hasPurchase()是假的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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