What is SKErrorDomain Error 0 and what can I do about it?

What to do when seeing SKErrorDomain Error code 0 from StoreKit on iOS.

Charlie Chapman

Charlie Chapman

Published

Debugging StoreKit errors can sometimes be frustrating! If your app is seeing SKErrorDomain Error 0, or SKError.Code.unknown it can be extra frustrating because it’s not clear what to do to resolve the issue.

Unfortunately, this is an unknown error coming directly from Apple’s API. Often this is just an error on Apple’s side, especially if your app was working previously and suddenly started throwing errors. But there are some things you can do to make sure there are no issues on your end.

Check our status page

The first thing I would do when receiving unexpected StoreKit errors is checking the RevenueCat status page. We process over a billion requests per day so you can rest assured that we’re usually the first to know if Apple’s API (or Google’s API) is having issues.

You can also check Apple’s developer system status page. This is usually slower to update than our status page but this is where Apple will officially notify developers of any issues.

Test with StoreKit configuration files

If there are no known issues on our status page, you should test your app in the simulator with a StoreKit configuration file. We recommend this approach for testing any issues with your in-app purchases in iOS. 

Screenshot of Storekit configuration file as seen in Xcode.
Figure 1: Storekit configuration file as seen in Xcode.

Using a StoreKit configuration file can help you narrow down where your underlying issue is coming from. This will mock the Apple API portion of your in-app purchase testing. If everything works, then you know that your code and the RevenueCat backend are configured correctly, but there may still be an issue with your App Store Connect configuration.

Check your App Store Connect configuration

If your app is working correctly when testing with a StoreKit config file, you’ll want to check that your app is configured correctly in App Store Connect.

You should ensure that your bundle id and all of your product identifiers match between App Store Connect and the RevenueCat dashboard. All of your products in App Store Connect should also be in an “Approved”, “Ready to Submit”, or “Waiting on Review” state. 

Screenshot of subscription products section of App Store Connect.
Figure 2: Make sure your subscription products are all in the correct status in App Store Connect.

You should also check your Paid Applications Agreement and tax forms inside of App Store Connect to make sure that everything is signed and no agreements have expired as this can cause API calls to fail.

Reset your test environment

If you’re testing locally from Xcode using a StoreKit configuration file, your test environment may be in a corrupted state. You can reset your test StoreKit configuration by deleting the app from your simulator and rerunning the app from Xcode.

This should clear out any purchase state from your app and everything should appear as if you are a new user who has not made any purchases.

If you’re testing on a real device in the sandbox environment, your test user may be in a bad state. If you suspect this may be the case, you can create a new sandbox test account and retry your app.

Where to find Sandbox Testers in App Store Connect.
Figure 3: Where to find Sandbox Testers in App Store Connect.

Try again later

The reality is that the underlying issue is most likely an issue in Apple’s backend systems and you’ll just have to wait until they resolve it. Fortunately, these issues are less common in Apple’s production environment than they are in the testing sandbox environment. 
Unfortunately, App Review uses a sandbox environment that we do see issues from occasionally. This means you may get an App Store Rejection because of a StoreKit sandbox environment issue that isn’t your app’s fault. In this case, the best course of action is to simply resubmit and hope Apple’s environment is fixed for the next reviewer.

In-App Subscriptions Made Easy

See why thousands of the world's tops apps use RevenueCat to power in-app purchases, analyze subscription data, and grow revenue on iOS, Android, and the web.

Related posts

How we solved RevenueCat’s biggest challenges on data ingestion into Snowflake
How we solved RevenueCat’s biggest challenges on data ingestion into Snowflake
Engineering

How we solved RevenueCat’s biggest challenges on data ingestion into Snowflake

Challenges, solutions, and insights from optimizing our data ingestion pipeline.

Jesús Sánchez

Jesús Sánchez

April 15, 2024

How RevenueCat handles errors in Google Play’s Billing Library
How RevenueCat handles errors in Google Play’s Billing Library  
Engineering

How RevenueCat handles errors in Google Play’s Billing Library  

Lessons on Billing Library error handling from RevenueCat's engineering team

Cesar de la Vega

Cesar de la Vega

April 5, 2024

Use cases for RevenueCat Billing
Engineering

Use cases for RevenueCat Billing

3 ways you can use the new RevenueCat Billing beta today.

Charlie Chapman

Charlie Chapman

March 21, 2024

Want to see how RevenueCat can help?

RevenueCat enables us to have one single source of truth for subscriptions and revenue data.

Olivier Lemarié, PhotoroomOlivier Lemarié, Photoroom
Read Case Study