What does networkError (code 10) mean in the purchases SDK?

The purchases SDK raises networkError (code 10) when a request fails at the network layer.

Quick facts#

Error ErrorCode.networkError (iOS), PurchasesErrorCode.NetworkError (Android), code 10
Where Purchases SDK (iOS, Android and the hybrid SDKs built on them)
What the vendor says A network error has occurred.

Cause#

  • iOS: any URLSession failure other than "not connected to the Internet" (which becomes offlineConnectionError) maps here.
  • Android: an IOException or JSONException while performing the request, and Play Billing NETWORK_ERROR.
  • A wrong proxy URL: a typo, http instead of https, a missing port, or localhost on an Android emulator, where localhost is the emulator itself.

Fix#

  1. Retry after a short wait and back off if it fails again.
  2. Set the proxy URL before configure. On an Android emulator use http://10.0.2.2:8787 for a server on your computer, or HTTPS.
  3. On iOS, call PurchasesDiagnostics.default.testSDKHealth() to see whether the SDK can reach the server.
  4. Read the underlying error: on iOS NSUnderlyingErrorKey holds the URLError with the real reason.

Example#

Swift
// The purchases SDK throws `ErrorCode` values; match the one you handle and let the rest fall through.
func handle(_ error: Error) {
    guard let code = error as? ErrorCode else {
        print("Not a purchases SDK error: \(error)")
        return
    }
    switch code {
    case .networkError:
        // Retrying is safe: the SDK keeps unposted purchases and sends them again later.
        print("Network problem; try again soon")
    default:
        print("Other purchases error: \(code.description)")
    }
}

Compile-checked: npm run check:snippets type-checks this snippet with swiftc together with the ErrorCode.swift file of the RevenueDot purchases-ios fork (checked 2026-10-03).

How the RevenueDot SDK reports it#

If RevenueDot is unreachable the SDK sees a connection error; if it answers 5xx the SDK keeps the transaction and retries. Deep dive: revenuedot.app/errors/network-error.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated