Sandbox IAP Alternates Between Success and [ Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" ]

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.

Is this still a problem? It was for me yesterday, Thursday 10/26/16 and this morning, Friday 10/27/16 it's the same issue.

Still happening to me too. Started yesterday, October 26, and still not working yet today.

Magically started working for me today (didn't check since Monday, 2017-10-30, though). Of course there were no code changes, so it was definitely on Apple's side. Let's see how long it will work 😁

Sandbox IAP Alternates Between Success and [ Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" ]
 
 
Q