49

I'm trying to make in-app (non-consumable) in my app.

I'm trying to buy the package but I can't...

Of course, I've looked here for answer, but I have one actual account everywhere - at developer.apple.com - also I've created provisioning profiles, at itunesconnect.apple.com and in Xcode as well...

My bundle identifier is the same across the all websites and application.

The Application finds my package and show me the price of it. When I click on BUY the alert view show the text:

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

[Environment: Sandbox]

Any ideas please?

luke77
  • 2,255
  • 2
  • 18
  • 30
DiDinko
  • 523
  • 1
  • 4
  • 11

8 Answers8

37

You can use In-App purchase test users, to test In-App purchase in sandbox mode.

Create test users in the "Users and Access" section of appstoreconnect.apple.com

Before testing In-App purchase, Using the Settings app, logout your actual Apple ID and login the test user account directly via your app. (DON'T login the test user via Settings app or AppStore.)

andrewbuilder
  • 3,629
  • 2
  • 24
  • 46
  • ok, I will try, but how can I test my in-app for all my internal testers ? Do I have create just new sandbox testers ? – DiDinko Aug 21 '15 at 06:15
  • Its better create new test user for each tester, though you can share few test account with them. – Tuğrul Özdemir Aug 21 '15 at 06:21
  • but why in other apps in store it works without any problem but with my new app are this problems ? – DiDinko Aug 21 '15 at 06:23
  • 1
    Dont try to login real appstore with these accounts, you should use these accounts when testing inapp purchase and login alert prompted – Tuğrul Özdemir Aug 21 '15 at 06:25
  • i think you are just testing your app, it is not published to the Appstore yet. – Tuğrul Özdemir Aug 21 '15 at 06:27
  • so when the app will be on the appstore it will be like normal testing in-app like on my other apps ? without any sandbox testers ? – DiDinko Aug 21 '15 at 06:35
  • yes, but at that time it won't be testing, it will be real transaction – Tuğrul Özdemir Aug 21 '15 at 06:49
  • I had to create a sandbox user on the **same** account as the app; but also had to **confirm** the sandbox user's email otherwise I got the "You are not authorized to make purchases of this InApp in Sandbox at this time" error. – lipka Oct 08 '19 at 17:20
  • 2022 and this is still a problem. The error message does not help at all. I have tried several solutions and they didn't work. Guess I will have to read a tutorial series to fix this because I only wanted to test IAP on my second device. – Darkwonder Jul 25 '22 at 07:23
  • This is slightly wrong. There is a sandbox login at the bottom of the User screen in Settings. Make sure you're logged out of apple and use the sandbox sign in. @Darkwonder – Nick Turner Aug 05 '22 at 19:15
  • Don't get it `logout your actual Apple ID and login the test user account directly via your app`. Do I have to log out existing sandbox user and log in to the testing one? I already did that and received this error. – Zeeshan Ahmad Khalil Feb 23 '23 at 13:45
20

They used to have the real iTunes login and the Sandbox iTunes login grouped back in 2017. So you would sign in to your Sandbox account while testing purchases in the app, and then it would change your iTunes login as well. Then you'd have to sign out of your iTunes through settings. Now they have a separate field on the bottom of the Settings --> Itunes & App Stores screen (called "Sandbox Account"). You have to sign in there with a provisioned Sandbox account which is added in "Users & Access" in App Store Connect. (You have to also verify that email address, and it can not use a +postfix on the email address, IF that email is used as one of your non-sandbox main accounts... Sigh...) So you have to actually create new unique emails now that are not used as part of your main accounts. (From my understanding you can still use +postfixes on your emails which are only used for sandbox accounts though :)

Now, there's still a bug with purchases where If you are not signed in with your main Itunes account, OR your sandbox account, and you try to test purchases by typing in a sandbox account (in the app), it will keep asking you for your Sandbox Email / Password over and over again, Until you type in your REAL iTunes account as well (????). That works (typing in both the sandbox account and the real itunes account). Then the sandbox purchase goes through. I'm as surprised as you are...

FranticRock
  • 3,233
  • 1
  • 31
  • 56
16

If your apple account has a sandbox account user, after logging in with your account, follow these steps

Step 1 : Go to settings.

Step 2 : Select iTunes & Settings

Step 3 : Scroll to the bottom. There is a section for SANDBOX ACCOUNT

Step 4 : Sign in there using your Sandbox account

Now test your app & it will work fine.

enter image description here

Amal T S
  • 3,327
  • 2
  • 24
  • 57
8

First create a new account on sandbox which is on iTunes -> Users and access -> on left hand side click on sandbox and add account on it. enter image description here

And then go to your testing device enter image description here

Sign out previous id from Sandbox Account and click to add a new sandbox id which have added on Sandbox tester. Thank you!

Sukh
  • 1,278
  • 11
  • 19
5

I have multiple Apple development organizations associated to my account on App Store Connect. The reason I was getting this error was because my Sandbox Tester was created in an organization that wasn't associated with the app I was testing.

I swear the organization was right when I was adding the Sandbox user, but I can't be sure. It never hurts to refresh App Store Connect an extra time and double check the Sandbox Tester is in the correct organization.

Andy Novak
  • 378
  • 5
  • 11
0

I had this issue as well when I accidentally tried to make an in app purchase on our TestFlight app using sandbox account credentials created in the App Store connect Sandbox Testers section. So if you are experiencing this issue just make sure you are using sandbox account credentials for your dev or staging apps. With the TestFlight app version you should use your real Apple ID credentials (you won't be charged of course as TestFlight still uses the Sandbox environment for in-app purchases).

For more information checkout https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_at_all_stages_of_development_with_xcode_and_sandbox

https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox

Leonel-QA
  • 1
  • 1
0

Try this check-list

  • Create test user @App Store Connect > "Users and Access" section. (Apple Doc - https://help.apple.com/app-store-connect/#/dev8b997bee1)

  • Logout older sandbox id from App Store & login new sandbox id, here is the steps for iOS & macOS

    1. iOS: Open "Settings" > "App Store" > "SANDBOX ACCOUNT" (will be at bottom of screen)
    2. macOS: Open "App Store" app > "Preferences.." > "Sandbox Account" section will be at bottom

Ashvin
  • 8,227
  • 3
  • 36
  • 53
-9

First,make sure the account of your in test app is right. Second,when you are working in the app,click the recharge button,and input the right account for testing.