How to test In-App purchases in Development

⋅ 1 min read ⋅ Debugging In-App Purchase

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]

You are not authorized to make purchases of this InApp in Sandbox at this time.
You are not authorized to make purchases of this InApp in Sandbox at this time.

How to create a test user

To create a test user, you need to go to https://appstoreconnect.apple.com/

  1. Select "User and Access" menu.
User and Access.
User and Access.
  1. Select the "Sandbox Testers" tab.
Sandbox Testers.
Sandbox Testers.
  1. Create a new tester by clicking on the Plus button, then fill in all the information.
New Tester.
New Tester.

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.

Sponsor sarunw.com and reach thousands of iOS developers.

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:

  1. Go to "Settings".
  2. Select "App Store".
  3. Scroll down until you see the "Sandbox Account" section.
  4. Sign in using your Sandbox user.
Sandbox Account.
Sandbox Account.

That's all you need to do, try making a purchase again, and the problem should be gone.

Test in-app purchase in development.
Test in-app purchase in development.

You can easily support sarunw.com by checking out this sponsor.

Sponsor sarunw.com and reach thousands of iOS developers.

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 Share
Previous
Little big improvements in Xcode 15

Small improvements that make a big difference in day-to-day coding.

Next
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.

← Home