At WWDC this year, Apple announced a variety of new ways for developers to test StoreKit functionality in Xcode and iOS 14. In a new post on the Apple Developer website, Apple informs developers that the enhancements to sandbox testing are widely available.
Apple explains that developers can test in-app purchases on devices using product details set up in App Store Connect. For instance, this includes things like upgrades, downgrades, and cancellations for subscriptions. There is also now support for testing an app’s response to an interrupted purchase on iOS 14:
The Apple sandbox environment lets you test in-app purchases on devices using product information set up in App Store Connect. You can now test upgrades, downgrades, and cancellations for subscriptions, as well as reset the introductory offer eligibility for a test account from Settings on devices running iOS 14 or later. You can also test your app’s response to interrupted purchases on devices running iOS 14 or later. And App Store Connect users with the Developer role can now create and manage sandbox tester accounts.
Here are some additional details that Apple shared at WWDC 2020:
Use the Apple sandbox environment to test your implementation of in-app purchases using the StoreKit framework on devices using real product information from App Store Connect. Your development-signed apps uses the sandbox environment when you sign in to App Store using a Sandbox Apple ID.
Apple says you can learn more about these new features at the links below: