How to grow your side project app from $0 to $1K/month. Free guide ➜

How to add in-app subscriptions to an iOS app

Ben Gohlke

Updated: May 7, 2025

9 min read

Content

612ce363e6f8fb814feed86a ios tutorial 1 configuration min

Subscriptions are one of the most popular monetization strategies for today’s mobile apps. Done well, they can create a virtuous cycle of benefits for the developers making the app and for the customers using the app day-to-day. Developers are incentivized to constantly improve the user experience with recurring revenue, and users are provided with an evolving and expanding feature set over time. Apple also takes a reduced commission of 15% after the first year of a subscription from a user. This encourages developers to ensure long-term value in the apps so users will stick around.

With this article, we start our series of tutorials on integrating in-app purchases into an app. Here’s what we’ll be covering:

  1. iOS in-app purchases, part 1: App Store Connect and project configuration
  2. iOS in-app purchases, part 2: initialization and purchases processing
  3. iOS in-app purchases, part 3: testing purchases in Xcode
  4. iOS in-app purchases, part 4: server-side receipt validation
  5. iOS in-app purchases, part 5: the list of SKError codes and how to handle them

In this part we will learn how to:

  • Create purchases in App Store Connect
  • Configure subscriptions: set a duration, price, and trial periods
  • Get a list of purchases in-app

Creating iOS in-app purchases in App Store Connect

Before implementing your in-app purchases you have to:

  • Pay for the Apple Developer account as a natural person or an entity.
  • Accept all the agreements in App Store Connect. You’ll receive banner notifications inside App Store Connect whenever Apple updates them, which they usually do a couple times per year.

Let’s assume that our app will have two types of subscriptions: monthly and annual. Each of them will have a 7-day free trial.

First of all, we need to create a subscription group.

A Subscription Group is a set of subscriptions with an essential feature: the user cannot activate two subscriptions at the same time from the same group. All introductory offers, such as trial subscriptions, are applied directly to the entire group. Groups serve to separate business logic in the application.

​​On the application page in App Store Connect, open the Subscriptions tab. Here, you will be able to create a Subscription Group by clicking the plus button or by clicking Create if the list is empty.

1 1024x653 1 jpg

Let’s name the group Premium Access.

2
Creating a subscription group in App Store Connect

Once the subscription group is ready, add the subscriptions by hitting Create.

213 1024x482 1 jpg

Now, let’s fill out the details:

  • Reference Name is the title of your subscription in App Store Connect, as well as in Sales section and the reports
  • Product ID is a unique product identifier, which is used in the application code

I would recommend choosing a simple Product ID name, something that is easily recognizable in other contexts. It’s good to include subscription duration to help differentiate products when reviewing analytics later.

Screenshot 2025 05 07 at 11.04.02
It’s a good idea to specify the subscription duration in the Product ID

Add the second product just like you added the first.

In the end, the interface of the subscriptions section will look like this:

Screenshot 2025 05 07 at 11.03.00

Adding subscription configuration for the App Store

We added the subscription products, but they can’t be used yet. The status column for each should be showing an error, “Missing Metadata”. It means we still haven’t added the information about pricing and subscription duration. Let’s fix that now.

Configuring subscription duration and pricing

Click on the product to configure it. Here we need to choose a Subscription Duration. Choose 1 month or 1 year, depending on the product.

Screenshot 2025 05 07 at 11.13.12

Then go lower to the Subscription Prices menu and click Add Subscription Price.

6 1024x225 1 jpg

You can flexibly set prices depending on the country, but in this case we’ll rely on one global price, set in USD, and Apple will adjust it for the different currencies.

7 2

This adjustment process isn’t entirely transparent as to how Apple calculates the conversions. You might consider changing the price manually to account for regional expectations in your target market. When the duration and the prices are set, hit the Save button on the subscription page.

Enabling a free trial

One of the most popular ways to increase subscriptions is a free trial:

A free trial enables the user to demo the premium features of the app for free, but they are opting into signing up for the subscription automatically at the end of the trial period. To prevent being charged at the end of the trial period, the user would need to cancel the subscription in Settings before the trial period expired.

Developers love free trials because they work well. Let’s learn how to enable them.

Click (+) next to the title and choose Create Introductory Offer from the list:

8

Set the countries and regions you want it to be enabled for.

9 2

Choose the offer duration. You can set No End Date if you don’t want to limit yourself.

10

In the last step, you need to select an Offer Type.

As you can see in the next screenshot below, there are three types:

  • Pay as you go: the user pays a reduced price during the initial period and then becomes a regular subscriber with standard prices.
  • Pay up front: the user pays a fixed amount of money up front and unlocks functionality to use the app during the determined period, and then also becomes a regular subscriber.
  • Free trial: unlocks functionality in the app for the trial period at no cost, and at the end of the trial period the user automatically subscribes at the subscription price.

Let’s choose the third one and set the duration for one week.

11

Save the settings and go to the next step.

Getting the list of Products

Let’s check if the mobile app sees the purchases and then lay the groundwork for further implementation of in-app purchases.

This observable object allows us to initialize it at app startup and inject it into our environment to make it available everywhere. It’s a good practice to have a manager type to deal with StoreKit in one place.

import Foundation
import OSLog
import StoreKit

@Observable
final class IAPSubscriptionManager {
  private(set) var subscriptions: [Product] = []
  
  private let logger = Logger(subsystem: "io.adapty.MovieMania", category: "IAP Helper Service")
  private let identifiers: [String] = ["movie.mania.pro.1y", "movie.mania.pro.1m"]
  
  @MainActor
  func getProducts() async {
    
  }
}

The product identifiers are useful, but you need actual Product objects to show and process subscriptions. These objects contain the names, localized prices, durations, and other info that you’ll need to display on your paywall.

To get this information, we need to request for Product objects. Fill in the getProducts() method with the following:

@MainActor
  func getProducts() async {
    do {
      subscriptions = try await Product.products(for: identifiers)
      logger.info("Found \(subscriptions.count) products.")
    } catch {
      logger.error("Products could not be fetched: \(error.localizedDescription)")
    }
  }

If the async operation is successful, the method will return a list of Product objects. You should see the following log output:

Found 2 products.

However, if there is an error, review the log output to see what is wrong. This could mean you missed a step in the configuration of the products in App Store Connect.

Great job!

The next article will be focused on how to make in-app purchases: open/close transactions, handle errors, validate the receipt, and more.

If you liked this article, give us a ⭐ on GitHub!

Good to read:

Apple’s Fiscal Calendar ⟶

Recommended posts