Suddenly get SKErrorDomain Code=0 in In-App Purchase response

Hi there!


We were testing In-App Purchases using sandbox account in our application and today they suddenly stop working.


We checked in debug mode and found that sometimes SKProductsRequest returns our products in "invalidProductIdentifiers" property and after a few requests it returns them as valid in "products" property.


When it returns products as valid and we try to make purchase, we are getting response with SKPaymentTransactionStateFailed in transactionState property.

We checked transaction.error property and it says:

Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x339120 {NSLocalizedDescription=Cannot connect to iTunes Store}.


We checked all settings in itunesconnect and on developer portal.

In-App Purchases are setup correctly, App Id is active and In-App Purchases are enabled for it both for Development and Distribution modes.

We tried to make purchase on many devices with different sandbox accounts.

We even tried to create new sandbox account, but it didn't help, we still getting same errors from StoreKit.


Please note, that yesterday all worked correctly, we were able to make test purchases on same sandbox account for same In-App Purchase id.


Can anybody help us with this issue?

Maybe somebody already faced such problem.


Thank you.

Accepted Reply

Did you renew your developer account recently? Because that is what triggered this bug for us.


We have the same issue, exact same build that worked now returns invalid products all the time. It does so for other apps on our account as well.

The only thing that changed is that our developer account auto-renewed last week.

I have since found https://forums.developer.apple.com/thread/64604which seems to confirm it.

Replies

'suddenly stopped working' means something is wrong with the apple servers. However, if it didn't happen suddenly but happened after you did XYZ then it is possible that XYZ may be causing your problem. For example, could you have changed your log in to the App Store from a test user to a real user? Could you have loaded a real app from the app store before overlaying it with a build from Xcode? Both of these would cause you to switch from the sandbox environment to the production environment resulting in that error.

Hi,

We checked both variants:

- we didn't change log in to the App Store from a test user to a real user,

- we didn't install test build from Xcode over real app, loaded from app store, we test only clear install of test build from Xcode.

So we didn't switch from the sandbox environment to the production environment.


But still we have same errors, which were described:

Sometimes SKProductsRequest returns our products in "invalidProductIdentifiers" property and after a few requests it returns them as valid in "products" property.

When it returns products as valid and we try to make purchase, we are getting response with SKPaymentTransactionStateFailed in transactionState property. The transaction.error property says:

Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x339120 {NSLocalizedDescription=Cannot connect to iTunes Store}.


Thank you.

I am seeing this problem too. All of our product identifiers are continuously returning as invalid, although nothing has changed. For us it isn't sporadic, it's happening every time and seems to have just started this morning.

Did you renew your developer account recently? Because that is what triggered this bug for us.


We have the same issue, exact same build that worked now returns invalid products all the time. It does so for other apps on our account as well.

The only thing that changed is that our developer account auto-renewed last week.

I have since found https://forums.developer.apple.com/thread/64604which seems to confirm it.

Hi,


Yes, developer account was renewed recently.

And today all became work correctly.

We are receiving valid products in first response from StoreKit, and valid product can be purchased successfully at first attempt.


So, it took 6 days for StoreKit to start work correctly.