Handle errors resulting from StoreKit requests.
A StoreKit request may fail for one of many possible reasons, including invalid product information, invalid payment details, problems with your App Store Connect account, or networking issues. When an error occurs, check the error code to find out what went wrong.
Determine the Cause of the Error
StoreKit uses the
SKError error domain for errors related to payments, store products, and cloud services, as described in
SKError. For additional information on troubleshooting StoreKit framework issues, see the In-App Purchase FAQ.
Errors related to networking use the
NSURLError error domain. The following table describes some of the most common networking errors that may occur when using StoreKit.
The connection timed out.
The connection failed because the host could not be found.
The connection failed because a connection cannot be made to the host.
The connection failed because the network connection was lost.
The connection failed because the device is not connected to the internet.
The connection failed because the user canceled required authentication.
The secure connection failed for an unknown reason.