Cannot connect to iTunes store error

12,181

Solution 1

You may remove that error via cross checking this check list. If your answer is no for any of the points then it may be causing the problem

  1. Have you enabled In-App Purchases for your App ID?
  2. Have you checked Cleared for Sale for your product?
  3. Does your project’s .plist Bundle ID match your App ID?
  4. Have you generated and installed a new provisioning profile for the new App ID?
  5. Have you configured your project to code sign using this new provisioning profile?
  6. Are you using the full product ID when making an SKProductRequest?
  7. Have you waited several hours since adding your product to iTunes Connect?
  8. Are your bank details active on iTunes Connect?
  9. Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work.
  10. For iOS7 and Xcode 5 Try doing this:
    1. You have to test on a physical device as apple restrict IAP testing in the simulator.
    2. Go to setting -> iTunes & App Store -> and log out of your account. Remove app from device and clean all data.

Most importantly do logout from your current iTunes account in your device before trying to do any purchase.

Make sure you have done all necessary steps for in-App purchase testing.

Solution 2

As of September/October 2013, iOS7 simulators cannot process app store inapp purchase requests.

You need to use a real device

Solution 3

Imagine, you created new app profile in My Apps of itunes connect. Added in-app. All correct.

Now you want to test purchases. It shows list of products but stops on buy button with "Cannot connect to iTunes Store" error in log.

This is because you try to buy not approved and not existing product! You can test only sandbox product right now.

So, you have to

  1. create sandbox user (in itunes connect - users...)
  2. logout you real itunes login on device
  3. try to buy under sandbox login (it will ask you)

Solution 4

Had same issue and I just remembered not any apple id will work. You have to create a testing apple id in itunes connect / manage users/ test user / add new user.

Solution 5

Try putting a build number in. Target > General > Identity > Build.

This solved it for me.

Share:
12,181
Vergmort
Author by

Vergmort

Updated on June 14, 2022

Comments

  • Vergmort
    Vergmort almost 2 years

    Well, I'm having this issue now. I'm using MKStoreKit in my in-app purchase. This are my errors:

    Failed transaction: <SKPaymentTransaction: 0x136a62e0>
    error: Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store" UserInfo=0x13654a90 {NSLocalizedDescription=Cannot connect to iTunes Store}
    

    Any idea?

  • capikaw
    capikaw almost 11 years
    Worked fine without provisioning for a week, then suddenly stopped. Put together my dev provision and voila! Thanks for the brain-jog!
  • Victor Engel
    Victor Engel over 10 years
    If a call to requestProductsWithCompletionHandler: returns a product, that implies all the above are satisfactory, right? That is my scenario, and I'm getting the code 2 error when purchasing the product (that was already confirmed as a valid product). And I am using a real device.
  • prakhar
    prakhar over 10 years
    @Victor Engel Try doing this: 1)You have to test on device as in new Xcode 5 Apple restricted the IAP testing in simulator. 2)Go to Device setting -> iTunes & App Store -> and log out of your account. Remove app from device and clean all data. Here are some links which will let you know the problem and its way-out discussions.apple.com/message/23226506#23226506
  • jheriko
    jheriko about 10 years
    i have this same problem - everything works correctly until the final purchase confirmation which returns the error message mentioned. this is since creating a new version on itunes connect - the code remains unmodified from a 'known good' version used for the previous release.
  • djdance
    djdance over 9 years
    Thank you, it helps. So, 1) create sandbox user 2) log out from itunes on device