Reference

Mobile SDK contract

Results, events, failure codes, options and security defaults shared by every mobile SDK.

View as Markdown

Android, iOS, React Native and Flutter implement the same contract, and each SDK is tested against it. These tables are generated from that shared definition, so they match every SDK.

Results

ResultFieldsWhen
completedsession_id, statuscomplete event received
cancelledsession_id?user closed the flow (✕, back → confirm, swipe down) or exit event
failedcode, message, session_id?the flow could not run or continue

Events

EventWhenPayloadMobile SDKs
readyThe flow loaded and the session is ready.status: session statusdelivered
step_startedA step was shown for the first time.step: step keydelivered
step_completedA step was completed.step: step keydelivered
completeThe applicant finished; the SDK returns completed and closes after the auto-close delay.status: approved | declined | review | processing | expired | cancelleddelivered
errorA recoverable error happened inside the flow (the flow keeps running).step: step key (optional)
code: error code
delivered
exitThe flow asked to close; the SDK returns cancelled.—delivered
resizeWeb embeds only; mobile SDKs ignore it.height: pxignored

Failure codes

CodeMeaningAndroidiOSReact NativeFlutter
invalid_configMissing or malformed session URL or configuration.✓✓✓✓
load_failedThe flow page failed to load (HTTP error or blank page).✓✓✓✓
network_errorNo connection or DNS/TLS failure while loading.✓✓✓✓
navigation_blockedRepeated navigation to non-allowlisted hosts.✓✓✓✓
permission_deniedThe camera permission was permanently denied and the flow cannot continue.✓✓✓✓
flow_errorThe flow reported an unrecoverable error.✓✓✓✓
webview_unavailableThe WebView renderer crashed or is unavailable.✓✓✓—
presentation_failedNo view controller was available to present the flow.—✓——

Configuration

Contract names are snake_case; each SDK exposes them in its language's naming.

Contract nameAndroidiOSReact NativeFlutterTypeDefaultDescription
session_urlsessionUrlsessionURLsessionUrlsessionUrlstringrequiredThe url returned by POST /v1/sessions. Never embed a secret API key in an app.
localelocalelocalelocalelocalestringnullFlow language (en, hi); must be one of the workflow's languages. Sent as ?locale=.
themethemethemethemethemelight | dark | system"system"Colour scheme of the flow. Sent as ?theme=.
allowed_hostsallowedHostsallowedHostsallowedHostsallowedHostsstring[][]Extra hosts the WebView may load (self-hosting).
block_screenshotsblockScreenshotsblockScreenshotsblockScreenshotsblockScreenshotsbooleantrueAndroid: FLAG_SECURE. iOS: cover the flow in the app switcher and while the screen is recorded.
auto_close_delayautoCloseDelayautoCloseDelayautoCloseDelayautoCloseDelayduration_ms2000 msHow long the result screen stays visible after complete before the SDK closes and returns completed. 0 or null = return the result immediately (no result screen).

Platform-only options: Android: title; iOS: presentation; React Native: none; Flutter: confirmExit, title.

Bridges and messages

Protocol version 1. The flow sends JSON strings with the fields source, v, type, sessionId, payload, where source is okyc and v is 1. Messages larger than 10,240 bytes are dropped. Payload rule: ids and statuses only — never personal data.

PlatformBridgeNameMethod
Androidjavascript_interfaceOkycAndroidpostMessage
iOSscript_message_handlerokyc—
React Nativereact_native_webviewReactNativeWebView—
Flutterjavascript_channelOkycFlutter—
  • Loads inside the WebView: <flow origin>, <allowed_hosts>, and DigiLocker (digilocker.meripehchaan.gov.in, *.digilocker.gov.in, api.digitallocker.gov.in) so its sign-in returns to the flow.
  • Other http(s) links: open in the system browser.
  • Other schemes (file:, intent:, javascript: …): blocked.
  • locale is sent as ?locale=, theme is sent as ?theme=, before the fragment.
  • Session token: URL fragment #t= — never sent to servers, never logged.

Security

  • JavaScript and DOM storage on; no file:// access; no mixed content; no third-party cookies
  • WebView debugging only in debug builds
  • Camera/microphone granted to the WebView only for the flow origin, after OS permission
  • Clear cookies, cache and storage for the flow origin when the flow ends
  • Never log the session URL

On this page