Auto renewing in-app purchase in iOS

Mukesh Shakya
8 min readNov 17, 2021

--

In-app purchases are extra content or subscriptions that you buy inside an app. Not all apps offer in-app purchases. Just because an app is free to download doesn’t mean it won’t cost you and those in-app purchases can really add up. Apps in all categories on the App Store (for iPhone and iPad users) have in-app purchases, which prompt users to spend money on game add-ons, subscriptions, premium features and more. These extra supposedly optional costs can go straight on credit cards often without any alert to the card owner.

An in-app purchase is any fee (beyond the initial cost of downloading the app, if there is one) an app may ask for. Many in-app purchases are optional or give users additional features; others serve as subscriptions and require users to sign up and pay a fee to use the app, often after an initial free trial. Creating an account with the App Store or Google Play requires putting a credit or debit card on file, to cover any costs associated with downloading paid apps.

In-app Purchase Types

While Apple explains these 4 types of In-App purchases, here is a short, easy to understand the description of them:

  • Consumable

You can only use this once, and once you have to use it again, then you have to buy it again. This applies to games that use coins, gems, etc.

  • Non-Consumable

As soon as you buy a non-consumable In-App Purchase, it will stay with you forever. This usually applies to unlocking special levels in games, premium versions of apps, etc.

  • Auto-Renewable Subscriptions

These are great for apps like Spotify, etc. As soon as the subscription is bought, it will keep on renewing after the desired amount of time automatically unless the user chooses to cancel the subscription.

  • Non-Renewing Subscription

As soon as the user buys the subscription to the app, it will not automatically renew, but the user has to renew it manually.

Auto-renewable Subscriptions

Auto-renewable subscription gives app users a content or feature that a normal or a free user cannot access. The auto-renewable subscription automatically renews on its own until and unless the user cancels the auto renew function manually.

In this blog, we will be focusing on auto-renewable subscription type console setup only. I will soon be posting new blogs on code implementation of auto renewing subscriptions & auto renewing apple server notifications.

How to make a subscription?

A subscription is made by creating a subscription product in the app store connect console. Let us suppose according to our requirement of the application we need two types of subscription so we need 2 subscription products to be created from the app store connect console and also if a user can only subscribe to a single subscription at a time, we have to make a single subscription group. A subscription group is a collection of subscription products where only a single product can be purchased at a time.

Note: Before you can create your app’s In-App Purchases, you are required by Apple to fill out their Paid Applications contract.

Step 1:

Go to the My Apps section of your App Store Connect account.

Step 2:

Click on your app to step into its listing.

Step 3:

Select Manage from In-App Purchases on the left menu.

Step 4:

Click the add sign under In-App Purchases heading.

Note: You will be asked to create a subscription group if you have not previously created a subscription group for the app.

Step 5:

Select type of subscription product.

Subscription Product Type Selection Menu

Note: If you do not see the auto-renewable option, it is likely because you have not yet requested the paid apps contract under the “Agreements, Tax and Banking” section in AppStore Connect.

Step 6:

Enter reference name & product identifier. Product identifiers should always be unique and cannot be used again even if the app is deleted. Reference names are only for your reference, they do not show up to the app store or user.

Subscription product creation form

Step 7:

Select the subscription group or create a new subscription group and hit the create button.

Add to subscription Group Selection

Step 8:

Now that the subscription product is created, you can change the subscription product information. The information that is to be changed compulsorily are as follows:

  • Duration:

A subscription duration is the length of time between auto-renewals. You have to select a duration among the predefined duration available.

  • Subscription Prices:

Subscription prices are the cost for the subscription product. You can choose the currency as well as the price from a predefined price list. The price is automatically calculated for all 175 countries or regions based on the most recent foreign exchange rates. You can edit prices for individual countries or regions in the next step if you wish to change the price for a certain country.

  • Localization:

Localization is used to display the information about the subscriptions on the app store. You can add different localization for different languages so that the people from all regions can understand about the subscription product. You have to be extra careful to fill this information since it has been displayed to the user upfront.

Trial period

The trial period requirement of our application can be achieved with the use of an introductory offer provided by the apple. We can basically set up introductory offers for our app that contains auto-renewable subscriptions using the app store connect console. The introductory offers are of 3 types i.e. Pay As You Go, Pay Up Front and Free Trial. We will be using a Free Trial type of introductory offer to achieve our free trial function.

Introductory offer apple documentation

Note: New and returning customers are only eligible to use one trial period from a subscription group.

Upgrade and downgrade membership

For achieving the upgrade and downgrade of subscriptions we will have to rank our previously created subscription products assigning them a level. This ranking simply determines the most and the least premium packages. The products should be ranked in a descending order in a subscription group.

Note: The top most product in the subscription group is the most premium subscription.

Users can manage their subscriptions in their account settings on the App Store, where they see all renewal options and subscription groups, and can choose to upgrade, crossgrade, or downgrade between subscriptions as often as they like. When a user makes a change in their subscription level, the timing of the change varies depending on what has happened:

Upgrade: A user purchases a subscription that offers a higher level of service than their current subscription. They are immediately upgraded and receive a refund of the prorated amount of their original subscription. If you’d like users to immediately access more content or features, rank the subscription higher to make it an upgrade.

Downgrade: A user selects a subscription that offers a lower level of service than their current subscription. The subscription continues until the next renewal date, then is renewed at the lower level and price.

Note: Crossgrade will not be available in our app according to our requirement since there will be no subscription type of similar level.

Cancel Subscription

Users can cancel their subscription any time they want. The cancellation of subscription type in the middle of its running period will keep the subscription until the next billing date of the user. If the cancellation is in case of a trial period users may lose the access to the content immediately.

Note: If a user once signed up for a free trial subscription and does not want to renew it, the user must cancel it at least 24 hours before the trial ends.

Cancel subscription Apple documentation

Payment failed condition

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

  • The customer’s payment method is active.
  • The product increased in price since the user bought the subscription.
  • The product’s availability.

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

As per date of 2021

During the 24-hour period before the subscription expires, the App Store starts trying to renew it automatically. 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.

Apple documentation regarding billing

Grace period

The App Store renews the subscription slightly before it expires, to prevent any lapse in the subscription. However, lapses are still possible. 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. 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.

Billing Grace Period is applied at the time of a billing error when it’s enabled for subscriptions in the app, and cannot be altered once assigned to a user. Grace period durations are dependent on the subscription period length as follows:

  • 6 days for a weekly subscription
  • 16 days for monthly and longer subscriptions

If we choose to enable Billing Grace Period, we must ensure that we provide full service for the subscription throughout the grace period. If the user is recovered within this grace period, neither the subscriber’s days of paid service, nor the company revenue for auto-renewable subscriptions will be interrupted. Billing error recoveries made after the grace period expires, but within the overall billing retry period, will maintain existing behavior and renew on the recovery date, starting a new billing cycle. Payment for the provided full service during the grace period would not be collected.

Note: In a worse possible case a user can pay for the subscription and contact the apple for the refund stating mistakenly purchased where our server will be not familiar, this case needs to be handled additionally.

Apple documentation regarding grace period function

--

--