Use in_app or latest_receipt_info for getting latest receipt for auto-renewable iOS 7 style transactions? Use in_app or latest_receipt_info for getting latest receipt for auto-renewable iOS 7 style transactions? ios ios

Use in_app or latest_receipt_info for getting latest receipt for auto-renewable iOS 7 style transactions?


Just wanted to make clear that only the latest_receipt_info field is returning the latest renewed receipt. This is based on what we're actually getting back from Apple.

The relevant documentation is here on page 21.

Although it states that latest_receipt and latest_receipt_info fields are "Only returned for iOS 6 style transaction receipts for auto-renewablesubscriptions", we've found that they are being returned in our iOS 7 receipts. The in_app field within the receipt object is also returned with almost identical data, but doesn't contain the latest receipt info, which is the one you care about in the case of an auto-renewal.


To verify that an auto-renewable subscription has not expired check the latest_receipt_info element.

This is what's currently (2017-08-09) officially documented on the in_app and latest_receipt_info elements:

in_app

In the JSON file, the value of this key is an array containing all in-app purchase receipts based on the in-app purchase transactions present in the input base-64 receipt-data. For receipts containing auto-renewable subscriptions, check the value of the latest_receipt_info key to get the status of the most recent renewal.

(source)

latest_receipt_info

Only returned for receipts containing auto-renewable subscriptions. For iOS 6 style transaction receipts, this is the JSON representation of the receipt for the most recent renewal. For iOS 7 style app receipts, the value of this key is an array containing all in-app purchase transactions. This excludes transactions for a consumable product that have been marked as finished by your app.

(source)


Babken Vardanyan mentioned in multiple answer threads that latest_receipt_info is sometimes missing. One interesting thing I've seen in receipts in this thread https://forums.developer.apple.com/thread/92200 was the difference in latest_receipt_info vs in_app. When doing a diff I noticed the the first receipt in the chain was missing (containing is_trial_period=true). It didn't generate an in-app receipt equivalent.

As linked in the documentation: https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW4 says to use latest_receipt_info as "for iOS 7 style app receipts, the value of this key is an array containing all in-app purchase transactions."

In regards to subscriptions, you should not use in_app and only use latest_receipt_info.

https://www.revenuecat.com/2018/09/24/apple-subscription-notifications-are-almost-useless covers the edge cases like cancellation_date where it is a customer service provided cancellation like seen in this apple developer forum thread: https://forums.developer.apple.com/thread/96670