Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (2024)

📘

This section assumes you've followed our Quickstart section of our Getting Started guide to install and configure our SDK.

Sandbox Considerations

Products, prices, and metadata

In sandbox, StoreKit Test, and TestFlight environments, prices will often not reflect the actual prices set in App Store Connect. This is due to these environments being relatively unstable, does not necessarily indicate an issue with your implementation, and is not commonly seen in the production environment.

In these testing environments, you should ensure the purchase flow works as expected, rather than the prices and metadata being accurate. Unfortunately Apple's API can sometimes just be inaccurate, especially with different regions set for devices/accounts.

Create a Sandbox Test Account

In order to test your purchases, you'll need a sandbox test account. You can create test accounts from your App Store Connect dashboard > Users and Access > Sandbox Testers.

If you need help, you can refer to Apple's guide on creating sandbox testers here.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (1)

📘Valid email required for sandbox accounts

Keep in mind you'll need to create sandbox accounts with valid emails that you can verify you own.

Localization

To test purchases in different regions, you should set your sandbox user's App Store Country or Region property to the territory you'd like to test.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (2)

Testing on Device

This section is for testing on a physical device. If you want to test on the simulator, skip to the next section for instructions on how to get started with StoreKit testing.

Add the Sandbox Test Account to Your Device

On iOS 13 and earlier, even for sandbox purchases, you'll need to test on a real device. Starting from iOS 12, you're able to add a sandbox account to your device without having to sign out of your Apple Developer account.

On iOS 12 or greater, navigate to Settings > [Your Account] > App Store > Sandbox Account.

On iOS 13 or greater, navigate to Settings > App Store > Sandbox Account.

On macOS 11.5.2 or greater, navigate to App Store > Preferences > Sandbox Account.

Add the sandbox account credentials that you previously created. (The sandbox account credentials won't appear until you've made a purchase using a sandbox account in a development build.)

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (3)

📘

If you do not see the option to add a sandbox account under iOS settings, make a sandbox purchase in your app. Apple will show a popup to enter login details, then you will see your account in iOS settings.

iOS 14+ Only: Testing on the Simulator

Starting from iOS 14, you can test sandbox purchases in the simulator. If you're using a physical device, you can skip this section.

Testing on the simulator requires one of these SDK versions:

SDKVersion
iOS3.9.0+
Flutter2.0.0+
React Native4.0.0+
Cordova2.0.0+
Unity3.0.0+

📘StoreKit testing works on iOS 14 and later

Make sure to test on a real device if testing on iOS 13 or earlier.

📘StoreKit testing requires running app from Xcode

