What is new in StoreKit 2?
Generated on 6/27/2024
1 search

This post is brought to you by Tailscan,
the best devtool for Tailwind CSS.
StoreKit 2 introduces several new features and improvements to enhance the in-app purchase experience. Here are the key updates:
-
Swift Async/Await Pattern: StoreKit 2 leverages the Swift async/await pattern to perform tasks such as fetching product metadata, purchasing, and retrieving customer transaction history. This modern approach simplifies asynchronous code and improves readability.
-
Back Deployed Attribute: Thanks to the back deployed attribute in Swift, StoreKit 2 allows access to new App Store features even on devices with older operating systems.
-
Enhanced Transaction History: Starting in iOS 18, the transaction history APIs now include finished transactions for consumables, which were previously not accessible.
-
Deprecation of Original API: The original API for in-app purchases is deprecated starting with iOS 18. Existing apps will continue to work, but the legacy API won't receive new features or enhancements. Developers are strongly encouraged to update their apps to use StoreKit 2.
-
Cryptographic Validation: StoreKit 2 automatically performs cryptographic validation for transactions, enhancing security.
-
Testing Enhancements in Xcode: StoreKit testing in Xcode has been improved, allowing developers to test their app's privacy policy and license agreement locally, among other new testing capabilities.
For more detailed information, you can refer to the session "What’s new in StoreKit and In-App Purchase" (21:06).
Relevant Sessions

What’s new in StoreKit and In-App Purchase
Learn how to build and deliver even better purchase experiences using the App Store In-App Purchase system. We’ll demo new StoreKit views control styles and new APIs to improve your subscription customization, discuss new fields for transaction-level information, and explore new testability in Xcode. We’ll also review an important StoreKit deprecation.

Implement App Store Offers
Learn how to engage customers with App Store Offers using App Store Connect, as well as the latest StoreKit features and APIs. Discover how you can set up win-back offers (a new way to re-engage previous subscribers) and generate offer codes for Mac apps. And find out how to test offers in sandbox and Xcode to make sure they work smoothly.