Session Management
Manage verification session lifecycle, state, and timeouts.
Session Lifecycle
Each verification begins with creating a session, which progresses through several states:
CREATED→WAITING_FOR_ENGAGEMENT→PROCESSING_ENGAGEMENT→VERIFYING→COMPLETED
↘ FAILED or CANCELLED
| State | Description |
|---|---|
CREATED | Session created, ready to display QR or start NFC/BLE |
WAITING_FOR_ENGAGEMENT | Waiting for holder to respond (scan QR, tap NFC, connect BLE) |
PROCESSING_ENGAGEMENT | Processing the holder's device engagement |
VERIFYING | Validating credentials with Owl Eyes API |
COMPLETED | Verification finished successfully |
FAILED | Verification failed (see error for details) |
CANCELLED | Session 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...