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
URLSessionfailure other than "not connected to the Internet" (which becomesofflineConnectionError) maps here. - Android: an
IOExceptionorJSONExceptionwhile performing the request, and Play BillingNETWORK_ERROR. - A wrong proxy URL: a typo,
httpinstead ofhttps, a missing port, orlocalhoston an Android emulator, wherelocalhostis the emulator itself.
Fix#
- Retry after a short wait and back off if it fails again.
- Set the proxy URL before
configure. On an Android emulator usehttp://10.0.2.2:8787for a server on your computer, or HTTPS. - On iOS, call
PurchasesDiagnostics.default.testSDKHealth()to see whether the SDK can reach the server. - Read the underlying error: on iOS
NSUnderlyingErrorKeyholds theURLErrorwith 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.
Related#
- What does Play Billing NETWORK_ERROR (12) mean?
- What does StoreKitError.networkError mean?
- What does offlineConnectionError (code 35) mean in the purchases SDK?
- What RevenueDot's API errors mean (server codes)
Source#
- RevenueDot purchases-ios: ErrorCode.swift (the iOS ErrorCode enum)
- RevenueDot purchases-android: PurchasesErrorCode.kt (the Android enum)
- RevenueDot purchases-android: common/errors.kt (backend code mapping)
- RevenueDot purchases-android: google/errors.kt (Play Billing mapping)
Checked: 2026-10-03