How have you implemented restoreCompletedTransactions?

So I am implementing and ‘Unlock Full’ IAP to my game. I am using Prime31’s storekit, I’ve gotten mostly everything figured out. But I am a little confused about how to best implement restoreCompletedTransactions.

I wanted to put it in the Start function on the first launch of app to automatically restore transactions when it first opens. But the app then asks for your password and username immediately. Which is bad, so I assume it can’t be used like that.

So I gather you need to a ‘restore’ transactions button the user must click, and it can’t be done automatically.

If thats the case, do you put in a separate ‘buy’ and ‘restore’ button in your app? Or could is it more ideal to put in a ‘Buy or Restore if already purchased’ button. Then can you do restoreCompletedTransactions, and if nothing is restored, then prompt for purchase? Or will that make the user type in their username and password twice? Once when it attempts to restore, and another time after it fails and it tries to purchase? Or can I just use PurchaseProduct again to restore the full version, and since they’ve already bought it, it won’t charge them again. Or what?

How have you all dealt with this?

had to do this on one project. didn’t use unity but had to do the restoreallpurchases. from my experiences restoreallpurchases asks for the user’s itunes username/password. so i added a button to the purchase system to restore purchases. that way my app at start does not immediately pop open a password box. as a user i find that completely annoying and makes me wonder why the app needs it.

my personal rule of thumb. design the app/game so all password requests are user initiated.

Edit: originally wanted to implement it similiar to you so if they had previously purchased the game by the time they got to the title the full version would be restored.

raa made it many time but…

If I do remember well, it should return a complete list of the product the user bought.
The list looks like the same when you request product list.

From here you parse the content and unlock stuffs from your app.

That is all.

After up to you to prompt each time you find an already bought item etc…
But that is not a requirement from Apple.
They just require a button to restore previous purchase.