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.
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.
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.
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.
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.
You might also like
- Blog post
Implementing in-app purchases and monetizing your Roku app: A step-by-step guide
A comprehensive guide to implementing and monetizing your Roku channel, from choosing the right strategy to technical tips and integration best practices.
- Blog post
How we built the RevenueCat SDK for Kotlin Multiplatform
Explore the architecture and key decisions behind building the RevenueCat Kotlin Multiplatform SDK, designed to streamline in-app purchases across platforms.
- Blog post
Inside RevenueCat’s engineering strategy: Scaling beyond 32,000+ apps
The strategies and principles that guide our global team to build reliable, developer-loved software