What does StoreKitError.networkError mean?
StoreKitError.networkError means a StoreKit 2 request could not finish because of a network problem, and it carries the underlying URLError.
Quick facts#
| Error | StoreKitError.networkError(URLError) |
| Where | StoreKit 2, Swift (StoreKitError) |
| Available since | iOS 15.0, iPadOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, visionOS 1.0 |
| What the vendor says | A network error occurred. |
Cause#
- A StoreKit 2 request to the App Store failed at the network layer. The case carries a
URLError, so the real reason (offline, timeout, lost connection) is in itscode. - Apple's documentation for the case is one line. The reason is not in the case name; it is in the associated
URLError. - The error comes from the device or its connection, not from your app's product configuration.
Fix#
- Read
urlError.codefirst..notConnectedToInternetmeans the device is offline;.timedOutand.networkConnectionLostare usually temporary. - Retry the action after a short pause, or when the connection returns. Do not retry in a tight loop.
- Show a message such as "Check your connection and try again" and keep the paywall open.
- Do not unlock content because of this error. Unlock from verified transactions only.
Example#
Swift
import StoreKit
// A purchase that fails on the network is safe to offer again: nothing was bought.
func buy(_ product: Product) async {
do {
let result = try await product.purchase()
print("Purchase result: \(result)")
} catch StoreKitError.networkError(let urlError) {
// The URLError code says why: offline, timeout, lost connection.
print("Network problem (\(urlError.code.rawValue)); ask the person to try again")
} catch {
print("Purchase failed: \(error)")
}
}Compile-checked: npm run check:snippets type-checks this snippet with swiftc against the Apple SDK (macOS target, checked 2026-10-03).
How the RevenueDot SDK reports it#
The RevenueDot purchases-ios fork maps StoreKitError.networkError to ErrorCode.networkError (code 10) and passes the URLError along as the underlying error. A device that is offline surfaces as offlineConnectionError (code 35) when the SDK's own request fails the same way. See what networkError means in the SDK.
Related#
- What does networkError (code 10) mean in the purchases SDK?
- What does offlineConnectionError (code 35) mean in the purchases SDK?
- What does Play Billing NETWORK_ERROR (12) mean?
Source#
- Apple: StoreKitError.networkError(_:)
- Apple: URLError
- RevenueDot purchases-ios: StoreKitError+Extensions.swift (how the SDK maps StoreKit 2 errors)
Checked: 2026-10-03