From the docs (emphasis mine):
The App Store renews the subscription slightly before it expires, to prevent any lapse in the subscription. However, lapses are still possible. For example, if the user’s payment information is no longer valid, the first renewal attempt fails. Billing-related issues trigger the subscription to enter a billing retry state where the App Store attempts to renew the subscription for up to 60 days. You can check the
expiration_intent
and is_in_billing_retry_period
values to monitor the retry status of the subscription. During this period, your app may optionally offer a grace period to the user and show them a message in the app to update their payment information. Additionally, your app can deep link customers to the payment details page within App Store on their device by opening this URLThe user can also cancel their subscription by disabling auto-renew and intentionally letting their subscription lapse. This action triggers the App Store to send your server a status update notification of type
DID_CHANGE_RENEWAL_STATUS
. Your server can parse the auto_renew_status
and the auto_renew_status_change_date
to determine the current renewal status of the subscription.You can also check the
expiration_intent
field in the receipt to further validate the reason for the subscription to lapse. Make sure your app's subscription logic can handle different values of expiration_intent
along with expires_date
to show the appropriate message to the user.
If you're asking how to use your own process, instead, I can imagine using a pending renew to trigger a trial period, but I can also imagine that causing issues with the overall process so I would not recommend DIY in this example.