SDK error · code 35

offlineConnectionError (error code 35): Offline connection

What it means

offlineConnectionError (code 35) means the device is offline: the request failed with the system's "not connected to the Internet" error. It differs from networkError, which covers every other network failure. Show an offline message, retry when the connection returns, and rely on cached customer info so paying customers keep access. Android reports the same situation as NetworkError.

Code

35

iOS (Swift)

ErrorCode.offlineConnectionError

Android (Kotlin)

No matching code in the Android SDK; see the causes below.

Causes

Why the SDK returns offlineConnectionError

  • iOS: a request failed with NSURLErrorNotConnectedToInternet, which Apple describes as a request made when an internet connection has not been established and cannot be established automatically (Apple docs). The SDK maps it to this error (NetworkError.swift).
  • Airplane mode, no signal, or Wi-Fi without internet.
  • Cellular data blocked for your app in the device settings.
  • Android has no member for this code. The same situation raises an IOException, which becomes NetworkError.

Fix

How to fix offlineConnectionError

  1. 01

    Show an offline state

    Tell the customer they are offline, and keep the app usable with cached data.

  2. 02

    Retry when the network returns

    Use your platform's reachability callback to retry offerings or customer info when the connection comes back.

  3. 03

    Keep using cached customer info

    The SDK caches customer info. Keep gating features on the entitlement state it already has instead of blocking the app.

  4. 04

    Check app network permissions

    On iOS, check that cellular data is allowed for the app in Settings.

In your app

How to handle it in code

  • Retrying works once the connection returns. Do not retry in a tight loop while offline.
  • Tell the customer "You appear to be offline". It is accurate and they can act on it.
  • Do not grant access from the error. Use the cached entitlement state, which the SDK keeps.
Match the errorSwift
// Swift
do {
  let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .offlineConnectionError {
  // handle offline connection
}

On RevenueDot: A device that is offline never reaches RevenueDot. Customers who already paid keep the access the SDK cached. When the device is online and RevenueDot answers 5xx, the SDK computes access on the device. See offline entitlements.

FAQ

offlineConnectionError: questions people ask

What is the difference between offlineConnectionError and networkError?

offlineConnectionError means the system said the device is not connected to the Internet. networkError covers every other network failure, such as timeouts and unreachable hosts.

Will offline customers lose access?

No. The SDK serves cached customer info, and unposted purchases stay on the device until the SDK can send them.

How do I check for offlineConnectionError in React Native and Flutter?

In React Native, compare error.code with PURCHASES_ERROR_CODE.OFFLINE_CONNECTION_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.offlineConnectionError.

Get started

Keep the RevenueCat SDK. Change the backend.

RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.

Already have an account? Sign in · Prefer your own servers? Self-host free