Skip to main content

I’m trying to test the paywall in my app on a physical iPhone. The first time I tapped a subscription option, I was prompted to sign in with my Apple ID. After signing in, I received an error saying the user isn’t allowed to make in-app purchases in the sandbox environment.

 

I later realized I needed to create a dedicated sandbox test user for this. I’ve since created the correct test users in App Store Connect. However, the issue I’m facing now is that the app seems to remember the original (non-sandbox) Apple ID I used, and I’m no longer prompted to log in when attempting a purchase.

 

I’ve tried deleting and reinstalling the app, and signing out of iCloud on the device, but it still doesn’t trigger a login prompt when I tap the purchase button.

 

Has anyone run into this? Is there a reliable way to reset or clear the previously cached Apple ID used for sandbox testing?

Hi ​@unaryops,

If you signed up already with your sandbox account in your device or simulator you won’t be prompted that again because you are already logged in. You should be able to make purchases with that account.

That alert you saw is part of Apple’s logging mechanism and they are the ones deciding when and where to show it, if it doesn’t appear it means everything is correct and good to make purchases.

 

Best,


Hi ​@joan-cardona, thanks for the reply. Just to clarify, the issue here is slightly different:

Initially, I mistakenly used a regular (non-sandbox) Apple ID to make the purchase, which resulted in the error saying the user isn’t allowed to make sandbox purchases. Now, even after creating proper sandbox test users, my device still remembers the original (non-sandbox) account. As a result, it’s not prompting me to log in again using the correct sandbox credentials.

Is there a recommended way to force the app or device to reset this cached Apple ID, or otherwise trigger the login prompt again?

Edit: I attached two screenshots to illustrate the problem.

Thanks!


Hi ​@unaryops,

You can check here how to change the sandbox account that you are using to test purchases on the App Store. 

Let me know if this works!


Thank you for linking the docs. This worked! 


Reply