11

I'm developing in-app purchase using this excellent tutorial: http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial and I'm getting an error "Cannot connect to itunes store" which it seems can be related to Apple's sandbox servers being down; apart from googling for tweets regarding sandbox status, is there any other way of confirming their status otherwise it's difficult (read ipossible) to debug.

4 Answers 4

18

Almost a year late, but I'm facing the same problem right now. As far as I know, the best way to test the status of the iTunes Sandbox environment is checking this url:

http://sandbox.itunes.apple.com

An Http/1.1 Service Unavailable means SSErrorHTTPStatusCodeKey=503 in your debugger output.

1
  • 11
    It would seem that the link that has been given is always Unavailable now.
    – Oxcug
    Aug 27, 2014 at 23:06
11

I'll answer this in case someone else also comes up against this. I have an app in the app store that was built using the tutorial mentioned in the question, and it performs flawlessly. Unfortunately, in my experience the reliability of the Apple Sandbox servers can be iffy, with no obvious place to check online aside from posting to the Apple forums and hoping for a corroborative reply.

As others have said on StackOverflow, the key is to make sure that:

  1. You create at least one test user account at itunesconnect.apple.com
  2. Make sure that there is NO credit card associated with the test account
  3. DO NOT sign into iTunes on your test device with the test account. Instead, SIGN OUT of any iTunes Store account you are signed into. Then try purchasing an IAP. It will ask for your username and password - give it your test username(s).
2
  • 1
    That step 3 sign out works! The error message from the sandbox server just doesn't make any sense. It just says (0) - Cannot connect to iTunes Store. Who the hell would know that I have to SIGN OUT from the App Store first!!???
    – Hlung
    Dec 5, 2013 at 15:00
  • You? -- From Apple's documentation: "Create a test user account in iTunes Connect, as described in “Creating Test User Accounts” in iTunes Connect Developer Guide. On a development iOS device, sign out of the App Store in Settings. Then build and run your app from Xcode." Sep 4, 2014 at 13:31
2

I got the "Cannot connect to itunes store" error when using a tester sandbox account. The problem was I had signed in on my iPhone with that account and confirmed the email address associated with the test account.

I solved the problem by creating a new tester account under Users and Roles in Itunes Connect and never sign in on my device with the account.

The reason for the error in my case was that when I confirmed the email address, the account was registered as a production account in AppStore and it did not work as a sandbox account anymore.

So if you sign in on your device once, the account will be registered as a production account and even if you sign out again, that account won´t work in the sandbox.

1
  • What! insanity!
    – John
    Sep 27, 2018 at 23:50
1

For testing an app in Sand Box . Follow these steps

  1. To test IAP ,we have to create a test user at itunesconnect.apple.com

  2. Go to Settings and sign out from all active accounts (mail, iTunes & App Store , Game Center)

  3. Restart your device.

  4. Run your app on the device. Click on the IAP button -> choose existing account -> enter apple id and password created from step 1. Now everything will be fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.