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.

Offline Mode was added in SDK version 10.1.0 on Android and iOS

Enabling Offline Mode

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

SmileID.setAllowOfflineMode(true)

To disable Offline Mode, simply call the method passing false instead

If you want to enable Offline Mode for a single job, simply enable it before the job and disable it once completed

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.

SmileID.submitJob(jobId)

Helper Functions

Listing Jobs awaiting API submission

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

SmileID.getUnsubmittedJobs()

Listing Submitted Jobs

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

SmileID.getSubmittedJobs()

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 (Checking Job Status)

File Cleanup

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

SmileID.cleanup(jobId)

Use this in conjunction with getUnsubmittedJobs and getSubmittedJobs above

Last updated