Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2103] Android: In-App Billing Module - PURCHASE_STATE_CHANGED_EVENT Not Firing

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2013-05-28T16:47:06.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterKyle Berezin
AssigneeEric Wieber
Created2013-05-12T14:07:25.000+0000
Updated2016-03-08T07:41:04.000+0000

Description

Using the in-app-billing module from the marketplace, I can't get the PURCHASE_STATE_CHANGED_EVENT to fire. The code I am using is the example app.js from the module. The device I tested on was an A855 droid. The purchase window comes up and after accepting, nothing happens. Atleast one other user has the problem. http://developer.appcelerator.com/question/151587/android-in-app-billing-issue#comment-172249.

Attachments

FileDateSize
Screenshot_2013-05-18-20-35-57.png2013-05-19T00:39:49.000+0000117910

Comments

  1. Carter Lathrop 2013-05-19

    Hello Kyle, I downloaded the module and loaded the example up on device (Samsung Galaxy S3 4.1.2) and was unable to reproduce what you are experiencing. Correct me if I am wrong but are these the series of actions you are taking? 1. Load up the app 2. Press "Buy" button 3. Press "Buy" button again on subsequent pop up 4. Payment successful alert pops up at this point, there have been many alerts towards the bottom of my screen giving me Request IDs and states that I am currently in.. after the payment successful pop up, I get an alert with the message seen in screenshot I attached. If you are getting something different (or nothing at all) then it may have something to do with using an older version of Android. Can you do me a favor and try this code out on an emulator with a higher android version (3.0 or higher), if it works as expected here we can rule out any issues with your build/studio and I can report a bug that this doesn't work on earlier versions of android. Thanks for your cooperation and patience, I will be awaiting your reply, Carter
  2. Kyle Berezin 2013-05-20

    My A855 was off for a while and when I turned it back on to see if I could get you any more info on what was happening, it decided to work. I am not sure what caused the intermittence, I can assure you I am not just saving face and acting as though I made no mistake. Perhaps it just needed a good shutdown, restart.
  3. Carter Lathrop 2013-05-22

    Kyle, No worries, sometimes weird things happen, especially with older versions of android. If you run into this problem again, just return to this ticket and reply with any more information and I would be glad to revisit it. Good to hear things are working fine now though. Regards, Carter
  4. David Asher 2013-05-23

    This issue is not resolved. My app was released a week ago with in-app billing working perfectly. Several customers made purchases, then the purchases stopped. Now that I trace the app, I find that PURCHASE_STATE_CHANGED_EVENT is not firing. Happens on Android 4 and 2.2.3.
  5. Carter Lathrop 2013-05-27

    David, Would you mind providing a detailed list of steps to reproduce where you are seeing this error occur? I must be able to successfully reproduce the bug in order to bring it to engineerings attention or they will be lost on how to exactly fix it. Thanks, Carter
  6. Carter Lathrop 2013-05-27

    Also, include the devices, the build version of studio you deployed the app with as well as the SDK version. Thanks for your cooperation, Carter
  7. David Asher 2013-05-28

    Hi Carter, I'm fairly confident this is a problem within the Google Play service. The following link is to a screenshot of my Google Play account. You can see that between May 19 and May 26 revenue stopped. I can confirm during this period that I have debugged my app and found that PURCHASE_STATE_CHANGED was never received, and the app appeared to hang. On May 25 I started looking for a workaround and something triggered Google Play to again respond to purchase requests, so clearly without any change in the published app, Google Play is showing different behavior on different days. https://www.box.com/s/e0r5c4pnm4kdd37bihb9 Also, here are several links showing that this problem has been reported for two years now, without being addressed: https://groups.google.com/forum/?fromgroups#!topic/android-developers/RoAEFI8-NBs https://code.google.com/p/marketbilling/issues/detail?id=29 http://stackoverflow.com/questions/16217272/with-new-in-app-billing-com-android-vending-billing-purchase-state-changed-inte This is clearly a serious issue because, if it happens during restoreTransactions() it will appear to cause the app to hang waiting for a response and the developer loses the customer, and if it happens during requestPurchase() then Google happily completes the purchase and charges the customer without notifying the app to deliver the content. The fact that I've seen this happen with both restoreTransactions() and requestPurchase() is further indicator of a Google problem. The workaround I'm going with is to set a brief timer and send restoreTransactions() a second time if PURCHASE_STATE_CHANGED is not received, but there is really no way to prove that this works. Thanks, David
  8. Carter Lathrop 2013-05-28

    Thanks for looking into this David. It is unfortunate that this is hindering sales for quite a few developers, including yourself. I hope that google finds a resolution to this quickly. As this is not a Titanium bug I am going to resolve this for now. Thanks for your cooperation and insight with this. I will be sure to link other people who are having the same problem to your response as your workaround might be helpful to some people. Regards, Carter

JSON Source