Ios – “Cannot connect to iTunes store” when restoring iOS In App Purchase in iOS simulator

in-app-purchaseiosstorekit

I've looked through the many existing questions related to "Cannot connect to iTunes store" issues with iOS StoreKit and I don't think my situation is covered:

When running in the iOS Simulator, I get the "Cannot connect to iTunes store" error after restoring a previous bought in app purchase. If I hit Cancel, the popup goes away and the restore is successful.

There is no problem at all when buying the in app purchase, only when restoring.

Also, the problem only occurs on the simulator, not when testing on a real iPhone.

I'm pretty sure everything is OK, just wanted to confirm that it is just a simulator bug. Any one else seen this one?

Best Answer

Having researched this as much as I can, and confirmed that there are no issues when running on a device, either in sandbox mode or (since yesterday, when the IAP was approved by Apple) using a real Apple ID, I'm assuming this is a simulator bug and can be ignored.

Contrary to the answer posted by iLive below, and repeated elsewhere on SO, testing IAP on the simulator is explicitly supported by Apple, except for hosted content downloads.

UPDATE: It would appear that since iOS 7, testing IAP on the simulator is no longer properly supported. I've had it working using the non-64bit simulator, but not with the 64bit iPhone simulator. Your milage may vary. As per pix's comment below, Apple also seem to have removed mention of iOS simulator testing from their documentation.

Related Topic