Apple will inform the user that their card has expired 24 hours before renewal. Your app can check the intention-to-renew of the user before expiration. If that intention is not ‘cancel’ then it can continue the subscription after it expires for a few days.
From the docs (emphasis mine):
Handle Lapsed Subscriptions
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
is_in_billing_retry_periodvalues 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 URL
The 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_change_dateto determine the current renewal status of the subscription.
You can also check the
expiration_intentfield 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
expires_dateto 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.
So this is possible (without rolling your own solution) from today, but there's very little information on how to implement and test it.
Can anybody from the App Store team let us know if there's a flag that we can set in order to test the grace period? Also, what do we receive in the transaction queue, and what do we receive in the server to server notification?
1) rarely, if ever, will you get a response on this forum "from the App Store team".
2) I surmise (I have not experimented with it so this is "IMHGuess") that the only difference between Grace Period on and off is the information that Apple will place in the receipt. With Grace Period on the new expires_date will extend from the previous expiration date. With Grace Period off the new expires_date will extend from the date the subscription was actually renewed if it lapsed for more than a short time. Unclear to me what "a short time" would be. I don't think there will be a new original_transaction_identifier but the community would benefit from any observations of what fields get reset with Grace Period on or off.
>Can anybody from the App Store team let us know if...
Our resident IAP (and other topics) engr./SME seems to be Rich. I'd perhaps ping him with those specific questions...he seems to thankfully participate here* routinely enough/when he has time - good luck.
rich kubota - firstname.lastname@example.org
*See the 'Forums Personnel' disclaimer here: https://developer.apple.com/support/forums/