StoreKit Test
Create and automate tests in Xcode for your app’s subscription and Apple In-App Purchase transactions, and SKAdNetwork implementations.
Overview
The StoreKitTest framework makes StoreKit testing in Xcode available for automation. Use this framework to write unit tests and continuous integration tests. Use SKTestSession and SKAdTestSession to control the test environment.
For testing Apple In-App Purchase transactions, use SKTestSession. Each instance of SKTestSession gives you access to the same settings you manually change for StoreKit testing in Xcode. Use this class to test a variety of Apple In-App Purchase scenarios, such as subscription renewals and Ask to Buy transactions, and maintain control over the transactions in the testing environment.
For testing ad impressions and postbacks, use SKAdTestSession. Each instance of SKAdTestSession holds a set of test postbacks that you create and can use in multiple unit tests. Ad networks that use SKAdNetwork APIs can use this class to validate the ad impressions that they sign, and test receiving postbacks on their server. Advertised apps can test their conversion value updates.
Testing StoreKit in iOS, watchOS, or tvOS apps requires Xcode 12 or later running on macOS 10.15 or later. Testing StoreKit in a macOS app requires Xcode 12 or later running on macOS 11 or later.
Topics
StoreKit transaction testing
StoreKit transaction testing errors
Ad impression and postback testing
Testing and validating ad impression signatures and postbacks for SKAdNetworkSKAdTestSessionSKAdTestPostbackSKAdTestPostbackResponseSKAdTestPostbackVersion
Ad impression and postback errors
Structures
StoreKitAppStoreSyncAPIStoreKitAppTransactionAPIStoreKitLoadProductsAPIStoreKitManageSubscriptionsAPIStoreKitOfferCodeRedeemAPIStoreKitPurchaseAPIStoreKitRefundRequestAPIStoreKitSubscriptionStatusAPIStoreKitVerificationAPI