React Native - Subscriptions (iOS)

iTunes Connect
in-app purchase

  1. Workflow for configuring in-app purchases
  2. In-App Purchase Programming Guide

implement subscriptions in application

  3. Adding In-App Purchase to Your Applications
  4. Validating Receipts With the App Store
  5. Receipt Fields

obtain a shared secret

My Apps<MY_APP>Features (tab)
In-App Purchases (left menu) → App-Specific Shared SecretView Master Shared Secret (link)

shared secret is used to validate receipts with iap-receipt-validator npm package.

add subscription in IC

create IAP

My Apps<MY_APP>Features (tab)
In-App Purchases (left menu) → In-App Purchases (section) → (link)

Select the in-app purchase you want to create.

Create Auto-Renewable Subscription

Create Subscription Group

configure IAP

My Apps<MY_APP>Features (tab)
In-App Purchases (left menu) → <subscription> (link)

Leave the state of your product as Missing Metadata.

Upload a a screenshot of your in-app purchase product once you are done testing it and ready to upload it for review.

configure subscription group

My Apps<MY_APP>Features (tab)
<subscription_group> (link)

it’s required to add localization for subscription group as well:

Before you can submit your in-app purchase for review, you must add at least one localization to your subscription group.

test subscription on real device

  1. React Native - Running on Real Device

it’s required to run application on real device to make purchases: the only action allowed from inside emulator is loading products.

test subscriptions:

test subscriptions are not created separately - they are real subscriptions but with special characteristics and behaviour for sandbox testers.

the sandbox environment handles auto-renewing subscriptions in an automated fashion - that is subscription periods are shortened and renew only 5 times and not controlled through the subscription management screen.

sandbox testing

add sandbox testers (sandbox tester accounts)


NOTE: it’s not required to use sandbox testers to check subscription status (skip this section if all you want is to check subscription status).

Users and AccessSandboxTesters (left menu) → (link)

tips and notes regarding sandbox tester:

about verification of sandbox tester email

generally speaking it’s necessary to verify new sandbox tester account by following the link sent to specified email:

You must validate your e-mail, or any purchases you make will silently fail.

but I couldn’t verify account of a new sandbox tester - after clicking the link email verification page kept on loading forever with an activity indicator in the middle of the screen and JS errors in Chrome Console:

bundle.js:46270 Refused to create a worker from 'blob:'
because it violates the following Content Security Policy directive...

IDK if it matters or not but I signed in to iCloud with this account (in browser) and completed registration by adding 3 secret questions.

in the end I could make a purchase using not verified sandbox tester account.

UPDATE (2018-03-19)

I have successfully verified email of another sandbox tester - most likely it was temporary technical problem on Apple side.

set environment in application

sandbox tester can purchase a test subscription in production environment but subscription status cannot be checked since sandbox receipt cannot be validated in production environment (see troubleshooting section for details):

NOTE: there were lots of Network request failed errors when purchasing a test subscription => keep on trying.

run application on real device

  1. React Native - Running on Real Device

run application in Xcode (in debug or release mode):

(toolbar button)


beta testing

My Apps<MY_APP>TestFlight (tab)
All Testers (left menu)

beta testers (or just testers) are IC users who are invited to test TestFlight builds - that is they must have been already added before. just like sandbox testers they:

NOTE: beta testers can’t buy subscription even if it’s approved in IC.

install application from TestFlight

when beta tester is making a purchase, all Apple dialogs no longer have the line [Environment: Sandbox] (like for sandbox testers).

publish release with subscription

fill review information

My Apps<MY_APP>Features (tab)
In-App Purchases (left menu) → <subscription> (link) → Review Information (section)

after you fill review information, subscription status is automatically changed from Missing Metadata to Ready to Submit.

create new app version

My Apps<MY_APP>App Store (tab)
⨁ VERSION OR PLATFORM (link in left menu) → iOS (popup menu)

new app version has Prepare for Submission status now.

add IAP to new app version

In-App Purchases page:

Your first in-app purchase must be submitted with a new app version. Select it from the app’s In-App Purchases section and click Submit.

Once your binary has been uploaded and your first in-app purchase has been submitted for review, additional in-app purchases can be submitted using the table below.

My Apps<MY_APP>App Store (tab)
3.14 Prepare for Submission (left menu) → In-App Purchases (section) → (link)

NOTE: In-App Purchases section is available only if you’ve created IAP before.

release new app version

according to iTunes Store email received after releasing new app version:

It can take up to 24 hours before your app is available on the App Store.
This delay is dependent on any app availability issues

in fact it took about 30 minutes for new app version to appear in the App Store.


view financial reports

App AnalyticsOverview (tab)
In-App Purchases (widget) or Sales (widget)
App AnalyticsMetrics (tab)
In-App Purchases (left menu) or Sales (left menu)