I have a system where the app has sent its original transaction receipt (iOS6 style) to the server, and the server diligently verifies it whenever the latest receipt expiry time comes around. This is done entirely on the server after the initial purchase with no further input from the App, because Apple returns the latest receipt each time I do the verify request.
This has worked great so far. However, with increased volume recently I have had some false negatives. On a subscription that has not been cancelled, when I send my verification request Apple is sometimes returning the 21006 error code and giving me a typical expired response as though there hasn't been a new receipt created yet. My server always checks on the hour after the expiry time. Is this too short a time period after the expiry? Do I have to allow more time for Apple to renew the receipt information?
When I look at an example bad response, It has status 21006, it has a latest_expired_receipt_info field where the receipt is the same info as the latest one I received last month. It is as though the new receipt just isn't there yet even though I know this subscription is not cancelled.
For these cases, when I notice them and know for a fact the subscription was not cancelled, I re-trigger the server verification manually, and on this manual attempt (usually hours after the first expiry-time-is-up check) I do get a fully valid new receipt back.
Does anybody have any ideas what could be causing this behaviour? It is very confusing to me but seems wrong that Apple would ever return the wrong data.
I have considered upgrading to the newer app receipt method instead, Can the new App receipt system be used in a similar manner without further input from the App? I would not be able to replace all of the iOS6 style receipts already on my server anyway though, so I would have to keep using both systems.
I hate to be the bearer of bad news on this subject, The latest_receipt field in the applicationReceipt is still the iOS 6 style of receipt which as per the SKPaymentTransaction.h interface file, the transactionReceipt is deprecated as of iOS 7. iTunesConnect continues to return the transactionReceipt and the latest_receipt_info section of the applicationReceipt.
If there is a desire for offline support of auto-renewing subscriptions, this is an enhancement request for iTunesConnect to implement. Please submit the ER using the Apple Developer Bug Report web page <http://bugreport.apple.com>
Please understand that as a DTS engineer, I support the use of the iOS API's which are implemented by iOS engineering. The issue here is not with the use of the API's, but with the processing of the receipt as managed by iTunes Connect. As such, where there are anomalies, I can assist with the submission of bug reports for iTunes Production Support to investigate. My recommendation, as presented in my response to the developer forum article <https://forums.developer.apple.com/thread/48386> is to base the status of an auto-renewing subscription on the contents of the in_app array of the applicationReceipt.
rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI