Offering in-app purchases is one of the main ways through which apps can make money in the App Store. Since the introduction of in-app purchases, they’ve been handled through the StoreKit framework.
This article will help you learn how you can easily implement in-app purchases and subscriptions, and discover APIs for retrieving product information, handling transactions, determining product entitlements and customer status, as well as comprehensive testing support in Xcode.
In-app purchases don’t come in one unique form. With this in mind, to get the most out of them, you need to create your custom in-app purchase strategy. You can create up to 10,000 in-app purchase products per app. There are four in-app purchase types:
You can sync and restore non-consumables and auto-renewable subscriptions across devices using StoreKit. When a user purchases an auto-renewable or non-renewing subscription, your app is responsible for making it available across all the user’s devices, and for enabling users to restore past purchases.
StoreKit has been with us since iPhone OS 3.0 launched in 2009. At WWDC 2021, we saw the introduction of the new StoreKit 2 — a new Swift-only framework with modern async APIs.
Using StoreKit 2 is not possible with Objective-C or if you need to support versions before iOS 15.0. So, migrating to StoreKit 2 might not be as straightforward for all apps with existing StoreKit 1 implementations.
StoreKit 2 does not provide a replacement for every single API that StoreKit 1 has. It’s clear that Apple’s focus is now on StoreKit 2 moving forward: iOS 16 only brought improvements to StoreKit 2.