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

I'm working on in-app purchases in my iPad app. I can get the productsRequest:didReceiveResponse and get an array of products.

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

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

Domain error = code SKErrorDomain = 0 "Unable to connect to iTunes Store" UserInfo = 0x339120 {NSLocalizedDescription = Unable to connect to iTunes Store}.

And also I cannot add any new test users to the Manage User.

Any solution is welcome. Thanks

+4
source share
2 answers

This issue may also occur if your application is in Sandbox and your AppStore account is not valid for the Sandbox environment. In my case, I logged into the AppStore with my personal account , and every time I tried to make a purchase, I got the same error as you.

So the solution is:

  • log out of the AppStore account (from the settings)
  • go to your application and try to make a purchase
  • when the application asks for your Apple ID, select "Use an existing Apple ID" and log in to your Sandbox account
+6
source

In addition to the answers above, make sure that you are launching the device, not the simulator. This solved the problem for me.

+1
source

Source: https://habr.com/ru/post/1382224/


All Articles