Ansari
Ansari

Reputation: 1935

SKErrorDomain Code=0 “Cannot connect to iTunes Store”

My application has just gone live on the iTunes Store, and after that, I am unable to start any purchase. I have tested the application and its working fine in Sandbox envoirnemnt. But Live application gives the error

Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store

enum value = SKErrorUnknown

I have tried signing out any test accounts from Store login, but it just doesn't ask for any account login and error keeps on coming. Any clue!

Upvotes: 25

Views: 44860

Answers (6)

ChikabuZ
ChikabuZ

Reputation: 10185

Check if you sign out of the iTunes Store. To sign out, follow these steps:

  1. Open the Settings App
  2. Tap the “Store” row
  3. Tap “Sign Out”

Upvotes: 7

Li Jin
Li Jin

Reputation: 1

in your Xcode:

  1. Click on your active scheme name right next to the Stop button
  2. Click on Edit Scheme....
  3. in Run (Debug) select the Arguments tab
  4. in Environment Variables click +
  5. add variable: OS_ACTIVITY_MODE = disable

Upvotes: -3

l-l
l-l

Reputation: 3854

I was getting the same error while testing subscriptions, was able to get it to work by adding a Localization (Subscription Display Name and Description) to the product from iTunes connect.

Upvotes: 8

formica
formica

Reputation: 944

This scenario was exactly mine. After addPayment was called, a dialog box popped up saying "Log in to the iTunes store with an existing or new account". As soon as I selected Login, I got the error above.

I had reinitialised my iPad and signed out of iCloud. No luck. Then, showing a friend, found that there is also an iTunes a& AppStore sign out option which is distinct from this. Clicked on the Touch Id line and it offered me a sign out option. Then, I was prompted to login with a test account on making a purchase. It worked!

Upvotes: 0

Manthan
Manthan

Reputation: 3914

This can happen because of the two problems i guess.

  • Make sure you have placed the correct "Product Identifier".If that's the case, then you'll get error 0 shortly after calling -[SKPaymentQueue addPayment:], before you get the popup asking you to confirm payment.

  • Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.

To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.

Hope this helps you.

Upvotes: 17

Dipen Panchasara
Dipen Panchasara

Reputation: 13600

you can check few things and verify it.

Verify following things :

(1) your App's Bundle ID. it should be same as you created in iTunes store in which you have added In App Purchases.

(2) Check Your In App Identifier Name, which you use in Application.

If any of these is not matching it would throw Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store exception.

Upvotes: 2

Related Questions