Read the result
With the ready-made screen the result view is free: a green or red banner, a large portrait for face matching, the fields, the checks that ran and “Last established” for revocation.
If you drive the check yourself, the session reports states and finishes with an AcceptanceResult:
package samples
import com.wallet.WalletSdkimport com.wallet.model.AcceptanceDecisionimport com.wallet.model.AcceptanceResultimport com.wallet.model.VerificationStateimport kotlinx.coroutines.flow.collect
/** Driving a check yourself instead of using the screen: start, connect with the scanned QR, read the result. */class ReadResult(private val sdk: WalletSdk) { suspend fun run(scannedQrText: String, show: (String) -> Unit, onDone: (AcceptanceResult) -> Unit) { val session = sdk.verifier.startReaderSession(Checks.AGE_18.request) session.connect(scannedQrText) session.state.collect { state -> when (state) { is VerificationState.Done -> { when (state.result.decision) { AcceptanceDecision.ACCEPT -> show("Accepted") AcceptanceDecision.REJECT -> show("Rejected: ${state.result.reason}") AcceptanceDecision.INCONCLUSIVE -> show("Check again online: ${state.result.reason}") } onDone(state.result) } is VerificationState.Failed -> show("Failed: ${state.error.message}") else -> show("Working…") // AwaitingEngagement, Connecting, Verifying } } }}import Wallet
/// Driving a check yourself instead of using the screen: start, connect with the scanned QR, read the result.final class ReadResult { private let sdk: WalletSdk init(sdk: WalletSdk) { self.sdk = sdk }
func run(scannedQrText: String, show: @escaping (String) -> Void, onDone: @escaping (AcceptanceResult) -> Void) async throws { let session = sdk.verifier.startReaderSession(request: Checks.age18.request) session.connect(engagementQr: scannedQrText) try await session.state.collect(collector: Collector<VerificationState> { state in switch state { case let done as VerificationStateDone: switch done.result.decision { case .accept: show("Accepted") case .reject: show("Rejected: \(done.result.reason ?? "")") default: show("Check again online: \(done.result.reason ?? "")") // INCONCLUSIVE } onDone(done.result) case let failed as VerificationStateFailed: show("Failed: \(failed.error.message)") default: show("Working…") // AwaitingEngagement, Connecting, Verifying } }) }}The session’s states are a Kotlin flow; Collector is a five-line Swift adapter, in the same sample folder.
The result object
Section titled “The result object”| Field | Meaning |
|---|---|
decision |
ACCEPT, REJECT or INCONCLUSIVE |
disclosedClaims |
the fields, for example family_name → "Hakim" |
portrait |
the photo bytes, if released |
issuerName |
who issued it (from the document, or your issuerDisplayNames) |
signatureValid, issuerTrusted, withinValidityWindow |
the checks behind the decision |
revocation, revocationDataStale, revocationCheckedAt |
revocation status and how current it is |
reason |
why it was rejected or inconclusive |
Every decision and reason is listed in Errors and states.
Offline
Section titled “Offline”The check itself needs no network. Revocation uses the last downloaded status; the result says how old that answer is. Policies and details: Work offline.
Next: Go live.