Handling renewal of recurring subscriptions

When verifying receipts with the appstore, the documentation says you get back two values: status and receipt

And for two other values latest_receipt and latest_receipt_info are (quoting the docs):


"Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions."


1. In practice (for my > 7.0 iOS app), these four values are given: "status", "environment", "receipt" and "latest_receipt". Not knowing what "iOS 6 style" is, is it supposed to return "latest_receipt" or not?


2. Assuming non-"iOS 6-style" receipts are app-receipts that came in iOS 7, how do one handle/check for renewal of subscriptions WITHOUT using "latest_receipt"?



Perhaps is just the documentation wrong? https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

Accepted Reply

To everyone else who need this info. The answer is that both latest_receipt_info AND latest_receipt will ALWAYS be included in the receipt as long as there are one reccuring subscription (for the new "iOS 7 style" receipts). If no reccurring subscription has been bought, there will not be a latest_receipt. The documentation is just badly worded.


I used one of my technical support-tickets (you get a couple every year), and asked Apple. Their reply contained this information.

Replies

iOS 6 style receipt is the receipt in transaction.transactionReceipt. It is deprecated and could disappear at any moment. It is already starting to function a bit differently (i.e. it uses a more recent certificate than the pre-2016 receipts). An iOS6 style receipt returns 'latest_receipt'; for now!


To handle the renewal of a subscription you refresh the receipt on the device and use that refreshed receipt to obtain a record of all purchases. You parse the in_app receipts contained in the refreshed receipt and determine the subscription status. I believe the document is correct as it is once you understand what am iOS6 style receipt is.

This worries me alot since the subscription is for magazines which usually are published when users are not actively using the app - this will result in a worse experience for all subscribers. Since they need to manually open the app and restoring their subscription (that has already been renewed)...


Well, hope they change their minds before removing "iOS 6 style purchases".

It seems that the answer to this is:


If you have an older receipt that has been renewed, Apple will return the newest receipt when trying to verify the old receipt. How they will handle old receipts containing consumable purchases is a mystery though.


Source: WWDC videos, Using Store Kit With Swift (2016-702)


(Would appriciate if someone could confirm this).

If a device has called restoreCompletedTransactions then that device will receive a transaction in updatedTransactions the next time it launches or returns to foreground. All you need to do is check to see if the current subscription has expired. If it has expired then open a transaction observer and wait a few moments. If no transaction comes in then issue an alert telling the user they need to renew their subscription.

Don't believe everything you hear on the internet until you actually try it. I believe that video is wrong but I will be pleased to be corrected.

So would I, whatever is the right answer, it would be nice to know for sure. No one seems to know, several months has passed, and the bug-report I sent in June has not been answered.


I will just have to assume that latest_receipt cannot be used and whenever someone has a recurring purchase that needs renewal, they will need to open up their iPhone/iPad first.


If anybody wants to, feel free to duplicate radar: 28864177


Description here, the wording is not 100% but I hope it gets the point across: http://openradar.appspot.com/28864177

Hi Olaf, thank you for the note in your radar with Apple's confirmation that "latest_receipt" will always be in the /verifyReceipt validation. This topic has a lot of interest over the last several months. Did Apple also confirm "latest_receipt_info"? Is there anything you can reference (an email) or other from Apple to put this to rest for us. Much appreciated!

To everyone else who need this info. The answer is that both latest_receipt_info AND latest_receipt will ALWAYS be included in the receipt as long as there are one reccuring subscription (for the new "iOS 7 style" receipts). If no reccurring subscription has been bought, there will not be a latest_receipt. The documentation is just badly worded.


I used one of my technical support-tickets (you get a couple every year), and asked Apple. Their reply contained this information.