In-App Purchase Testing with StoreKit Testing Framework

This year’s WWDC introduce the StoreKit Testing Framework, which will immediately save your IAP development time for 3 reasons:

  1. Testing IAP was only possible via Sandbox testing
  2. Sandbox testing requires modification to iTunes connect and physical devices
  3. Support unit tests

With StoreKit Testing Framework, you will be able to setup a fully functional local environment for IAP testing. As expected, it works for simulator as well!

Setting up StoreKit Testing Framework for your iOS project is easy:

Add Configuration.storekit file to your project

Setup the Product ID and use it in your StoreKit code.

Set Build Options “StoreKit Configuration”

Then it is all set.

Simply test your IAP purchase flow, then you will be able to make sandbox testing locally.

If you are interested to learn more, checkout this WWDC20 video: Introducing StoreKit Testing in Xcode.

Posted 2020-06-24

More writing at jakehao.com