0

I integrated the sample code (helper classes) for the inapp billing from the official Android website. I am trying to test error path ( i.e incorrect APK signature, no internet..etc). When this error occurs, the dialog shows the error such as " Error retrieving billing info ..etc"

The problem is that, once you click ok, the app continues (although I have checks everywhere to terminate the app when things go wrong). Before someone says "post some code", let me clarify here. I am not able to "catch the failure" in the sample code. I placed debug points everywhere. The last piece of code that is called is when the "purchase buying intent" is initiated. After that, I can't seem to find anywhere where the code would actually indicate failure (so I can action based on it)

anyone else faced this?

Snake
  • 14,228
  • 27
  • 117
  • 250
  • First thing that comes to mind is if its coming from the In app billing side of things in android. I would suspect that your purchase intent returns 'canceled'/;failed' or something similar. Have a look and see if the finish listener is getting hit. Also verify your checking that you can connect to google services. You may end up needing to post the code (probably not the code of the helper that you didn't modify). – Kalel Wade Apr 02 '15 at 21:04
  • I can successfully do a purchase if everything is right. I am testing with no internet connection or when I supply wrong SKU product. The lunchPurchaseFlow is called but the OnFinishListener is not called. Thats the confusing part!!! – Snake Apr 03 '15 at 02:13

1 Answers1

0

I found the reason for that

The overridden OnActivityResult was not called. So I corrected it and now it receives the results

Hoping this would save someone else many hours

Snake
  • 14,228
  • 27
  • 117
  • 250