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 its code.
  • 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#

  1. Read urlError.code first. .notConnectedToInternet means the device is offline; .timedOut and .networkConnectionLost are usually temporary.
  2. Retry the action after a short pause, or when the connection returns. Do not retry in a tight loop.
  3. Show a message such as "Check your connection and try again" and keep the paywall open.
  4. 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.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated