Mobile in-app subscriptions are the most popular monetization method for most non-gaming apps these days. Yet implementing and testing in-app subscriptions in iOS is a complicated task.
Luckily Apple has presented a set of new convenient features for StoreKit testing during WWDC 2020 in session Introducing StoreKit Testing in Xcode. We have summarized the key changes for you.
- StoreKit Configuration File – it allows you to setup the in-app products for testing directly in Xcode. No need to create them in App Store Connect anymore.
- StoreKit Transaction Manager – transaction manager in Xcode to see all in-app purchases locally and manage their statuses;
- StoreKitTest Framework – a new framework for running tests in Xcode. It provides full control over tests in Xcode;
- Sandbox subscription management on devices.
StoreKit Configuration File
StoreKit configuration file allows to set up the local environment for in-app purchases testing without creating in-app products in App Store Connect.
You can use three product types:
- Consumable In-App Purchase
- Non-Consumable In-App Purchase
- Auto-Renewable Subscription
Now it’s possible to change the rate at which time passes for auto-renewable subscriptions in test environment using the Time Rate configuration:
StoreKit Transaction Manager
StoreKit Transaction Manager is a very useful tool for local development and in-app subscription testing.
StoreKit Transaction Manager allows to:
- cancel a subscription
- refund a subscription
- reset a subscription (as if a purchase never happened)
- set a billing retry state for a subscription
To access the StoreKit Transaction Manager you need to choose your StoreKit Configuration File and click on the icon in the debugging area.
New StoreKitTest framework works together with StoreKit Configuration File and allows creating Unit and UI tests. It allows testing automation for in-app purchases. The state is managed by SKTestSession. You can test:
- Successful purchases
- Failed purchases
- Interrupted purchases
- External transactions
- Subscription offers
Managing Sandbox subscriptions
Sandbox subscription can be canceled or changed to another subscription within the same subscription group on device.
There is also a new Reset Eligibility setting that resets the introductory offer. You do not need to create a new sandbox account for testing anymore.
New features provide developers with a flexible environment and in-app transaction management tools. New capabilities of in-app test automation will help with faster shipping to the App Store and more reliable in-app subscription implementation.
To the best of my knowledge, it is the most significant update of testing capabilities for in-app purchases in iOS. I am sure it will improve the developer experience with in-apps and reduce the problems of in-app product implementation.
Qonversion.io is the mobile subscription tool that gets the data both from SDK on the devices and through integrations with the App Stores. Qonversion handles the subscription revenue data, interprets it, and uses out-of-the-box integrations to send that information to marketing and analytical platforms like Facebook Ads, Appsflyer, or Amplitude.