I have been implementing IAP in my app, and have been trying to test purchases over the last few days. I have tried from scratch following Apple's guidelines, and online tutorials, all the way to using Swifty Storekit and IAPManager.
Here's what happens: I press buy for my consumeable IAP, then there is a sucessful purchase. If I try to buy it again, there failed purchase with the following error:
Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store"
UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}
If I buy it a third time, it works fine. And so on in that pattern.
Observations/testing:
- Pattern follows between launches
- Pattern follows across devices
- Reproduceable in iOS9 & iOS10
- Using xcode8 and swift3
- Deleted my previous sandbox testers and created a new one and problem persists
- Tried vasious waits between purchases, up to 10 minutes, problem persists.
Any ideas on what could cause this? I am suspecting when live it will be fine, but it is really realy odd.