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.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 03/27/2023 at 10:11
Last Updated on 03/27/2023 at 15:45
Three flowers that represent StoreKit, Swift and XCode side by side. Beneath them sits the text “Billing Grace Period and Grace Period.”

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.

SubscribeFree Open-Source Apple StoreKit 2 Swift ProjectHow to setup a subscription grace period in App Store ConnectHow does Billing Retry and a Grace Period work in the Apple App Store?

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.

How to setup StoreKit in XcodeHow to create a StoreKit offering in XCode or App Store ConnectFree iOS e-commerce Figma design fileHow to code and test StoreKit purchases in Swift and XCode

Step One: Enable Billing Grace Period

A screenshot of Xcode highlighting the location of the Editor tab in the Xcode menu and Enable Billing Grace Period. If Billing Grace Period is already enabled, this will say Disable Billing Grace Period.

In XCode, enable billing grace period.

How to enable or disable StoreKit Billing Retry in Xcode

Step Two: Enable Billing Retry

A screenshot of Xcode highlighting the location of the Editor tab in the Xcode menu and Enable Billing Retry on Renewal. If Billing Retry on Renewal is already enabled, this will say Disable Billing Retry on Renewal.

In XCode, enable billing retry.

How to enable or disable StoreKit Billing Retry in XCode

Step Three: Change the Subscription Renewal Rate

A screenshot of Xcode highlighting the location of the Editor tab in the Xcode menu, the Subscription Renewal Rate menu option and the menu that appears where you can select a Subscription Renewal Rate.

In XCode, change the simulated Subscription renewal rate.

Step Four: Run the app

A screenshot of Xcode with a highlight on the play button on the top left. Press this button to 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

A screenshot of an iOS app showing a completed purchase.

In order for the simulated conditions to apply, you must make a new purchase.

Step Six: Verify

A screenshot of the StoreKit Transaction Manager showing a transaction in a billing grace period.

Verify that the app enters the billing grace period and billing retry using the StoreKit Transaction Manager.

How to open the StoreKit Transaction Manager in XCode

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.

A screenshot of the StoreKit Transaction Manager showing a transaction in billing retry.

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.

Read Apple StoreKit 2 Development Guide

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe