views:

1103

answers:

4

Hi,

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.

Thanks in advance.

A: 

Me three - any solutions?

Tonester
I have found the solution to my problem. I don't know if you were following same tutorial as me (http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/) but I had stupidly missed changing kInAppPurchaseProUpgradeProductId to my app when putting 2nd code snippet in.
Tonester
+3  A: 

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.

M.
A full restore did the trick. Thanks
lucasharding
I had this problem before and I did a full restore which didn't solve the issue. It turned out the Sandbox servers were down. So before following this advice I strongly suggest you check out the development forums for any known issues.
Daniel Wood
A: 

I encountered the problem with exactly same ErrorCode and Description. And M.'s trick work perfectly. Thanks!

George Lai
A: 

I had been getting the same error but I had been prompted for my test user account. And also a popup saying "An unknown error has occurred". It turns out that when I created my test user account and signed out of the settings -> store I had decided to sign in with my test user account which had prompted me for a bunch of information including billing, which had broken my test user account. When I created a new test user account and only signed in when prompted to during the in app purchase testing, everything worked smoothly.

DonnaLea