12 Replies
      Latest reply on Oct 18, 2019 6:07 PM by KMT
      naoto komatsu Level 1 Level 1 (0 points)

        I want to set a grace period for an iOS app subscription

         

         

        ### What you want to do

        I want to set a grace period for an iOS app subscription.

        Can I set a grace period as a billing product for iOS apps?

         

         

        ### Detailed explanation of what you want to achieve

        1) Charge subscription (automatic renewal) with iOS app.

        2) The credit card settlement is set as the settlement method, and the credit card expires.

        3) The automatic renewal date of the subscription is reached, and automatic renewal is not possible due to invalidity of Kureka

         

         

        → In 3), I want to set a grace period and maintain my subscription status.

        • Re: I want to set a grace period for an iOS app subscription
          PBK Level 7 Level 7 (3,365 points)

          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.

          • Re: I want to set a grace period for an iOS app subscription
            KMT Level 9 Level 9 (15,225 points)

            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 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 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 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.

              • Re: I want to set a grace period for an iOS app subscription
                siburb2 Level 1 Level 1 (0 points)

                So this is possible (without rolling your own solution) from today, but there's very little information on how to implement and test it apart from "tick the box":
                https://help.apple.com/app-store-connect/#/dev58bda3212

                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 to tell us that the user is in the official grace period?

                We can of course check for a billing error by looking at the `expiration_intent` value. We can check whether the user `is_in_billing_retry_period` - a period that I believe is 60 days, and is therefore unrelated to the "grace period" of 16 days for a yearly subscription.

                The only way that I can think of that would allow the implementation of the new Grace Period to be as minimal as it appears is if the `expires_date` of the subscription is changed to include the grace period (either from the beginning, or when it kicks in), but in that case, we'd not be able to use the `expires_date` as an indicator that the user is in the grace period. Likewise, we'd not be able to use the `is_in_billing_retry_period` because that period is much longer than the grace period.

                All of this leads me to believe that there must be some new property in the receipt and/or server to server notifications that tells us what's going on.


                  • Re: I want to set a grace period for an iOS app subscription
                    PBK Level 7 Level 7 (3,365 points)

                    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. 

                    • Re: I want to set a grace period for an iOS app subscription
                      KMT Level 9 Level 9 (15,225 points)

                           >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 - rkubota@apple.com

                       

                      *See the 'Forums Personnel' disclaimer here: https://developer.apple.com/support/forums/

                    • Re: I want to set a grace period for an iOS app subscription
                      funkenstrahlen Level 1 Level 1 (0 points)

                      Unfortunately expiration_intent and is_in_billing_retry_period keys are not available in the receipt on device as you can see in this documentation: https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html

                       

                      Therefore expiration_date is the only key that can be used to determine the subscription status when using on device receipt validation.

                       

                      How does the new grace period setting affect the expiration_date value in the local receipt?

                        • Re: I want to set a grace period for an iOS app subscription
                          KMT Level 9 Level 9 (15,225 points)

                          Working with the local receipt isn't recommended in this example, I believe.

                          • Re: I want to set a grace period for an iOS app subscription
                            PBK Level 7 Level 7 (3,365 points)

                            I would expect it to be unaffected.  The app would be responsible for either terminating subscription rights or allowing them to continue for a grace period after expiration. In exchange for allowing them to continue, any future renewal extends from that expiration date rather than its payment date. ........It might be useful to have some sort of externally available flag to indicate to the app that grace period is on or off. I don’t think the system provides that for on-device verification.  But the device can always send the receipt to the Apple servers.

                              • Re: I want to set a grace period for an iOS app subscription
                                PBK Level 7 Level 7 (3,365 points)

                                Let me respond to each of your questions specifically:

                                 

                                > expiration_intent and is_in_billing_retry_period keys are not available in the receipt on device

                                 

                                You can send the receipt to the Apple servers and get back these fields.  Note that this is not secure - it is subject to a man-in-the-middle attack.  But so what - it's only a question of whether or not you will grant the user a grace period.

                                 

                                Or..... just grant the grace period for a set time after expires_date.  What exactly are you afraid of losing by doing that?

                                 

                                 

                                > How does the new grace period setting affect the expiration_date value in the local receipt?

                                 

                                I assume you mean "expires_date" not "expiration_date".  I would assume it has no effect - the subscription has expired.  The grace period is something granted after expiration in exchange for not granting a full subscription period should the user choose to continue the subscription after expiration.

                          • Re: I want to set a grace period for an iOS app subscription
                            rich Apple Staff Apple Staff (265 points)

                            I'm looking into this.

                             

                            rich kubota - rkubota@apple.com

                            developer technical support CoreOS/Hardware/MFI