Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In-App Purchase Error Code 0

I'm trying to troubleshoot why I'm getting "Cannot connect to iTunes Store" with error code 0.

I know my app identifier is fine because I retrieve product information on app launch and log the results and I get the correct product identifiers and prices from iTunes. When I change my app identifier to something stupid this fails.

I know my product identifiers are fine as well for the above reasons (it wouldn't work otherwise and I double checked).

I have tried firing the purchase by creating an SKPayment in 2 different ways:

FIRST WAY

SKPayment *payment = [SKPayment paymentWithProductIdentifier:productIdentifier]; // This is deprecated in ios 5 but should work
[[SKPaymentQueue defaultQueue] addPayment:payment];

SECOND WAY

SKPayment *payment = [SKPayment paymentWithProduct:foundProduct];
[[SKPaymentQueue defaultQueue] addPayment:payment];

(foundProduct is from the array of SKProducts that get returned from an SKProductsRequest)

Both ways fail with error code 0.

I've tried this both on my iPhone 4S running iOS 5.0.1 and in Simulator on iOS 5.

I've read that hard resets work (2359739) which seems insane, but I went ahead and tried it in Simulator (iOS Simulator => Reset Content and Settings...) to no avail.

Only thing I can think of is that maybe the iTunes sandbox servers are being wonky...

like image 236
AFR Avatar asked Dec 29 '11 08:12

AFR


People also ask

Why is my in app purchase not working?

Restart the device Tap Power off or Restart (depending on your device this text may be different). If needed, hold down the power button again to turn the device back on. Wait for the device to start back up. Re-open the app or game and check if the in-app purchase has been delivered.

Why is my iPhone not letting me make in app purchases?

Make sure that you're signed in with the same Apple ID that you used to make the purchase. Make sure that in-app purchases are allowed on your device. Restart your device: Restart your iPhone.

Why do I keep getting in app purchases not allowed?

In iOS 11 and lower, choose “General” > “Restrictions“. Type your restriction password. If you don't remember setting a password, ask anybody else who may have had access to the device. Scroll down to the “In App Purchases” or “iTunes & App Store Purchases” option and ensure it is turned “On/Allow“.


1 Answers

This error can also be caused by trying to use the incorrect iTunes Connect test account. If you attempt to use a test account for another team than the one the app you are testing is registered to, it will cause the same error with no more specific message.

like image 131
Anthony Mattox Avatar answered Oct 12 '22 10:10

Anthony Mattox