I am implementing an auto-renewable subscription in my app.
Currently, to check if the user have an active subscription, I examine all the records in `latest_receipt_info` array from the response JSON returned from the Apple's `/verifyReceipt` service, find the one with the max `expires_date_ms` and check if this date is in the future. Before checking the dates I also check if the `status` field is 0 (receipt is valid).
I was thinking that it is enough, but I recently found out that there is another field - `cancellation_date_ms`. As I understand from the docs, this filed is present if user has canceled his subscription through the Apple support.
From ([Apple docs][https://developer.apple.com/documentation/appstorereceipts/cancellation_date_ms])
> You can use this value to:
> Determine whether to stop providing the content associated with the
> Check for any latest renewal transactions, which may indicate the user
> re-started or upgraded their subscription, for an auto-renewable
> subscription purchase.
So I am wondering, if a user cancels his subscription through the Apple support, will this affect the `expires_date_ms` for the current subscription period? So the next time I check `expires_date_ms`, I know the subscription is not active.
Or does `expires_date_ms` stays the same as it was before the user canceled the subscription, and so I need to check the `cancellation_date_ms` as well?
You need to check 'cancellation_date'. 'expires_date_ms' does not change.
(But a cancellation is rare.)