44
votes

In order to test my in-app purchases with iOS 13 I have to update one of my test devices to iOS 13.1 beta.

On iOS 12 and before there was a special Sandbox login in Settings/iTunes & App Store/Sandbox Account:

However, after the update to iOS 13 this section is missing. I tried to follow the instruction in the answer to a similar problem on iOS 12 but nothing worked. I completely reset the device and logged out both at Settings/iTunes & App Store and at Settings/Apple ID, so currently the device is not connected to any account (real or sandbox). At least as far as I can tell.

I have re-installed my app on the devices using Xcode 11 beta and tried to perform an in-app purchase. The store shows a login prompt which shows that this is a Sandbox purchase. However, the prompt only asks for the password, not for a username or Apple ID. So I have no idea which account should be used here.

When using the password of a newly created test user account the password is not known. I can use the password of my real Apple ID account which was used during the device setup and was then disconnected.

So, how to connect to a specific Sandbox account in iOS 13?

9

9 Answers

24
votes

Here's what worked for me (on a dedicated development iPhone 6s running iOS 13.3).

  1. Sign out of iTunes & App Stores
  2. Sign out of iCloud
  3. Run app on device, and click to purchase an item.
  4. When prompted for an ID/Password, enter the Sandbox Tester credentials.

It took entering the credentials a couple of times, but the In App purchase dialog alert did say the environment was Sandbox.

After it "made good" (that is, stopped asking me to log in and processed the SKPaymentTransation), I was able to go to iTunes & App Stores in the General Settings, scrolled to the bottom, and now the Sandbox Account appears with the tester account showing.

Now when I run the app and click the button to purchase content, it just asks for the tester password.

Hopefully this helps others.

20
votes

Sandbox Account section, in the iTunes & App Store of iOS 13, is not visible right away and can be confusing. Here is how to enable it:

  1. Navigate to Settings.app → iTunes & App Store
  2. Log in with your developer account (non-sandbox) on top of the screen where it says "Sign In..."
  3. Ignore rest of the screen for now and go to your app.
  4. Make an In-App Purchase.
  5. iOS will ask you for an email and password to complete the purchase.
  6. Enter sandbox user credentials in the alert form.
  7. In-App Purchase will proceed with compressed sandbox times.
  8. Go to iTunes & App Store again. At the very bottom, you will see the new Sandbox Account section. You can logout and login to a different sandbox account or leave it as is.

You can't enter the sandbox account into iTunes & App Store as the primary account as of iOS 13 — the system will refuse to log you in with error with an odd copy mentioning "try again later." No matter how much you wait, iOS 13 will refuse your sandbox account here.

5
votes

I had the same issue looking for a solution than I found this article, in-app purchase testing

I think from ios 13 and onward, we don't require a sandbox user for in-app purchase testing neither for dev nor prod.

enter image description here

4
votes

It seems iOS bug, I had the same issue, And i was able to see SANDBOX ACCOUNT section only after doing these steps:

  1. Sign out with my production apple id.
  2. Sign in with the sandbox account apple id.
  3. Sign out with the sandbox account apple id.
  4. Sign in with my production apple id.

Afterwards you will be able to see your production apple id in use and the test apple id in SANDBOX ACCOUNT section.

4
votes

The following worked for me on ios 13:

Settings -> iTunes & App Store -> Scroll all the way down and click on "Sign In" under the "SANDBOX ACCOUNT" section

3
votes

I had the same issue and i finally found the solution : You just try to purchase the product in your app and enter your sandbox user credentials then you will get the Settings/iTunes & App Store/Sandbox Account login.

1
votes

Install your app with in-app purchases via TestFlight.

0
votes

While unfortunately none of the suggested answers helped to actively bring back the Sandbox option, in my case it helped to update to the (now) latest iOS 13 version.

I do not know if this just a coincidence, if there was some bug fix in the latest iOS update or if I have performed any healing steps without knowing it...

So, while this is no real solution I added this answer just in case it might help someone else.

0
votes

alright, this works for me. Similar to @Tim in the first answer.

So you have to log out your primary Apple ID for iCloud. Then you just run your test app, click the button where you wanna trigger in-app purchase. It will ask you for email and password to login.

You login, then if you go back to your iTunes and Appstore, you will see the sandbox account you just signed in just list there.

You can then log out, and log in other sandbox account. yay~