Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone In-App Purchase Store Kit error -1003 "Cannot connect to iTunes Store"

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.

like image 473
Rei Avatar asked Nov 11 '09 20:11

Rei


People also ask

Why is my iPhone saying Cannot connect to iTunes store?

Make sure that your device is connected to the internet Use any web browser to connect to any website. If nothing loads, 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 my in-app purchase not working?

If you haven't received an in-app item you bought, try closing and restarting the app or game you're using. Tap Apps or Manage applications (depending on your device, this may be different). Tap the app you used to make your in-app purchase.


1 Answers

I had a similar situation and dumped the iPhone's network traffic to see what's going on. I found that the normal store was contacted instead of the sandbox. It helped to delete the app from the device, make clean and build/install it again. Apparently something with the development profile had gone wrong.

Update: To dump the network traffic of a non-jailbroken iPhone, just use Internet Sharing on your Mac and configure your iPhone to use your Mac's WiFi. Then tcpdump -n -i en1on your Mac will do the trick.

like image 95
Ortwin Gentz Avatar answered Sep 30 '22 17:09

Ortwin Gentz