0
votes

In our iOS app, in-app purchase of an auto-renewable subscription provides access to certain additional features. Our server would like to check the in-app purchase receipt of each account to see if it expired or got renewed successfully. This is in order to decide to continue allowing access to those additional features (to that account user).

On the server, how do we calculate the duration between renewals? Each month may have 28, 29, 30 or 31 days. So if somebody subscribes on Jan 29, does the app store make it up for renewal on Feb 29, or use some other algorithm, e.g., days from end of month (if in "second half"), so it might be Feb 26 or 27 (depending on whether Feb has 28 or 29 days this year)? We couldn't find the information about what algorithm Apple uses to calculate these durations. If somebody knows, or knows where to find it, could you let us know? Thanks!

1

1 Answers

1
votes

A monthly subscription is based on the calendar month and will renew on the monthly anniversary of the initial subscription. This means that sometimes the user gets 31 days and sometimes 28 days for the same price.

Where the month has fewer days than the anniversary date it will renew on the last day of the month; If the initial subscription took place on January 29, the renewal will take place on Feb 28th (or the 29th if it is a leap year).

The receipt contains the expiration date of the current subscription period. Assuming it isn't a leap year, a subscription started on January 29th will have February 28th as the expiration date. You can use this expiration date as the basis for getting your server to check for a renewal; you can start checking for a renewal about 24 hours before the expiration date.

From the In App Purchase Programming Guide

The subscription renewal process begins in the ten days before the expiration date. During those ten days, the App Store checks for any billing issues that might delay or prevent the subscription from being automatically renewed, for example:

  • the customer’s payment method is no longer active,
  • the product increased in price since the user bought the subscription,
  • the product is no longer available.

The App Store may notify users of any issue so that they can resolve it before the subscription expires and avoid an interruption in their subscription service.

During the 24-hour period before the subscription expires, the App Store starts trying to automatically renew it. The App Store makes several attempts to automatically renew the subscription over a period of time but eventually stops if there are too many failed attempts.