Reputation:
I have a subscription SaaS web application that I am now building an iOS app for. Per Apple's guidelines I am implementing the subscription functionality as IAP for users who sign up through the iOS app.
The IAP is an auto-renew subscription.
When the user signs up and completes the IAP, can I then store the IAP receipt in my web app user database and check against it at any time to determine if the user's auto renew subscription is still valid? This seems like it would work, but I am unsure whether the receipt remains the same throughout the lifetime of the user's auto-renew subscription or if it expires and changes in any way.
So to summarize, to these receipts expire or can I check it to determine if the user's subscription is still valid in the future?
Upvotes: 2
Views: 1254
Reputation: 694
The In-App purchase receipts do not expire - that is, you can check them against Apple's servers at any given time to validate the subscription.
I could not find any documentation in regards to this, but I've been running an application with In-App purchases for over three years now and I have had no issues whatsoever. It also makes sense: there is no reason to invalidate a receipt. In a way, it forms part of a transaction history.
The closest thing I could find were the return codes at https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html - observe how there is no code for "invalid receipt" (21003 is for when the receipt cannot be found in Apple's databases). In your case, you want to check for 21006 as it tells you that a receipt is valid but the subscription is expired.
Upvotes: 1