Aarti
Aarti

Reputation: 109

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

I'm working on In-App purchases to my iPad app. I am able to receive the productsRequest:didReceiveResponse method, and receive the array of products.

My problem arises when I add a SKPayment to the SKPaymentQueue. After I add the product to the queue, in the paymentQueue:updatedTransactions method the transactions always have the state SKPaymentTransactionStateFailed.

I NSLog the transaction.error and this is what it returns:

Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x339120 {NSLocalizedDescription=Cannot connect to iTunes Store}.

And also i am not able to add any new test user in Manage User.

Any solution is most welcome. Thanks

Upvotes: 4

Views: 5903

Answers (2)

Shyam Bhat
Shyam Bhat

Reputation: 1600

In addition to the above answers, make sure you run on a device and not on the simulator. That solved the issue for me.

Upvotes: 1

Josip B.
Josip B.

Reputation: 2464

This problem may also occur if your app is in Sandbox and your AppStore account isn't valid for Sandbox environment. In my case I was logged into AppStore with my private account and each time I tried to make purchase I got the same error as you.

So solution is:

  • log out from your AppStore account (from Settings)
  • go to your app and try to make purchase
  • when app asks you for Apple ID choose "Use Existing Apple ID" and login with your Sandbox account

Upvotes: 6

Related Questions