> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/mobile/offline-mode.md).

# Offline Mode

To deal with situations where network connectivity may be limited or unavailable, we provide an Offline Mode. This allows a job to be saved locally so that it can be submitted later once network connectivity is restored.

When Offline Mode is enabled and an API request encounters a connectivity issue, the UI will *not* show an error message. Instead, it will appear as a successful operation.

{% hint style="info" %}
Offline Mode was added in SDK version 10.1.0 on Android and iOS
{% endhint %}

## Enabling Offline Mode

Offline mode must be explicitly enabled. This setting will apply to all jobs.

{% tabs %}
{% tab title="Android" %}

```kotlin
SmileID.setAllowOfflineMode(true)
```

{% endtab %}

{% tab title="iOS" %}

```swift
SmileID.setAllowOfflineMode(allowOfflineMode: true)
```

{% endtab %}

{% tab title="Flutter" %}

```dart
SmileID.setAllowOfflineMode(allowOfflineMode: true);
```

{% endtab %}

{% tab title="React Native" %}

```typescript
SmileID.setAllowOfflineMode(true);
```

{% endtab %}

{% tab title="React Native Expo" %}

```typescript
setAllowOfflineMode(true);
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
To disable Offline Mode, simply call the method passing `false` instead
{% endhint %}

{% hint style="info" %}
If you want to enable Offline Mode for a single job, simply enable it before the job and disable it once completed
{% endhint %}

## Submitting an Offline Job

Once network connectivity is restored, a job previously saved in Offline Mode can be submitted to the backend for processing. A job is identified by its `jobId`, so it is important to save it once a job completes in Offline Mode.

{% tabs %}
{% tab title="Android" %}

```kotlin
SmileID.submitJob(jobId)
```

{% endtab %}

{% tab title="iOS" %}

```swift
SmileID.submitJob(jobId: jobId)
```

{% endtab %}

{% tab title="Flutter" %}

```dart
SmileID.submitJob(jobId, true);
```

{% endtab %}

{% tab title="React Native" %}

```typescript
SmileID.submitJob(jobId);
```

{% endtab %}

{% tab title="React Native Expo" %}

```typescript
submitJob(jobId);
```

{% endtab %}
{% endtabs %}

## Helper Functions

### Listing Jobs awaiting API submission

Returns a list of job IDs that have not yet been submitted to the backend

{% tabs %}
{% tab title="Android" %}

```kotlin
SmileID.getUnsubmittedJobs()
```

{% endtab %}

{% tab title="iOS" %}

```swift
SmileID.getUnsubmittedJobs()
```

{% endtab %}

{% tab title="Flutter" %}

```dart
SmileID.getUnsubmittedJobs()
```

{% endtab %}

{% tab title="React Native" %}

```typescript
SmileID.getUnsubmittedJobs();
```

{% endtab %}

{% tab title="React Native Expo" %}

```typescript
getUnsubmittedJobs();
```

{% endtab %}
{% endtabs %}

### Listing Submitted Jobs

Returns a list of Job IDs that have been submitted to the backend for processing

{% tabs %}
{% tab title="Android" %}

```kotlin
SmileID.getSubmittedJobs()
```

{% endtab %}

{% tab title="iOS" %}

```swift
SmileID.getSubmittedJobs()
```

{% endtab %}

{% tab title="Flutter" %}

```dart
SmileID.getSubmittedJobs()
```

{% endtab %}

{% tab title="React Native" %}

```typescript
SmileID.getSubmittedJobs();
```

{% endtab %}

{% tab title="React Native Expo" %}

```typescript
getSubmittedJobs();
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Job processing is asynchronous, so it is possible that a job has been submitted but is still being processed by the backend. Use the job polling helper methods to determine when processing is complete ([Getting Started](/integration-options/mobile/getting-started.md#checking-job-status))
{% endhint %}

### File Cleanup

This will cleanup the supporting files for a job (selfies and document captures)

{% tabs %}
{% tab title="Android" %}

```kotlin
SmileID.cleanup(jobId)
```

{% endtab %}

{% tab title="iOS" %}

```swift
SmileID.cleanup(jobId: jobId)
```

{% endtab %}

{% tab title="Flutter" %}

```dart
SmileID.cleanup(jobId)
```

{% endtab %}

{% tab title="React Native" %}

```typescript
SmileID.cleanup(jobId);
```

{% endtab %}

{% tab title="React Native Expo" %}

```typescript
cleanup(jobId);
```

{% endtab %}
{% endtabs %}

**Cleanup multiple jobs at once (Flutter)**

```dart
SmileID.cleanupJobs([jobId1, jobId2, jobId3]);
```

{% hint style="info" %}
Use this in conjunction with `getUnsubmittedJobs` and `getSubmittedJobs` above
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/mobile/offline-mode.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
