iPhone Store Kit "Cannot connect to iTunes Store"

lucasharding picture lucasharding · Mar 1, 2010 · Viewed 52.3k times · Source

I am working on adding In-App purchases to my 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 UserInfo=0x165000 "Cannot connect to iTunes Store"

I have logged out of the Store in the Settings app, but after trying to purchase a product in my app it never asks me to log in with my test account. It just fails with the above error.

Answer

AlBeebe picture AlBeebe · Oct 27, 2012

I was getting SKPaymentTransactionStateFailed error code 0 "Cannot connect to iTunes Store" and thanks to thomax for this answer my problem is solved. Turns out you MUST enter a build number under Targets->Summary.

I spent the last 24 hours resetting my phone, screwing with iTunes connect, and doing just about everything i could think of before i stumbled upon this solution.

SKPaymentTransactionStateFailed code 0 Cannot connect to iTunes Store

SKPaymentTransactionStateFailed code 0 Cannot connect to iTunes Store