I'm implementing an auto-renewable subscription scenario, where the receipt validation will be handled by my server-side code. Following Apple's documentation, I'll be obtaining the receipt data from NSBundle
, and pass that data to my server, which will contact Apple to validate the receipt and inform the app about the result.
Now my questions are related to the necessary flows related to receipt validation:
If the user purchases a subscription, my receipt will be automatically updated with the information from that purchase? If so, is it necessary to validate that receipt right after a purchase or should I "unlock" the app immediately?
In what situations will my receipt be missing from
NSBundle
? If that happens, I suppose I should useSKReceiptRefreshRequest
to refresh the receipt, and send it to the server for validation.If the user installs the app in a different device and restores his purchases
restoreCompletedTransactions
do I automatically get the receipt at the same time? I suppose I need to validate the receipt after a restore to make sure there's an active subscription, correct?When my server tries to validate a receipt, and that receipt is not valid, what should happen on the app side? Refresh the receipt (which will ask user for credentials) and pass it to the server again for new re-validation?