iosauto-renewing

Do I need the server side to support iOS Grace Period of auto-renewable subscriptions?


Apple introduced Grace Period for subscriptions.

https://developer.apple.com/app-store-connect/whats-new/?id=billinggraceperiod

I still can't tell if I need to set up the server-side to support this feature or just checking the receipt on the server is just an recommended way and I can use Grace Period without the server-side?

For example, you can check the receipt in the device to use auto-renewable subscriptions on iOS without the server-side, but checking the receipt with the server is a recommended way to avoid scum.

The grace period descriptions say you need to check receipts and server notifications, I guess you can check receipts on the device only if you want, but not sure about server notifications part.

Any help is appreciated!


Solution

  • You can do it without server but not with offline on-device receipt validation as you need fresh receipt info from /verifyReceipt endpoint from Apple servers. That's why it's recommended to use server-to-server validation as direct network request is vulnerable to man-in-the-middle attack.

    Parsing receipt validation response you can get info whether subscription is in grace period by looking for grace_period_expires_date_ms in pending_renewal_info and also check is_in_billing_retry_period to indicate Apple is still trying to collect payment.

    Receipt response documentation: https://developer.apple.com/documentation/appstorereceipts/verifyreceipt Handling billing grace period documentation: https://developer.apple.com/documentation/storekit/in-app_purchase/reducing_involuntary_subscriber_churn