VerificationResult is a sealed interface, so when used as an expression is checked by
the compiler.
Every case carries transactionId, code and message, so result.transactionId reads
the id without a when when that is all you need. It is a kotlin.uuid.Uuid?, still an
experimental API, so the file that touches it needs:
The callback always runs on the main thread.
Completed does not mean approved
It means the user finished the flow successfully. The actual verdict is produced afterwards and delivered to your backend through a webhook, usually within seconds.
Show something like “We’re reviewing your document” on Completed, and update the user
once your backend receives the webhook. A success screen here will be wrong for every
user who is later rejected.
Keeping the result across process death
VerificationResult is not Parcelable, so it cannot go into rememberSaveable or
onSaveInstanceState.
Persist the transaction id as a String and re-derive the rest, or let your backend be the
source of truth once the flow has completed:
Error codes
VerificationResultCode is an enum:
Always keep an else -> branch when matching on the code. The enum is compiled into
your app: a newer SDK can return a value your build has never seen, and an exhaustive
when without else throws NoWhenBranchMatchedException at runtime rather than
failing to compile.
Troubleshooting