I posted the following to <https://forums.developer.apple.com/thread/93749>
If you read the description of the RENEWAL event, you will note - "Automatic renewal was successful for an expired subscription. Check Subscription Expiration Date to determine the next renewal date and time." In general, iTunes will attempt to charge the user account a day before an auto-renewing subscription is scheduled to expire. If the renewal is successful, there is no server-to server notification because the auto-renewing subscription did not enter into an expired state. However, in the few cases that iTunes is unable to renew the subscription (generally there was a connection problem with the credit card server) and the auto-renewing subscription is not renewed before the expiration_date passes, the auto-renewing subscription is technically considered “expired”. However, iTunes will still continue to attempt to renew the subscription. It iTunes is successful, then the “RENEWAL” event is sent. for this reason, the advice is presented - “Check Subscription Expiration Date to determine the next renewal date and time.”
To verify whether the auto-renewing subscription In-App Purchase is current, validate the appStoreReceipt with the verifyReceipt server. Assuming that there is an auto-renewing subscription item in the in_app array, then review the latest_receipt_info records and find the subscription record which has an expires_date later than the current date, one without the cancellation_date field set.
As for the CANCEL notification, there is no support for this notification in the sandbox.
CANCEL - Subscription was canceled by Apple customer support. Check Cancellation Date to know the date and time when the subscription was canceled.
Clarification - the term cancel is the specific case where the user contact Apple Care, requests a refund for the auto-renewing subscription In-App Purchase, is granted the refund, and the auto-renewing subscription has the cancellation_date set. This event is not the same as when the user enters their iTunes account - Subscription section, and indicates that they choose not to allow an existing auto-renewing subscription to renew. There is no notification type for this event. I call this the “EXPIRE” event - there is no server-to-server notification when the user makes this choice.
The only way for an application to detect that the auto-renewing subscription has simply expired is for the app process to validate the appStoreReceipt and to find that there is no longer an iAP item showing the expires_date greater than todays date. The process should also check for the presence of the is_in_billing_retry_period field in the most recent entry to determine whether the App Store is attempting to renew the auto-renewing subscription.
DID_CHANGE_RENEWAL_PREFERENCE - Customer changed the plan that takes affect at the next subscription renewal. Current active plan is not affected.
Clarification - If your app offers multiple items in an auto-renewing subscription group, then if the user has purchased a higher level item and attempts to switch to a lower grade auto-renewing subscription item (this is considered an auto-renewing subscription downgrade), then this notification is sent to your process. The higher level auto-renewing subscription will continue until the expiration_date - at which time the downgrade auto-renewing subscription will be put into effect. - I would think that if the user downgraded the subscription type, this event should happen. It may be a bug report to be investigated by the iTunes Store server team.
rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI