Objective-c – Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store”

app-store-connectin-app-purchaseipadobjective c

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

Best Answer

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
Related Topic