Android store.restore() does not work. need help.

I got In-app purchase to work in my Android app but calling store.restore() doesn’t return a transaction state. I am using a test account and I have managed products that I bought.

Did anyone get restore to work on Android?

Corona, is store.restore on Android supposed to work?

Thanks. [import]uid: 1884 topic_id: 29859 reply_id: 329859[/import]

I think I have the same problem. If I purchase the IAP to unlock my game and then delete the game, my game is stuck and cannot be unlocked again. It would seem like store.restore() would do exactly what I need except it doesn’t appear to work either.

Also - the transaction errors from Google for already purchased is just a general failed error with no useful details. [import]uid: 128282 topic_id: 29859 reply_id: 121898[/import]

I think I have the same problem. If I purchase the IAP to unlock my game and then delete the game, my game is stuck and cannot be unlocked again. It would seem like store.restore() would do exactly what I need except it doesn’t appear to work either.

Also - the transaction errors from Google for already purchased is just a general failed error with no useful details. [import]uid: 128282 topic_id: 29859 reply_id: 121898[/import]

guys so what do you do? [import]uid: 138593 topic_id: 29859 reply_id: 127440[/import]

guys so what do you do? [import]uid: 138593 topic_id: 29859 reply_id: 127440[/import]

same here [import]uid: 90610 topic_id: 29859 reply_id: 133648[/import]

