Google Play应用内结算版本3:在“已拥有商品已拥有”时崩溃并失踪失败通知 [英] Google Play in-app billing version 3: crash on "item already owned" and missing failure notifications

查看:1250
本文介绍了Google Play应用内结算版本3:在“已拥有商品已拥有”时崩溃并失踪失败通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在(最终)发布第二版Google Play应用内结算后,除了发布后的问题之外,我什么都没有。丢失的交易,崩溃,无法恢复,像无法下载,你已经拥有这个项目等疯狂的错误,以及其他各种荒谬的事情。老实说,我已经在iOS,Amazon App Store,Samsung Apps和Blackberry 10上集成了IAB,而且Google Play代码比其他所有代码的组合时间更长。十次。这真是太糟糕了。

Anywayyyy,我决定尝试将v3应用到我的应用中。整合过程非常简单得多,所以对Google很赞赏。此外,恢复以前的交易现在按预期工作,这很好。但是,我遇到了一些显示停止问题:


  1. 当用户关闭IAB对话框时(即在对话框之外轻敲边界),我没有收到任何通知。我希望收到某种用户取消失败事件,但没有任何事情可以触发onIabPurchaseFinished,onConsumeFinished或onQueryInventoryFinished。因此,我的应用程序没有响应,我留下了一个肮脏的伟大的未使用的活动在屏幕上。我是否缺少某种dialogIsFinished事件?

  2. 当用户试图购买他们已经拥有的商品时,应用程序崩溃。令人难以置信的是,它看起来像是预期的行为,因为有些东西暗指打印到控制台(应用内结算错误:无法购买商品,错误响应:7:已有商品)。我知道我应该在启动时查询可恢复的事务,但这不是一个解决方案,因为可以想象,用户可以在还原操作完成之前导航到我的UI的购买流程。当然,这应该是一个非硬性的停止,就像对话框或什么的?我在这里做错了什么?我简直无法理解Google上的某个人认为这种情况应该导致严重的崩溃......

非常感谢) 您的帮助。如果您认为这是必要的,我很乐意分享代码,尽管我的问题似乎更多地关注功能设计。我希望我在这里做错了一件事,因为我觉得像谷歌这样有能力的公司会重写这整个系统,并且在整个地方仍然有这么大的漏洞......我不可思议: - /



再次感谢,


解决方案

嗯,那是我的错误。当我写launchPurchaseFlow()时,我最终失败了一些失败案例的清理代码。不仅在那里,而且在那之后还有一些catch {}子句。感谢您指出了这一点!这已在源代码库中得到修复: http://code.google.com/p/marketbilling


After (eventually) shipping a v2 implementation of the Google Play in-app billing, I've had nothing but problems with it post-launch. Dropped transactions, crashes, unable to restore, crazy errors like "can't download, you already own this item", and all sorts of other ridiculous things. Honestly, I've integrated IAB on iOS, Amazon App Store, Samsung Apps and Blackberry 10 now and the Google Play code has taken more time than all the others combined. Times ten. It's just terrible.

Anywayyyy, I've decided to try and implement v3 into my app. The integration process was much, much simpler, so kudos to Google for that. Also, restoring previous transactions now works as expected so that's great. However, I've got a couple of show-stopping problems:

  1. When the user dismisses the IAB dialog (i.e. tapping outside of the dialog borders), I don't receive any notification of this. I would expect to receive some kind of "user cancelled" failure event, but nothing is fired to onIabPurchaseFinished, onConsumeFinished or onQueryInventoryFinished. As a result my app doesn't respond to this and I'm left with a dirty great unused Activity on the screen. Am I missing some kind of "dialogIsFinished" event?
  2. When the user tries to purchase an item that they already own, the app crashes. Unbelievably it looks like this is the intended behaviour, as there's something alluding to this printed to the console ("In-app billing error: Unable to buy item, Error response: 7:Item Already Owned"). I understand that I'm supposed to query for restorable transactions at launch, but this isn't a solution as it's conceivable the user can navigate to the purchase flow of my UI before the restore operation finishes. Surely this should be a non-hard stop, like a dialog box or something? Am I doing something wrong here? I simply can't understand that somebody at Google thinks that this situation deserves a hard crash...

Thanks very much (in advance) for your help. I'm more than happy to share code if you think it's necessary, although my questions seem to be more about the functional design more than anything else. I'm hoping that I'm doing something wrong here, as it's inconceivable to me that a company as capable as Google would re-write this entire system and still have such massive holes all over the place... :-/

Thanks again,

Ben

解决方案

Hmm, that was my mistake. When I wrote launchPurchaseFlow(), I ended up missing some cleanup code on failure cases. Not only there, but also on a couple of catch{} clauses after that. Thanks for pointing that out! This has just been fixed in the source repository: http://code.google.com/p/marketbilling

这篇关于Google Play应用内结算版本3:在“已拥有商品已拥有”时崩溃并失踪失败通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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