> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Offline Mode

> Learn how the Mobile SDK handles network interruptions and enters offline mode in the mobile SDK

Quick summary

The Mobile SDK has an offline mode to keep your application working during network problems. When the SDK enters offline mode, it continues to record and store audio securely on the device, saves all session events, and automatically uploads everything when the connection returns.

The SDK uses a **15-second buffer** to handle temporary connection problems before switching to offline mode. This gives you time to show a notification in your UI before the session goes fully offline.

Last updated:
November 2026

The **Mobile SDK** has an **offline** mode to keep your application working during network problems. This ensures a session is not interrupted if the device loses its internet connection.

You will:

* Handle network interruptions with offline mode.
* Use the network buffer feature before the session goes fully offline.
* Identify common causes for offline mode.

## What happens in offline mode

When the SDK enters **offline** mode, it handles everything in the background so the user is not interrupted. The SDK will:

* Continue to record and store audio securely on the device.

* Save all session events that happen during the outage.

* Automatically upload all saved audio and events when the connection returns.

The SDK notifies your app about these status changes using **session delegate** events.

### Network buffer feature

Before, the SDK used to directly jump into offline mode when it detected a small network issue. This was not ideal as it would interrupt the user experience.

To address this, the mobile SDK uses a **15-second buffer** to handle temporary connection problems. This gives you time to show a notification in your UI, like **Connection unstable**, before the session goes fully offline. This is important to ensure a smooth user experience.

## Common causes for offline mode

A session can enter **offline** mode for several reasons:

* Poor or lost Wi-Fi or cellular connectivity.

* The device switches between networks (e.g., Wi-Fi to cellular).

* A temporary problem with the backend service.

* A dropped connection while streaming audio.

* An issue with an authentication token.

### Create session failures without offline fallback

Not every `createSession` failure creates an offline session.

If the backend returns `FAILED_PRECONDITION` or `INVALID_ARGUMENT` as a `SukiStatus` (typically codes `9` and `3`), the Mobile SDK returns the error and does **not** fall back to offline. Fix the request, then retry `createSession` online.

Other `createSession` failures can still follow the existing offline workflow. For more information, refer to [Create ambient session](https://developer.suki.ai/mobile-sdk/ambient-guides/create-session.md) and [Ambient interoperability](https://developer.suki.ai/mobile-sdk/ambient-guides/ambient-interoperability.md).

> [!TIP]
>
> **Important notes**
>
> Keep the following key features of **offline** mode in mind:
>
> * The SDK manages all transitions between **offline** and **online** modes automatically.
>
> * Audio quality and session integrity are always maintained.
>
> * The SDK can **queue multiple offline** sessions and will upload them in order once a connection is available. For the same encounter key, older sessions upload first (for example a queued Form filling session before a later Ambient session on that appointment).
>
> * All data stored locally on the device is encrypted and secure.
>
> * Offline recording is optimized to conserve battery life.

## Offline sessions for the same encounter

The Mobile SDK groups offline work by encounter. If the device still has an unfinished offline session for an encounter, the next **`createSession`** for that same encounter also starts offline. The new session joins the offline queue instead of trying to create online first.

For Form filling, that encounter key is the **`correlationId`** you pass on create (your appointment or encounter id). Use the same **`correlationId`** for every Form filling create that belongs to that visit. When the network returns, the SDK uploads queued sessions for that encounter **oldest first**.

![Flowchart: createSession for an encounter, Unfinished offline session already on device for that key?, Create online when the network allows, Start this session offline too, Queue audio and events locally, Upload oldest session first when the network returns.](https://mintcdn.com/suki-1e08f176/YIYDyOdjNGc_pP0v/documentation/assets/diagrams/mobile-sdk-ambient-guides-offline-mode-1-light.svg?fit=max\&auto=format\&n=YIYDyOdjNGc_pP0v\&q=85\&s=f89ff65221b258ec136e7b647610363d)

```mermaid actions={false} theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
%%{init: {'theme':'base', 'themeVariables': { 'primaryColor':'#FFF394','primaryTextColor':'#111827','primaryBorderColor':'#FFE148','lineColor':'#FFE148','secondaryColor':'#FFE148','tertiaryColor':'#FFFADE','mainBkg':'#FFF394','secondBkg':'#FFFADE','tertiaryBorderColor':'#FFE148','border1':'#FFE148','border2':'#FFE148','arrowheadColor':'#FFE148','fontFamily':'Inter, system-ui, sans-serif','fontSize':'14px','nodeBorder':'#FFE148','edgeLabelBackground':'#FFE148','clusterBkg':'#FFFADE','clusterBorder':'#FFE148','defaultLinkColor':'#FFE148','titleColor':'#111827','nodeTextColor':'#111827'}}}%%
flowchart TD
    A[createSession for an encounter] --> B{Unfinished offline session<br/>already on device for that key?}
    B -->|No| C[Create online when the network allows]
    B -->|Yes| D[Start this session offline too]
    D --> E[Queue audio and events locally]
    E --> F[Upload oldest session first<br/>when the network returns]

    style A fill:#FFF394,stroke:#FFE148,stroke-width:2px,color:#111827
    style B fill:#FFE148,stroke:#FFE148,stroke-width:2px,color:#111827
    style C fill:#FFF394,stroke:#FFE148,stroke-width:2px,color:#111827
    style D fill:#FFF394,stroke:#FFE148,stroke-width:2px,color:#111827
    style E fill:#FFF394,stroke:#FFE148,stroke-width:2px,color:#111827
    style F fill:#FFF394,stroke:#FFE148,stroke-width:2px,color:#111827
```

For Form filling create options and offline details, refer to [Create Form filling session](https://developer.suki.ai/mobile-sdk/form-filling/create-form-filling-session.md) and [Set context and retrieve results](https://developer.suki.ai/mobile-sdk/form-filling/form-filling-context-and-results.md#offline).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.