I am new to in-app purchases. I have successfully implemented and tested code to let user make a purchase within our app.
The question I have is once the user hits purchase my app button, do I set a NSUserDefaults variable to TRUE in my app so that I can unlock all the features that were locked. Meaning I check if that NSUserDefaults is TRUE then show them more stuff.
Is this the best approach to take? What I have noticed is that if user has multiple apple products (iphones/ipads) with the same ID and that purchased app moves through cloud to those other devices then he will have to click on the purchase item button again to “unlock” the features on those other apps. (since I will be setting the NSUserDefaults variable locally and setting it TRUE if purchase was successful or purchase restored) Though he won’t get double charged though its annoying for the user to click on the button again.
Is there a better approach I can take?
OR
Is there a way in code I can check if he had purchased that app ON LAUNCH so that I can set the NSUserDefaults purchased to TRUE.
You can use
restoreCompletedTransactionsmethod ofSKPaymentQueueto restore all the purchases the user has purchased before. However, this method displays an alert to the user for entering his Apple ID and password. So you should not use it at launch. Instead, display a button that the user can tap to restore his purchases.