I am in Android iAP hell!

hi all,

I am in android iAP hell. i get funny behaviors:

  • transaction finished, then get a cancelled event
  • purchase event, then cancelled event
  • can not restore purchased item
  • sometimes getting twice purchased event etc
  • after restart of the device i get different behaviour

i thought that my transaction might not get finished (but actually it does). but somehow its messed up. anyone else experienced sth like this? might be dev account for testing that messes it up? The iAP items is published and the binary activated.

any suggestions, ideas? much appreciated.
[import]uid: 90610 topic_id: 33658 reply_id: 333658[/import]

I’m in a phase of testing before release and I’ve noticed the same thing when I use Google’s test-product codes (like “android.test.purchased”).

I get a “purchased” callback, and then a “failed” callback.
I’m going to do some testing now with my actual product ID to see if the same happens there.

This happens on Android 2.3.6 as well as 4.2.1 [import]uid: 70847 topic_id: 33658 reply_id: 133832[/import]

I have the same issues with my own produc ids. android 2.3.4.

I have just realised that i am not putting the first argument to store.init(), “google”. might this cause my problems? I will check! [import]uid: 90610 topic_id: 33658 reply_id: 133837[/import]

Yeah, I would guess that not specifying the store would cause weird problems…

I’ve managed to do some testing with my own product ID’s and using my Android test account for purchasing. I don’t get a double callback, which is great.

Not sure if the double callback when using Google’s product ID’s is a Google or Corona bug though…
I plan on submitting a bug report to Corona, but don’t have any spare time to write a sample app yet. [import]uid: 70847 topic_id: 33658 reply_id: 133860[/import]

thanks for your reply. i am pretty confident that all my problems will be gone too (I’ll test tomorrow).

glad it worked out for you! [import]uid: 90610 topic_id: 33658 reply_id: 133863[/import]

Not so good news :frowning: Further testing reveals I still get double callbacks sometimes.

Luckily it doesn’t affect the final outcome since the order in which they arrive allows the user to successfully purchase the IAP product.
I guess it’s also due to the logic I have in my code in that the second “failed” callback doesn’t affect the first “purchased” callback.
Luckily it’s a “failed” callback, and not a “cancelled” callback, otherwise it would be a showstopper. As it is now I can still reluctantly publish the app.

Where the problem is (Google vs Corona), I don’t know. Like I said above I just don’t have the spare time right now to write a test-case, and until I do so CoronaLabs will not accept a bug report. [import]uid: 70847 topic_id: 33658 reply_id: 133971[/import]

thanks for your report. I get a purchased event, and just after a cancelled event. this is a show stopper for me right now. and i don’t get your failed callback. [import]uid: 90610 topic_id: 33658 reply_id: 133994[/import]

I’m starting to suspect that it’s a bug in Corona SDK, because out of all of the purchases I’ve made (over a dozen), every single purchase has been reported as successful in my Google Merchant account. Corona generates a double-callback in a majority of these, but not all.

Next week when I have more time I’m going to write some code with a repeatable test-case so that I can report this to CoronaLabs.

EDIT:
By the way: iOS In-App purchasing is flawless…
[import]uid: 70847 topic_id: 33658 reply_id: 134001[/import]

yes, iOS works perfect.

i am pretty sure its something with the callback called twice, since i also get the purchases charged from google. tom will have a look at it, since the corona iap demo faces the same problem.
[import]uid: 90610 topic_id: 33658 reply_id: 134005[/import]

I’m in a phase of testing before release and I’ve noticed the same thing when I use Google’s test-product codes (like “android.test.purchased”).

I get a “purchased” callback, and then a “failed” callback.
I’m going to do some testing now with my actual product ID to see if the same happens there.

This happens on Android 2.3.6 as well as 4.2.1 [import]uid: 70847 topic_id: 33658 reply_id: 133832[/import]

I have the same issues with my own produc ids. android 2.3.4.

I have just realised that i am not putting the first argument to store.init(), “google”. might this cause my problems? I will check! [import]uid: 90610 topic_id: 33658 reply_id: 133837[/import]

Yeah, I would guess that not specifying the store would cause weird problems…

I’ve managed to do some testing with my own product ID’s and using my Android test account for purchasing. I don’t get a double callback, which is great.

Not sure if the double callback when using Google’s product ID’s is a Google or Corona bug though…
I plan on submitting a bug report to Corona, but don’t have any spare time to write a sample app yet. [import]uid: 70847 topic_id: 33658 reply_id: 133860[/import]

thanks for your reply. i am pretty confident that all my problems will be gone too (I’ll test tomorrow).

glad it worked out for you! [import]uid: 90610 topic_id: 33658 reply_id: 133863[/import]

Not so good news :frowning: Further testing reveals I still get double callbacks sometimes.

Luckily it doesn’t affect the final outcome since the order in which they arrive allows the user to successfully purchase the IAP product.
I guess it’s also due to the logic I have in my code in that the second “failed” callback doesn’t affect the first “purchased” callback.
Luckily it’s a “failed” callback, and not a “cancelled” callback, otherwise it would be a showstopper. As it is now I can still reluctantly publish the app.

Where the problem is (Google vs Corona), I don’t know. Like I said above I just don’t have the spare time right now to write a test-case, and until I do so CoronaLabs will not accept a bug report. [import]uid: 70847 topic_id: 33658 reply_id: 133971[/import]

thanks for your report. I get a purchased event, and just after a cancelled event. this is a show stopper for me right now. and i don’t get your failed callback. [import]uid: 90610 topic_id: 33658 reply_id: 133994[/import]

I’m starting to suspect that it’s a bug in Corona SDK, because out of all of the purchases I’ve made (over a dozen), every single purchase has been reported as successful in my Google Merchant account. Corona generates a double-callback in a majority of these, but not all.

Next week when I have more time I’m going to write some code with a repeatable test-case so that I can report this to CoronaLabs.

EDIT:
By the way: iOS In-App purchasing is flawless…
[import]uid: 70847 topic_id: 33658 reply_id: 134001[/import]

yes, iOS works perfect.

i am pretty sure its something with the callback called twice, since i also get the purchases charged from google. tom will have a look at it, since the corona iap demo faces the same problem.
[import]uid: 90610 topic_id: 33658 reply_id: 134005[/import]

Everyone,

Just to let you know, Google Play in-app purchases used to work in Corona, but we’ve noticed that Google Play’s in-app purchase system has been recently updated to version 3 and that it now requires us to make some simple changes on our end to get it working again. This issue is now fixed as of daily build #984, which is available now. Please give it a go and let us know if it fixes this issue for you too. Thanks! [import]uid: 32256 topic_id: 33658 reply_id: 134895[/import]

i will give it a try, thanks a lot! [import]uid: 90610 topic_id: 33658 reply_id: 134928[/import]

Based on my initial testing with 2012.984 all is clear!

I haven’t seen any double callbacks. I’ve also checked the logs and I can’t see any errors there either. [import]uid: 70847 topic_id: 33658 reply_id: 134932[/import]