库存不退换购买的订阅 [英] Purchased subscription not returned in inventory
问题描述
我已经适应在Android SDK的谷歌额外的 play_billing
样品用我自己的应用程序包名称和公钥。我能购买一个管理项目,以及订阅THRU的应用程序。
I've adapted the play_billing
sample in the Google extras of the Android SDK to use my own app package name and public key. I was able to purchase a managed item as well as a subscription thru the app.
然而,当我打电话的方法,如 Inventory.getAllPurchases()
认购未在用户的库存退回,甚至重新启动并重新安装应用程序后。
However, when I call methods such as Inventory.getAllPurchases()
the subscription is not returned in the user's inventory, even after restarting and reinstalling the app.
@Override
public void onQueryInventoryFinished(IabResult result, Inventory inventory)
{
if(result.isFailure())
{
log.error("In-app billing inventory query failed: " + result);
return;
}
for(Purchase purchase : inventory.getAllPurchases())
{
log.info("Purchase: " + purchase.getSku());
}
}
输出:
Purchase: premium
常规,一次性购买( premium
)的输出,你可以看到,但订阅购买( paid_app </ code>)不是。当我试图再次购买订阅它说我已经买了它:
The regular, single-time purchase (premium
) is output as you can see, but the subscription purchase (paid_app
) is not. When I try to buy the subscription again it says I've already bought it:
我试过我什么都知道,但我不知道这一点。由于经常项目正在按预期的,我不明白为什么不被返回的预订,除非我在是如何工作的完全关闭基地。
I've tried everything I know, but I can't figure this out. Since the regular item is working as intended, I don't see why the subscription isn't being returned unless I'm totally off base on how that is supposed to work.
我有APK上传为草稿。我在测试人员名单在手机上我的电子邮件地址;电子邮件是不是我的开发人员的电子邮件。我的订阅产品激活。我测试的这款手机拥有最新版本的谷歌播放的。
I have the APK uploaded as a draft. I have my email address on the phone in the testers list; the email is NOT my developer email. My subscription item is Active. The phone I'm testing on has the latest version of Google Play.
编辑:仍然没有运气。然而,这里的另一个更新的情况下,它是相关的。当我进入谷歌钱包没有交易的出现(表面上是因为他们的测试交易)。而对于我的测试用户帐户,当我进入谷歌在订阅播放,它没有列出。然而,它不会让我再次购买。所以,不仅做到了购买订阅显示不出来,当我询问他们,但他们也无处我可以取消再次测试。
Still no luck. However, here's another update in case it's relevant. When I go into Google Wallet none of the transactions show up (ostensibly because they are test transactions). And for my test user account when I go into Google Play under subscriptions, it is not listed. Yet it won't let me purchase again. So not only do the purchased subscriptions not show up when I query for them, but they also are nowhere I can cancel to test again.
任何想法,这里将是极大的AP preciated。
Any ideas here would be greatly appreciated.
推荐答案
想通了一个偶然的机会,当我遇到这个答案<来了/一>,并决定尝试更新code挂在那里。
Figured it out by chance when I came across this answer and decided to try the updated code linked there.
显然,在SDK管理器中列出的 play_billing
样品的过时的所有类和 UTIL
包需要通过的 UTIL 包取代=HTTPS://$c$c.google .COM / p / marketbilling /相对=nofollow>这件事最新项目。
Apparently the play_billing
sample listed in the SDK manager is outdated, and all the classes in the util
package need to be replaced by the util
packages from this up-to-date project.
我用新的取代了旧的 UTIL
包后,我的订阅获取随着正规上市的 premium
项目!
After I replaced the old util
package with the new one, my subscription gets listed along with the regular premium
item!!!
Purchase: paid_app
Purchase: premium
这篇关于库存不退换购买的订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!