How to test Billing Grace Period and Billing Retry for a Subscription
A step by step guide on testing a billing grace period and billing retry for an Auto-Renewable Subscription in XCode.
The guide was made using our Free iOS StoreKit 2 Open Source project which is recommended for developers or business folk wishing to learn about how In-App Purchases or Subscriptions work and the code behind them.
The following walkthrough assumes that you have already setup StoreKit with an offering, have developed a UI that allows an app to display and buy products.
Please consult the guides below to learn how to setup StoreKit, create a StoreKit offering, design a UI that considers all StoreKit scenarios or make StoreKit product purchases.
Step One: Enable Billing Grace Period
In XCode, enable billing grace period.
Step Two: Enable Billing Retry
In XCode, enable billing retry.
Step Three: Change the Subscription Renewal Rate
In XCode, change the simulated Subscription renewal rate.
Step Four: Run the app
Run the app.
You might need to clean the build folder by pressing command + shift + k to register the changes.
Step Five: Buy an Auto-Renewable Subscription
In order for the simulated conditions to apply, you must make a new purchase.
Step Six: Verify
Verify that the app enters the billing grace period and billing retry using the StoreKit Transaction Manager.
The transaction should transform from purchased to billing grace period to billing retry, and finally to expired.
To test resolved payments, click the card icon to resolve issues in the StoreKit Transaction Manager.
Looking to learn more about developing apps with StoreKit 2?
Read our comprehensive development guide linked below to learn about all the secrets behind developing In-App Purchases and Subscriptions with StoreKit 2.