Restore button for IAP

Ok, so my update with IAP got rejected because it didnt have a restore button for purchased products.

So I added the option of choosing to buy / restore / cancel when hitting the button that unlocks the feature.

The buy version works as it should, and also tells if you have bought the feature before and then allow you to restore it and takes the user to the feature as it should.

when I hit the restore button however I cant get it to work. So can anyone tell me what I have to do? Currently the button runs store.restore(). should that not trigger event.transaction.state == “restored”?

what does happen when I click the restore button is that it asks me to login with the user and then nothing.

any tips would be great, thanks! [import]uid: 17969 topic_id: 27468 reply_id: 327468[/import]

ok, so done some more testing and when trying the store.restore() the program never enters the callback I set up when: store.init(transactionCallback)

so somewhere after entering the username/password and before where it should go to the transactionCallback an error happens.

is there a way to get the errors or some kind of output from the store function? [import]uid: 17969 topic_id: 27468 reply_id: 111668[/import]

ok, so I solved it somehow at the end. Not sure exactly what made it but was most likely a combination of some spelling error and when things got run. At least all is good now :slight_smile: [import]uid: 17969 topic_id: 27468 reply_id: 111815[/import]

Was about to post about the same topic, but this was the first thing here. I also got a rejection for trying to call restore() automatically after install (with the nice intention of transparently restoring your purchases). The review notes stated that it was “a non standard way to use restore and it would be more appropriate to use a restore button”. So Apple is definitely keeping an eye on this and expects to see a Restore-button on iAP. [import]uid: 46570 topic_id: 27468 reply_id: 111865[/import]

matias.kiviniemi, thanks. How about doing both automatic calling at startup and having a button? Maybe such combination will get approved. [import]uid: 58303 topic_id: 27468 reply_id: 111869[/import]

“If you build it, they will review it” :slight_smile:

With Apple you never know. Having the restore button is probably stronger requirement. But I think they also took offence from the fact that it will force everyone to enter IAP credentials the first time they start the app (which is not good to be honest). Maybe do it so that do a restore only if store is already initialized to not trigger extra credentials query. But then I don’t know if it’ll help fight piracy (i.e. assuming it’s jailbroken devices & hacked binaries anyhow). [import]uid: 46570 topic_id: 27468 reply_id: 111886[/import]

There probably is a problem with store.RESTORE function. When I don’t bought any products before, RESTORE don’t even call purchase listener. Purchase listener is called only when I bought before any products. IMHO something is wrong in Corona with this function. [import]uid: 50988 topic_id: 27468 reply_id: 112749[/import]

Quick question for you guys. So if I had an “Freemium” app, and the user paid and unlocked the full app with a IAP on their iphone. Is it easy and/or possible when they get on their iPad (with the same itunes account) to validate that they already purchased the full app? Mainly just wondering if apple holds a receipt of sorts for that itunes account and then you access it and see? I’m just starting to figure this stuff out, thanks! [import]uid: 19620 topic_id: 27468 reply_id: 113292[/import]

the purchase of the IAP is linked to the users account so it will be registered as bought and the user can simply restore the purchase on another device. [import]uid: 17969 topic_id: 27468 reply_id: 113301[/import]

Ok, sorry one other question. Will it work the same even if I have 2 separate apps? What I am thinking of doing is having the normal app, then having the app in HD for iPad (so both apps have the same content just one has HD visuals) Can IAP items be used across apps like this? Or are do they have to belong to only 1 app id? [import]uid: 19620 topic_id: 27468 reply_id: 113357[/import]

@info09 How are you handling that situation? I am running into the same thing. If no product has been purchased before, restore doesn’t seem to call back. [import]uid: 41124 topic_id: 27468 reply_id: 113413[/import]

Unfortunately I don’t resolved it. Actually my app is waiting for Apple review.
Maybe this not working only with iTunes test account and when app will be available, Restore will work correctly… this should be clear after Apple review. [import]uid: 50988 topic_id: 27468 reply_id: 113613[/import]

Well there has to be SOME way to do it right? everyone else using the restore call is making it work somehow… Anyone that might know whats the deal with this situation, please help us out! [import]uid: 19620 topic_id: 27468 reply_id: 113644[/import]

I think restore worked in test sandbox, but test account get regularly reset (~every day). So to test restore you need to first purchase, then restore. I’m not 100% sure on this.

Also it’s true that if there is nothing to restore, then there is no callback which is annoying. What I did was to have a restore button that starts a wait dialog and has a ~20sec timeout. [import]uid: 46570 topic_id: 27468 reply_id: 113646[/import]

I have filed a bug and a separate forum post (to give it more visibility) on the restore issue (http://developer.anscamobile.com/forum/2012/06/27/storerestore-doesnt-call-back-if-there-no-items-restore). Please go and let the Corona guys know how important this issue is.
[import]uid: 41124 topic_id: 27468 reply_id: 113917[/import]