My application has just gone live on the iTunes Store, and after that, I am unable to start any purchase. I have tested the application and its working fine in Sandbox envoi
I was getting the same error while testing subscriptions, was able to get it to work by adding a Localization (Subscription Display Name and Description) to the product from iTunes connect.
you can check few things and verify it.
Verify following things
:
(1)
your App's Bundle ID
. it should be same as you created in iTunes store in which you have added In App Purchases.
(2)
Check Your In App Identifier
Name, which you use in Application.
If any of these is not matching it would throw Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store
exception.
in your Xcode:
Check if you sign out of the iTunes Store. To sign out, follow these steps:
This scenario was exactly mine. After addPayment was called, a dialog box popped up saying "Log in to the iTunes store with an existing or new account". As soon as I selected Login, I got the error above.
I had reinitialised my iPad and signed out of iCloud. No luck. Then, showing a friend, found that there is also an iTunes a& AppStore sign out option which is distinct from this. Clicked on the Touch Id line and it offered me a sign out option. Then, I was prompted to login with a test account on making a purchase. It worked!
This can happen because of the two problems i guess.
Make sure you have placed the correct "Product Identifier".If that's the case, then you'll get error 0 shortly after calling -[SKPaymentQueue addPayment:], before you get the popup asking you to confirm payment.
Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.
To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.
Hope this helps you.