Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Store Kit "Cannot connect to iTunes Store"

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.

like image 966
lucasharding Avatar asked Mar 01 '10 22:03

lucasharding


People also ask

Why is my iPhone saying Cannot connect to iTunes Store?

Make sure your device is connected to the internet Use any web browser to connect to any website. If nothing is loading, use another device on the same network to see if it can connect to any website. If no other devices can access the internet, turn off your Wi-Fi router, then turn it on again to reset it.

Why is iTunes Store not loading?

If your computer still doesn't connect, make sure your internet connection is working—open a web browser and visit a website. If your internet connection is OK, there may be a problem with the iTunes Store. Try visiting the store again later. Make sure your computer's date, time, and time zone are set correctly.


2 Answers

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

like image 153
AlBeebe Avatar answered Oct 08 '22 22:10

AlBeebe


I assume you've done the standard sanity checks: double-checking your code, confirming your product IDs, comparing your code to the In-App Purchase Programming Guide, etc.

This may be ridiculous, but -- if you're certain your code is correct -- do a hard reset (full wipe) of your iPod (Settings => General => Reset => Erase All Content and Settings). I puzzled over this exact problem for hours -- it turned out my code was correct and the hard reset was the solution.

like image 25
M.. Avatar answered Oct 08 '22 23:10

M..