views:

2286

answers:

4

Hi all-

I've been working on adding in-app purchases and was able to create and test in-app purchases using Store Kit (yay!). During testing, I exercised my app in a way which caused the app to crash mid purchase (so I guess the normal cycle of receiving paymentQueue:updatedTransactions and calling finishTransaction was interrupted).

Now I am unable to successfully complete any transactions and instead am getting only transactions with transactionState SKPaymentTransactionStateFailed when paymentQueue:updatedTransactions is called.

The transaction.error.code is -1003 and the transaction.error.localizedDescription is "Cannot connect to iTunes Store"!

I have tried removing all products from iTunesConnect, and rebuilt them using different identifiers but that did not help. I have also tried using the App Store app to really connect to the real App Store and download some apps so I do have connectivity. Finally, I have visited the Settings:Store app to make sure I am signed out of my normal app store account.

Any ideas?

-Rei

A: 

Check out this discussion for a possible fix.

luvieere
Thanks luvieere. I did not see this until I answered my own question, but I guess just exercising the network connection between the iPhone and the App Store clears up this issue.
Rei
A: 

I fiddled around with going to the App Store and then back to Settings/Store to Sign Out. I did this 3 times, revisiting my app each time and adding debugging NSLog output, and now I am able to continue testing my in-app purchase code without error -1003. I am not sure the exact reason for this working again, but I am fairly certain is is not a code change on my part as all I was doing was adding NSLogs and re-running my app.

Rei
A: 

Yeah, IF you've connected your iPad/iPhone to a different computer initially, and are now using it on another, you absolutely must sign out of store on your iPad, sign in w/ normal account to ITunes on your MAC, then Sync.

Also, make sure your iPad "WIFI" is on...

perimeter
A: 

I had the same error that seemed to pop up out of nowhere (was working fine one day, but then the next day it was giving me these errors about 2 out of every 3 times I tried testing my in-app purchase).

Then I visited the App Store (when trying to make another real purchase), and realized that they had a new user agreement that they wanted me to verify. After I did that, when I went back to my own app and tried out the test purchase again, it was working fine and have had no errors since. So I suspect I was getting the error because they wanted me to verify the new user agreement.

Now the only thing I wonder is if there is a way for my in-app purchase to forward that prompt to my users instead of giving them a mysterious error?

frandogger