Session Management

Manage verification session lifecycle, state, and timeouts.

Session Lifecycle

Each verification begins with creating a session, which progresses through several states:

CREATEDWAITING_FOR_ENGAGEMENTPROCESSING_ENGAGEMENTVERIFYINGCOMPLETED
FAILED or CANCELLED
StateDescription
CREATEDSession created, ready to display QR or start NFC/BLE
WAITING_FOR_ENGAGEMENTWaiting for holder to respond (scan QR, tap NFC, connect BLE)
PROCESSING_ENGAGEMENTProcessing the holder's device engagement
VERIFYINGValidating credentials with Owl Eyes API
COMPLETEDVerification finished successfully
FAILEDVerification failed (see error for details)
CANCELLEDSession was cancelled by the app

Session Properties

The MDLSession object provides access to session information and state:

SessionProperties.ktkotlin
Loading...

Observing Session State

Use Kotlin Flows to reactively observe session state changes:

ObservingState.ktkotlin
Loading...

Observing Results

ObservingResults.ktkotlin
Loading...

Session Timeouts

Sessions have a configurable timeout. After expiration, the session can no longer accept responses.

Configure Timeout

ConfigureTimeout.ktkotlin
Loading...

Display Remaining Time

DisplayTimer.ktkotlin
Loading...

Cancelling Sessions

Cancel a session when the user navigates away or wants to start over:

CancellingSession.ktkotlin
Loading...

Refreshing Session State

If needed, you can refresh the session state from the server:

RefreshSession.ktkotlin
Loading...

SDK Events

Subscribe to SDK-wide events for detailed progress information:

SDKEvents.ktkotlin
Loading...

Best Practices

Initialize Early

MyApplication.ktkotlin
Loading...

Handle Configuration Changes

VerificationViewModel.ktkotlin
Loading...

Cleanup Resources

Cleanup.ktkotlin
Loading...