I am in Android iAP hell!

i have testesd the corona sample and it seems to work.

but somehow my device seems to be messed up, i still get very random behaviour. is there a way to reset or sth?

i can purchase in the sample app, and i get a failure notification in the status bar for another game and product. restart didn’t help!

any ideas? [import]uid: 90610 topic_id: 33658 reply_id: 134936[/import]

The only reset I can think of is a “Factory data reset”, which you can do by going to Settings->Privacy->Factory Data Reset [import]uid: 70847 topic_id: 33658 reply_id: 134945[/import]

@ingemar: yes, thanks. but i guess i lose too much then. the funny thing is, all works fine with my other app with the same code :smiley:

…maybe I set up a new iAP product

EDIT: i just tried, i got a purchased event, then twice cancelled event. but content got unlocked.
let’s see…

EDIT2: now, when i try to purchase, it tells me that i already have this item -> press ok and theni get failed event. then i try to restore and nothing happens (what is actually right, since i have not bought anything). strange! [import]uid: 90610 topic_id: 33658 reply_id: 134946[/import]

Regarding EDIT 2.
I also had this behavior after I cancelled the transaction in my Google Merchant account (so I wouldn’t get billed).

Google told me I had already purchased the item, and the transaction failed when I pressed OK… and Restore didn’t do anything. It looks like that the cancellation of the Google Merchant transaction has immediate effect across the Google system causing the restore to fail, but it takes a few hours for the system to reset the purchase state so you can make a purchase again…
[import]uid: 70847 topic_id: 33658 reply_id: 134960[/import]

thanks for your reply! so I guess i wait a few hours and simply try again?

funny thing though is that sometimes, i get the failed event, sometimes nada when i press ok.
I’ve just realised that the only difference between my two games is that the old one is using director and module(…, package.seeall)…maybe this is causing all my trouble? [import]uid: 90610 topic_id: 33658 reply_id: 134961[/import]

This whole business of testing IAP on Android is a pain.
Having to wait X hours for things to reset is frustrating to say the least. The biggest annoyance is that you never know how long you have to wait…
[import]uid: 70847 topic_id: 33658 reply_id: 134962[/import]

yes, so true! but lets wait and see :slight_smile: [import]uid: 90610 topic_id: 33658 reply_id: 134963[/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]

i have testesd the corona sample and it seems to work.

but somehow my device seems to be messed up, i still get very random behaviour. is there a way to reset or sth?

i can purchase in the sample app, and i get a failure notification in the status bar for another game and product. restart didn’t help!

any ideas? [import]uid: 90610 topic_id: 33658 reply_id: 134936[/import]

The only reset I can think of is a “Factory data reset”, which you can do by going to Settings->Privacy->Factory Data Reset [import]uid: 70847 topic_id: 33658 reply_id: 134945[/import]

@ingemar: yes, thanks. but i guess i lose too much then. the funny thing is, all works fine with my other app with the same code :smiley:

…maybe I set up a new iAP product

EDIT: i just tried, i got a purchased event, then twice cancelled event. but content got unlocked.
let’s see…

EDIT2: now, when i try to purchase, it tells me that i already have this item -> press ok and theni get failed event. then i try to restore and nothing happens (what is actually right, since i have not bought anything). strange! [import]uid: 90610 topic_id: 33658 reply_id: 134946[/import]

Regarding EDIT 2.
I also had this behavior after I cancelled the transaction in my Google Merchant account (so I wouldn’t get billed).

Google told me I had already purchased the item, and the transaction failed when I pressed OK… and Restore didn’t do anything. It looks like that the cancellation of the Google Merchant transaction has immediate effect across the Google system causing the restore to fail, but it takes a few hours for the system to reset the purchase state so you can make a purchase again…
[import]uid: 70847 topic_id: 33658 reply_id: 134960[/import]

thanks for your reply! so I guess i wait a few hours and simply try again?

funny thing though is that sometimes, i get the failed event, sometimes nada when i press ok.
I’ve just realised that the only difference between my two games is that the old one is using director and module(…, package.seeall)…maybe this is causing all my trouble? [import]uid: 90610 topic_id: 33658 reply_id: 134961[/import]

This whole business of testing IAP on Android is a pain.
Having to wait X hours for things to reset is frustrating to say the least. The biggest annoyance is that you never know how long you have to wait…
[import]uid: 70847 topic_id: 33658 reply_id: 134962[/import]

yes, so true! but lets wait and see :slight_smile: [import]uid: 90610 topic_id: 33658 reply_id: 134963[/import]

well its definately NOT related to corona, because i just compiled another game and all works fine.

the only difference: that game is published. can someone please answer me:

  • does the uploaded binary need to have the same version number as the one i am testing with? does it need to be the same binary anyway?
  • it should be no problem to test it, even with unpublished (iAP item published though)
  • sometimes i get a failed event, with the android.test.purchased event. how comes?

thanks :slight_smile: [import]uid: 90610 topic_id: 33658 reply_id: 135561[/import]

Hi!

The version *code* of the APK you upload must be the same as the version *code* you have installed on your test device, however the uploaded APK on Google Play doesn’t have to be published. For IAP, the products must be published though.
It doesn’t need to be the same binary file either. The only important thing is that the version codes of the uploaded APK and the binary on the test-device are the same.
(Version *name* doesn’t officially matter, however I have a practice where I always make sure that both version code/name are the same on the uploaded APK and the binary on the test-device)

Note that (as usual) it can take serval hours for a newly uploaded APK to propagate though the system and be recognized for testing.

What I usually do before a testing-phase on Google Play is to upload a dummy APK a day before testing, only making sure that the package id (com.mycompany.appname), version code and version name are set to what I’ll use in my official release. Binary content irrelevant (basically a “hello world” app will do).

I’ll then do my testing and only compile for my devices using the same version code and version name until I’m satisfied with the app.
Once testing is done I just delete the previously uploaded APK from Google Play and upload my final APK that I publish. [import]uid: 70847 topic_id: 33658 reply_id: 135562[/import]

thanks a lot ingemar! i thought it didnt matter what version u have uploaded.

now i can run the android.test.purchased without problems!!! [import]uid: 90610 topic_id: 33658 reply_id: 135575[/import]