Auto-renewable subscriptions for iOS

Part 3: Testing auto-renewable subscription

Balaji Malliswamy
May 21, 2018 · 4 min read

What is Sandbox?

Sandbox is an environment to test our app and in-app purchase without creating financial transactions. A test environment that uses the infrastructure of the App Store but that doesn’t process actual payments. Instead, it returns transactions as if payments were processed successfully.

Creating Sandbox Tester using iTunes Connect

Create sandbox tester accounts in iTunes Connect, which you can use to run your app in the test environment before you make the app available to users.

  • From the iTunes dashboard, click Users and roles, then click sandbox testers.
  • Click the Add button (+) next to Testers.

For each sandbox tester, you’ll need to collect the following information:

  1. First name

Testing Subscription

Auto-renewable subscription duration times are shortened when test your app in sandbox environment. Additionally, test subscriptions only auto-renew a maximum of six times per account per 8 hour window, then the subscription will automatically expire at the end of each subscription period.

The renewal happens automatically whether the app is in active state or not, just like renewal in App Store. The only problem with this testing mechanism there’s no option to test the *Cancel Subscription*. Also there’s no way to test the subscription management while using sandbox and TestFlight environment.

Every renewal will send a transaction data to the app, the transactions depends on how many times renewal has happend. This is processed next time when the app opens for validating, these transactions trigger yet another password prompt. This multiple password prompts will come only in testing.

Testing renewals and expiration

Use Monthly subscription to test because of the time limitation

  • Subscribe to monthly subscription

repeat the step 2 to 4 for 6 times, After 35 min the app should now revert to un-subscribed state and allow the user to pay again.

Test Restore Purchase

  • Subscribe to monthly subscription

In this case, the app should find the active subscription to unlock the pro content to the user.

Test Restore Purchase across devices

  • Subscribe to monthly subscription

In this case, the app should find the active subscription to unlock the pro content.

Test Restore Purchase After Subscription Expiry

  • Subscribe to monthly subscription

In this case app should show the alert to the user, because no active subscription is found.

Check the list of items before submitting the in-app purchase to AppStore Review process. [Link]

Must included informations

  • In the subscription page we should mention the Name and price of product


We are building Vookmark — an easy video bookmarking service which allows you to bookmark videos and watch them later any time on any device. More details on the website: https://vookmark.co


Find it a good read?

Recommend this post (by clicking 👏 button) so other people can see it too…
reach me on Twitter Balaji Malliswamy

Swift India

Swift Developer Community in India 🇮🇳

Thanks to Prabha Mylvakanan

Balaji Malliswamy

Written by

 developer, Chennai & Writer at Swift India https://about.me/balajimalliswamy , https://unsplash.com/@blahji

Swift India

Swift Developer Community in India 🇮🇳

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade