How to test In-App purchases in Development
Table of Contents
We need a special test account if we want to test an in-app purchase during the development.
If you try using the real Apple ID, you might encounter this error.
You are not authorized to make purchases of this InApp in Sandbox at this time.
This Apple ID does not have permission to make In-App Purchases. You can change account permission in App Store Connect. [Environment: Sandbox]
How to create a test user
To create a test user, you need to go to https://appstoreconnect.apple.com/
- Select "User and Access" menu.
- Select the "Sandbox Testers" tab.
- Create a new tester by clicking on the Plus button, then fill in all the information.
Now, you got a Sandbox tester account. The next step is to use this account for purchasing Sandbox mode.
You can easily support sarunw.com by checking out this sponsor.
Translate your app In 1 click: Simplifies app localization and helps you reach more users.
How to use a test user in the Sandbox environment
To purchase with a test account, you must sign in with that account.
Apple has a separate Sandbox sign-in process for a test account.
To sign in to a Sandbox Account:
- Go to "Settings".
- Select "App Store".
- Scroll down until you see the "Sandbox Account" section.
- Sign in using your Sandbox user.
That's all you need to do, try making a purchase again, and the problem should be gone.
You can easily support sarunw.com by checking out this sponsor.
Translate your app In 1 click: Simplifies app localization and helps you reach more users.
Caveat
The test account needs to be created under the same team as the one that generated the Ad-hoc provisioning profile.
Read more article about Debugging, In-App Purchase, or see all available topic
Enjoy the read?
If you enjoy this article, you can subscribe to the weekly newsletter.
Every Friday, you'll get a quick recap of all articles and tips posted on this site. No strings attached. Unsubscribe anytime.
Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.
If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.
Become a patron Buy me a coffee Tweet ShareLittle big improvements in Xcode 15
Small improvements that make a big difference in day-to-day coding.
Apply Small Caps for unsupported language in SwiftUI
You might want to use small caps to make your UI more interesting, but not all languages and typography support small caps. Let's learn how to solve this in iOS 17.