StoreKit testing only works if you are running your app directly through Xcode. Any command line tools that use the xcodebuild command to start running an app (like flutter run or Flutter's VSCode plugin) won't use the StoreKit Configuration File specified in your scheme. This is a known issue and we have filed a feedback to Apple.

⚠️StoreKit testing is currently incompatible with macOS

While you can upload a StoreKit configuration file with a macOS app, this setup is currently incompatible with the SDK. When making test purchases on the simulator, the transactions will appear to go through but you'll receive an error from our backend. It's recommended to test without configuration files until this is addressed.

❗️StoreKit testing won't show cancellation or refund events

While you can cancel and refund subscriptions through Xcode's Manage Transactions... window, these types of events are not stored in the receipt and will not appear on the RevenueCat dashboard.

However, the RevenueCat SDK is still able to detect there are no active subscriptions and the appropriate entitlements will be removed when the app is restarted again.

Step 1: Add a StoreKit Configuration File

Go to File > New > File... in the menu bar and select StoreKit Configuration File.

You can enable the "Sync this file with an app in App Store Connect" checkbox to have the file automatically configured with the in-app purchases or subscriptions already set up in App Store Connect.

Save the file in the top-level folder of your project and add it to your targets.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (4)

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (5)

Step 2: Create a New Scheme for StoreKit Testing

Click the scheme in the scheme menu and click Manage Schemes...

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (6)

Select your current scheme and click Duplicate.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (7)

In the scheme editor, add the StoreKit Configuration file you created in Step 1 and click Close.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (8)

Step 3: Setting up the StoreKit Configuration File

In the editor, click the "+" button at the bottom and create a new product. In this tutorial, an auto-renewable subscription will be created.

Enter a name for a new subscription group and click Done. The subscription group name should match one that is set up for your app in App Store Connect, but it's not a requirement. That means you can test your subscription groups and products in the simulator and then create the products in App Store Connect later.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (9)

📘Products in the configuration file must be set up in RevenueCat

Even though products don't have to be set up in App Store Connect, they have to be set up in RevenueCat so that RevenueCat can validate the sandbox receipt. Refer to the Configuring Products guide for more information.

Configure the subscription as needed by filling in the Reference Name, Product ID, Price, Subscription Duration, and optionally an Introductory Offer. Again, this product doesn't have to exist in App Store Connect for you to test purchasing in the simulator. Here is a sample configuration:

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (10)

Repeat this for as many products as you want.

Step 4: Uploading the Public Certificate to RevenueCat

Go to Editor > Save Public Certificate and save the public certificate to your project.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (11)

Go to your app's configuration page in your RevenueCat project settings (Project Settings > Apps > [Your App]). Expand the dropdown StoreKit testing framework and upload the certificate to your app. If successful, you should see Certificate added.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (12)

👍You did it!

You're ready to make purchases locally in the simulator!

Testing Subscription Offers on the Simulator

For sandbox and production subscription offers, they are signed using the In-App Key. However, when using a StoreKit Configuration file, the key used to sign offers must be exported from Xcode directly.

Step 1: Finding your Subscription Offers Key

Open the .storekit file where the subscriptions offers are configured, and go to Editor → Subscription Offers Key.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (13)

After selecting 'Subscription Offers Key', you will see your key ID and private key.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (14)

Note that the private key stored in the “.storekit” file is unique per file and Xcode allows you to re-generate the key for a given file. If you re-generate your key, be sure to follow these steps again to upload your new key to RevenueCat.

Step 2: Save your private key as a .p8 file

Manually save the text of the private key in a file called SubscriptionKey_XXXXXX.p8 where XXXXXX is the key ID. Following this example, the file would be named SubscriptionKey_BD3A7A04.p8.

We only accept files smaller than 512B. We recommend utilizing an editor such as Visual Studio Code when creating your .p8 file.

Step 3: Upload your file to RevenueCat

This file can now be uploaded to the RevenueCat dashboard under your iOS app settings page → Storekit Subscription Offer Key. Be sure to copy and paste over your key ID from Xcode to the Key ID box.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (15)

Don't forget to click 'Save Changes' in the upper right.

👍You did it!

You're ready to make Subscription Offer purchases locally in the simulator!

Make a Purchase

Build and run your app on your device. When you attempt to make a purchase, you may be still be prompted to sign in with the sandbox account you just created.

📘

Apple may prompt you to sign in with an Apple ID whenever you make or restore a purchase. When using the SDK, this could only happen when you call .purchase(package:) or .restorePurchases. Developers don't have control over the type of prompt that is shown (Face ID, Touch ID, password, etc.)

❗️Sandbox may be slow

Apple's App Store Sandbox is notoriously unperformant. A sandbox purchase experience may take upwards of 15s to fully complete. This is normal. In production, total purchase times are usually in the low seconds.

Verify the Transaction Appears in the Dashboard

After a purchase is successful, you should be able to view the transaction immediately in the RevenueCat dashboard. If the purchase does not appear in the dashboard, it's not being tracked by RevenueCat.

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (16)

📘Make sure Sandbox Data is enabled

Make sure the the View Sandbox Data toggle is enabled in the navigation bar.

Working with Subscriptions

In the the sandbox environment, subscription renewals happen at an accelerated rate, and auto-renewable subscriptions renew a maximum of six times per day. This enables you to test how your app handles a subscription renewal, a subscription lapse, and a subscription history that includes gaps.

Because of the accelerated expiration and renewal rates, sometimes not all renewals are reflected in the RevenueCat customer dashboard.

Production subscription periodSandbox subscription renewal
3 days2 minutes
1 week3 minutes
1 month5 minutes
2 months10 minutes
3 months15 minutes
6 months30 minutes
1 year1 hour

Deleting Test Users

When testing, it may be helpful to delete a customer and all their receipts from RevenueCat to simulate a new installation. You can delete a specific user from the customer dashboard in RevenueCat. See our docs on deleting users for more information.

❗️Maximum number of App Store subscription receipts

For performance reasons, RevenueCat limits the number of App Store subscription receipts per customer to 100. Having more than 100 subscription receipts on a single customer is not going to happen in production, but can easily happen during sandbox testing. Simply deleting the customer will solve this problem.

Deleting local data

To clean up locally cached data, you can uninstall the app and reinstall.On macOS, you need to manually delete data in UserDefaults, which can be done by going into ~/Library/Group\ Containers/, finding the app, and deleting the data.

TestFlight

TestFlight is a hybrid environment that uses production Apple IDs but purchases occur in sandbox, which can cause unexpected issues that are very likely undocumented by Apple.

Common Errors

If you're getting the error "Account Not In This Store" when attempting to make a purchase on macOS, try to:

  • Switch your region to the recommended region
  • Sign out of the App Store
  • Relaunch the TestFlight app
  • Attempt to make the purchase again, and sign in when prompted

📘Make sure to log out of the sandbox user on your testing device

Deleting the user from RevenueCat doesn't delete the user's purchase history with Apple. It only deletes the user's receipt and metadata from our servers. That means making or restoring purchases will restore those purchases with RevenueCat. To simulate purchasing as a completely new user, make sure to log out of the sandbox account on your device and create a new one.

Next Steps

For more information, take a look at the official Apple documentation:
Apple App Store: Testing in-app purchases

Apple App Store & TestFlight | In-App Subscriptions Made Easy – RevenueCat (2024)

FAQs

How much revenue does Apple make from the App Store? ›

publishers: revenues. In 2021, the Apple App Store reportedly reached around 85 billion U.S. dollars in revenues from global consumers worldwide, while the Google Play Store saw 47 billion U.S. dollars in revenues from subscriptions and other in-app purchases.

What is the revenue share of the App Store subscription? ›

For paid subscriptions that have been active for less than one year, you receive 70% of the subscription price, minus applicable taxes, or the Rate Before One Year. After a subscriber accumulates one year of paid service, you receive 85% of the subscription price, minus applicable taxes, or the Rate After One Year.

How much does Apple take from app Subscriptions? ›

Apple takes 30% of all transactions for In-App Purchases; 15% or 30% for Subscriptions; but take no fees for physical items or services.

How do I connect App Store API to RevenueCat? ›

Upload the App Store Connect API key to RevenueCat​

In the RevenueCat dashboard, select your iOS app from the Apps tab in your project settings. Within your app settings, under the tab App Store Connect API, you'll see an area to upload your App Store Connect . p8 file that you downloaded from App Store Connect.

What generates the most revenue for Apple? ›

As Apple's most popular and valuable product, the iPhone has been the company's main source of revenue since 2008, a year after its launch.

How much money does the average app make on the App Store? ›

It is difficult to put a single figure on how much revenue an app can generate because of the wide range of apps and the disparity of money they earn. For example, the top 200 apps generate on average $82,500 daily, while the top 800 apps generate around $3,500.

How much do apps make from subscriptions? ›

According to a new analysis of the subscription app economy from mobile subscription toolkit provider RevenueCat, the top 5% of apps generate 200 times the revenue of the bottom quartile after their first year, while the median monthly revenue an app generates after 12 months is less than $50 USD.

How much does it cost to put an app on the App Store? ›

How much does it cost to register an app on the App Store? In order to publish an iOS application on the Apple App Store, you have to register as a developer. The annual fee for the Apple Developer Program is $99 and the annual fee for the Apple Developer Enterprise Program is $299.

How do I check my App Store revenue? ›

View Financial Reports

Go to https://appstoreconnect.apple.com, and sign in with the Apple Account you use for App Store Connect. From the homepage, click Payments and Financial Reports. In the top-right corner, click Create Reports. Select the fiscal month for the report you'd like to download.

How are Apple subscriptions paid? ›

Just set up a payment method — Apple Pay, Apple Gift Card, mobile phone billing, or a credit or debit card — and you're good to go. You can also manage multiple subscriptions and purchases for your family, across all your Apple devices.

Does Apple cash pay for subscriptions? ›

You can use your Apple Account balance to buy apps, pay for subscriptions, and more. But for some purchases, Apple Account balance can't be used. Learn what you can buy with your Apple Account balance. Apple Account balance isn't available in all countries or regions.

What percentage of a sale does the App Store retain? ›

“On the iOS, iPadOS, watchOS, and macOS App Store, Apple charges a 30% fee for apps and in-app purchases.

What is the rate limit for RevenueCat? ›

The rate limit is variable based on load, but is usually ~60 requests per minute; these headers will let you know if this has changed for higher load times.

What is API RevenueCat? ›

RevenueCat provides a REST API for developers to perform customer and transaction related actions from their own server.

How do I add users to RevenueCat? ›

To invite a collaborator, send them an invite from the Project Settings > Collaborators. Add the collaborator's email, select their permission level, and send the invite. Invited collaborators will receive an email where they can accept your invitation.

What percentage does Apple take on the App Store? ›

On the iOS, iPadOS, watchOS, and macOS App Store, Apple charges a 30% fee for apps and in-app purchases. However, the fee doesn't apply to free apps.

How much does Apple get from app? ›

Note that Apple does take a percentage of revenue when users transact a paid app and/or an In App Purchase. Apple does not change anything for a free app. If a transaction unlocks any code or functionality in the app then it must be done through Apples In App Purchase system and Apple will take 30%.

How much profit does Apple make on their products? ›

Apple reported net income of 96.99 billion U.S. dollars in its 2023 fiscal year, down from the highest net income to date in 2022. Apple's global revenue amounted to 383.29 billion U.S. dollars in that same year.

What is the revenue of Google App Store? ›

Though both the Apple App Store and Google Play Store offer the same revenue split, 70% to the developer and 30% to the store, the Apple App Store led with an estimated revenue of $85.1 billion in 2021 with 63% of the total app revenue, whereas Google Play Store generated nearly $47.9 billion and roughly 37% of the ...

Top Articles
Trackinsight
Tipping in Sweden
11 beste sites voor Word-labelsjablonen (2024) [GRATIS]
Friskies Tender And Crunchy Recall
Fort Morgan Hometown Takeover Map
Umbc Baseball Camp
Swimgs Yuzzle Wuzzle Yups Wits Sadie Plant Tune 3 Tabs Winnie The Pooh Halloween Bob The Builder Christmas Autumns Cow Dog Pig Tim Cook’s Birthday Buff Work It Out Wombats Pineview Playtime Chronicles Day Of The Dead The Alpha Baa Baa Twinkle
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Craigslist Pets Longview Tx
Restored Republic January 20 2023
Missed Connections Inland Empire
Autobell Car Wash Hickory Reviews
Kent And Pelczar Obituaries
Www.paystubportal.com/7-11 Login
How To Delete Bravodate Account
Oriellys St James Mn
Valentina Gonzalez Leak
6th gen chevy camaro forumCamaro ZL1 Z28 SS LT Camaro forums, news, blog, reviews, wallpapers, pricing – Camaro5.com
Dc Gas Login
Hell's Kitchen Valley Center Photos Menu
Rachel Griffin Bikini
Conan Exiles: Nahrung und Trinken finden und herstellen
Forum Phun Extra
How To Level Up Roc Rlcraft
Gayla Glenn Harris County Texas Update
What Channel Is Court Tv On Verizon Fios
Tu Pulga Online Utah
Plaza Bonita Sycuan Bus Schedule
UMvC3 OTT: Welcome to 2013!
Craigslist Roseburg Oregon Free Stuff
T Mobile Rival Crossword Clue
Jailfunds Send Message
Vivification Harry Potter
Federal Express Drop Off Center Near Me
91 Octane Gas Prices Near Me
Bursar.okstate.edu
Mrstryst
Blackstone Launchpad Ucf
2012 Street Glide Blue Book Value
آدرس جدید بند موویز
Puffco Peak 3 Red Flashes
Bbc Gahuzamiryango Live
Kelly Ripa Necklace 2022
Albertville Memorial Funeral Home Obituaries
Is The Nun Based On a True Story?
Puretalkusa.com/Amac
Tsbarbiespanishxxl
Suffix With Pent Crossword Clue
Henry Ford’s Greatest Achievements and Inventions - World History Edu
Vindy.com Obituaries
Makes A Successful Catch Maybe Crossword Clue
Craigslist.raleigh
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 5965

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.