What is new in StoreKit 2?

Generated on 6/27/2024

1 search

Tailscan

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:

  1. 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.

  2. 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.

  3. Enhanced Transaction History: Starting in iOS 18, the transaction history APIs now include finished transactions for consumables, which were previously not accessible.

  4. 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.

  5. Cryptographic Validation: StoreKit 2 automatically performs cryptographic validation for transactions, enhancing security.

  6. 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