18

I developed a Phonegap iOS app that implements In app purchase. As suggested here, I used a sandbox user in order to test the IAP during the development process in iOS, but i can not find a way to switch back to my personal account to authenticate the application.

At the start of the development process, i signed out with my personal account, i didn't login with my sandbox user in General > iTunes & App Store, i started the application and i logged in with my sandbox user from that.

It is time now to pass to production and i can not figure out how to logout the sand box user from my app. If i start the application a Sign In popup is displayed and the sandbox email is there. It simply ask for the password but now chance to change the account. When i login within the application the sandbox user account is logged in General > iTunes & App Store, but if i log out from there the application is stuck with the sandbox email. In other words, it is like if the app is now linked to that email account and it does not give me the chance to change it.

I tried to remove the application (tapping on it and pressing the X button and from General > Manage storage), install it again, to soft reset the iPhone, log out from iTunes & App Store, rebuild the application in debug mode or not, including the plugin or not, in many combination but with no success.

Does anybody experienced something like this? How did you logout your sandbox user when you switched back to your personal iTunes Connect account?

Community
  • 1
  • 1
  • 2
    Usually, in order to test in apps with sandbox user, We just logout from current apple id from Settings->iTunes, App Store, and leave it open. Then in the app that is being tested, we try to purchase something, and in the popup window (alert) enter the apple id and password for sandbox user. In order to switch back to the real Apple ID, we just go to the Settings->iTunes, App Store, logout the sandbox user, and login with working Apple ID. This is my way of logging into the sandbox user and get back to the real apple id. – Fahri Azimov Sep 19 '15 at 12:49
  • I have the same problem now and @FahriAzimov's solution doesn't work for me. Have you found a solution yet? – Alveoli Nov 30 '15 at 16:20

3 Answers3

34

I'm not sure how it looks like on previous iOS versions, but on iOS 12.0 you can open:

Settings > Your Name (Apple ID, iCloud & App Store) > iTunes & App Store

Update: On iOS 14+ you can open:

Settings > App Store

There you will find a section called "SANDBOX ACCOUNT" where you can sign out of the sandbox account you've been using.

enter image description here

Omid Ariyan
  • 1,164
  • 13
  • 19
  • 3
    YOU Save my day – xhg Oct 11 '18 at 20:55
  • Save my day, too!! – Igotit Mar 05 '19 at 09:43
  • Great answer. I've been having problems with this all week. This was a terrible ux to hide something like this and not have this example inside AppStoreConnect. This was causing major issues. Thanks! – Lance Samaria Nov 03 '19 at 09:55
  • This! Was looking for this for quite a while! – Soberman Oct 28 '20 at 09:09
  • 1
    This answer definitely works but if you're on iOS 14 or higher go to **Settings > App Store > bottom of page**: https://developer.apple.com/forums/thread/661730. If you don't see it than (1) go to your app and try to make a purchase using your sandbox email, it will fail. Afterwards (2) go back to **Settings > App Store** and it should be at the bottom of the page. If it still doesn't work then read my next comment below – Lance Samaria Sep 25 '21 at 17:58
  • If that still doesnt work you may have to (1) sign out of your device **Settings > Apple Id/iCloud/Media & Purchases > Sign Out** (2) while still signed out try to make the sandbox purchase from your app with your sandbox test email (it will fail), then (3) sign back into your Apple account with your real info **Settings > Apple Id/iCloud/Media & Purchases > Sign In**, then go to **Settings > App Store**, it should be at the bottom of the page https://stackoverflow.com/questions/57850713/ios-13-how-to-login-in-in-app-purchase-sandbox-account/59278205#59278205 This is a ALOT of unnecessary work – Lance Samaria Sep 25 '21 at 18:08
25

On iOS 14 & 15:

Go to Settings > App Store

Scroll down until the end and you'll find the title "SANDBOX ACCOUNT", there you'll see the sandbox account you are currently logged in to, tap over it and it will let you change it.

Settings

Settings > App Store

Settings > App Store > Sandbox Account

0

I have found 2 ways to avoid the problem but first be sure to use a "fresh" testing account.

  1. Change the Bundle Identifier in Xcode and iTunes Connect
  2. Restore the iPhone

I go for the first one because my Testing device is also my personal iPhone and I can't afford restoring every week.

I spent so much time on that so I hope my answer can help you.

Romain
  • 649
  • 1
  • 5
  • 18
  • thanks for your answer, however it seems like a crazy problem and terrible design by Apple. Do you know if this is something everyone suffers or there's something different about the config for our system? – Alveoli Dec 08 '15 at 16:36
  • I had a similar problem. I removed the App and change the Bundle Identifier in Xcode so it will install the App as a new one and it won't be linked to any Testing account. I was then able to change my iCloud account. Can you try on another iOS device? – Romain Dec 09 '15 at 10:16
  • unfortunately I can't change my bundle ID as it's tied to other features like Push Notification :( – Alveoli Dec 09 '15 at 11:23