Let me make sure I understand the problem. You get NO event what so ever or you get NO restored event? Google doesn’t have a restored event, the request comes back as purchased, not restored (see: http://www.coronalabs.com/blog/2012/03/13/getting-started-with-android-in-app-billing/)

But if you’re getting nothing back that would indicate a different problem. I suspect before we can answer this, we will need to see some code.

[import]uid: 199310 topic_id: 29859 reply_id: 133669[/import]

@Rob: it means that after calling store.restore() the listener doesnt get fired. I can make a purchase, then deinstall the app, install again, restore, and nothing happens.

BUT i first need to check on my side, i am not sure if my device is messed up a bit, i see some strange iAP behaviour using the same code as with another game (where it works like a charm!).

[import]uid: 90610 topic_id: 29859 reply_id: 133671[/import]

same here [import]uid: 90610 topic_id: 29859 reply_id: 133648[/import]

Let me make sure I understand the problem. You get NO event what so ever or you get NO restored event? Google doesn’t have a restored event, the request comes back as purchased, not restored (see: http://www.coronalabs.com/blog/2012/03/13/getting-started-with-android-in-app-billing/)

But if you’re getting nothing back that would indicate a different problem. I suspect before we can answer this, we will need to see some code.

[import]uid: 199310 topic_id: 29859 reply_id: 133669[/import]

@Rob: it means that after calling store.restore() the listener doesnt get fired. I can make a purchase, then deinstall the app, install again, restore, and nothing happens.

BUT i first need to check on my side, i am not sure if my device is messed up a bit, i see some strange iAP behaviour using the same code as with another game (where it works like a charm!).

[import]uid: 90610 topic_id: 29859 reply_id: 133671[/import]

Interesting… our Google in-app purchase system was one of our features that worked perfectly on the first shot and we’ve never had to touch the code since we’ve introduced it. Now it sounds like something has suddenly broke or Google has changed something on their end that we have to add support for.

Currently, there is no one available to look into these issues this week. So, I’m going to have to ask you guys to provide us some more details until and isolate the issues until we do have time. We should have time to look at this next week.

So, I’m seeing two issues on this thread:

  1. Restores are not working.
  2. The transaction Lua listener is getting called twice per transaction.

Regarding restores, you will never get a “restore” transaction state with Google Play. That is normal. Every product purchased in the past will come across as new purchases in your Lua listener. This is because the notifications received from Google Play do not distinguish if they are restored purchases or not. That’s just the way Google made it. So, I’ll have to ask you to verify that your Lua listener is actually receiving all of the expected transactions as new purchases and report back.

Regarding purchases, does our sample app “Networking/InAppPurchase” that is included with the Corona SDK work correctly? Note that it is set up so that only the top button will provide a successful purchase and the other buttons were designed to test “canceled” and “item-unavailable” purchases. So, when you attempt a purchase, does it succeed? Or do you get a success transaction that is quickly followed by an error? ie: You Lua listener is getting called twice for one purchase.

Again, any additional information you can provide here will help us provide a quicker turnaround on our end. Thanks in advance.
[import]uid: 32256 topic_id: 29859 reply_id: 133916[/import]

@Joshua: I gave it a try, lemonade refill. First transaction successfull, then just after transaction failed, invalidClient. so I guess your own demo app is a good start for you.

and somehow i still get failed events for my other app (like 6 until now, I’ve only tried to buy it once). [import]uid: 90610 topic_id: 29859 reply_id: 133995[/import]

HI VOPMMS,
the problem is in version number which is different from your last live built.

The version number of your built should match with built which is live. ( Mostly our live built version is 2 and we built our new version 3 for our next release and continues testing for our next version. In-app purchase restore button fails over here. To solve this, make your version number similar to the live version )

Kind Regards,
Haroon Yaseen [import]uid: 108129 topic_id: 29859 reply_id: 134000[/import]

Interesting… our Google in-app purchase system was one of our features that worked perfectly on the first shot and we’ve never had to touch the code since we’ve introduced it. Now it sounds like something has suddenly broke or Google has changed something on their end that we have to add support for.

Currently, there is no one available to look into these issues this week. So, I’m going to have to ask you guys to provide us some more details until and isolate the issues until we do have time. We should have time to look at this next week.

So, I’m seeing two issues on this thread:

  1. Restores are not working.
  2. The transaction Lua listener is getting called twice per transaction.

Regarding restores, you will never get a “restore” transaction state with Google Play. That is normal. Every product purchased in the past will come across as new purchases in your Lua listener. This is because the notifications received from Google Play do not distinguish if they are restored purchases or not. That’s just the way Google made it. So, I’ll have to ask you to verify that your Lua listener is actually receiving all of the expected transactions as new purchases and report back.

Regarding purchases, does our sample app “Networking/InAppPurchase” that is included with the Corona SDK work correctly? Note that it is set up so that only the top button will provide a successful purchase and the other buttons were designed to test “canceled” and “item-unavailable” purchases. So, when you attempt a purchase, does it succeed? Or do you get a success transaction that is quickly followed by an error? ie: You Lua listener is getting called twice for one purchase.

Again, any additional information you can provide here will help us provide a quicker turnaround on our end. Thanks in advance.
[import]uid: 32256 topic_id: 29859 reply_id: 133916[/import]

@Joshua: I gave it a try, lemonade refill. First transaction successfull, then just after transaction failed, invalidClient. so I guess your own demo app is a good start for you.

and somehow i still get failed events for my other app (like 6 until now, I’ve only tried to buy it once). [import]uid: 90610 topic_id: 29859 reply_id: 133995[/import]

HI VOPMMS,
the problem is in version number which is different from your last live built.

The version number of your built should match with built which is live. ( Mostly our live built version is 2 and we built our new version 3 for our next release and continues testing for our next version. In-app purchase restore button fails over here. To solve this, make your version number similar to the live version )

Kind Regards,
Haroon Yaseen [import]uid: 108129 topic_id: 29859 reply_id: 134000[/import]

@Joshua: I really hope you guys can fix that this coming week, since 2 games just wait to have that fixed… and we want to release before christmas :slight_smile: [import]uid: 90610 topic_id: 29859 reply_id: 134282[/import]

@Joshua: any update? [import]uid: 90610 topic_id: 29859 reply_id: 134482[/import]

Strange, I didn’t have any problems with the restore process on Android.
One thing to note though, as Joshua mentioned in his post above, is that the “restored” callback is never sent. You’ll always get a “purchased” callback even on a restore.

Some other things off the top of my head:

Restores will only work for managed items. If your in-app items are unmanaged, you can’t use Google’s restore feature.

Also if you’re too quick to cancel the transaction in your merchant account the restore won’t work, and you’ll have to wait a few hours for Google’s system to reset your testing account again.
[import]uid: 70847 topic_id: 29859 reply_id: 134486[/import]