iOS IAP Testing, Test Users, Verification Required in Sandbox

When testing your In App Purchases on iOS there seems to be a very specific order in which to user your test user accounts or you will end up with iOS thinking your “test” user is a real user and hence asking you to verify the account in an infinite loop.

To use a test user to buy/test your IAP code do the following:-

1. Create a new test user in iTunes Connect. For the email address use a fake, made up, email address (you don’t need a real email address, actually better you don’t just in case your email address was previously used for an Apple ID you forgot about).

2. On your iOS device, log out of the iTunes account: Go into settings, then “iTunes & App Store”, touch the “Apple ID:xxxx” at the top if you are logged in, sign out.

3. Run/debug you app. Buy your item and use your new test users email and password to log in.

4. Done! All should have worked as expected, you shouldn’t have seen any verify prompt, your purchase code should have executed and you should have been able to debug any problems.

What else?

Item is still purchased after logging out of iTunes

Note that logging out of your iTunes test user account (in Settings), or even logging in as with a different Apple ID doesn’t affect the status of your purchases, if you bought something your app still thinks it is purchased. To wipe this info you need to uninstall your app.

Restore Purchases Test

So delete your app and then run again, go test your “restore purchases” button (you should have one). You should be able to log back in with your test Apple ID that you made purchases with and see the items obtained again. Again, you should also have been logged out of any other Apple ID accounts at the time you do this.

2 thoughts on “iOS IAP Testing, Test Users, Verification Required in Sandbox

  1. I got my in app purchase to work once by going through the procedure that you recommend, and thanks! However, now it looks like my test user has been killed by itunesconnect maybe because the test Apple ID got put into the Store settings on my test device. I can’t keep adding new test users every time this happens. Do you have a solution? Thanks!

    1. Don’t login with your test user in other apps and don’t login in the Game Center in Settings. Only use and login with your test user in your own app. If you do login Apple will make your test user a real account and you’ll need to make a new test user. Confusing I know!

Comments are closed.