I am using auto renewable subscription in my iOS app. The subscription worked fine for all users in the sandbox environment. After moving the app to TestFlight, in the Production Sandbox environment, the purchase failed with Code=0 "Cannot connect to iTunes Store" for several users. Most of the users can subscribe to the app without any issue.
One user who was experiencing this issue tried reinstalling the app, restarting the device, sign out from the sandbox account, re-sign in to the iTunes account. Nothing has worked for this user yet.
I found this in the Apple forum, which is similar to my issue. But no clear answer there too. https://forums.developer.apple.com/thread/131831
Any idea about this? Anybody else experiencing the same behavior with the production sandbox environment?
UPDATE:
One user who experienced the issue was able to subscribe to the app with a different iTunes account. So this seems like the issue is happening only with some Apple IDs. Any idea on this?
When you make the purchase, are you using an
SKProductthat has been retrieved immediately prior to the purchase, via anSKProductsRequest?If you're keeping an
SKProductaround, even for a couple of minutes, some of the requests to purchase may fail with the error code and message that you're seeing.