showFaceMatcherLivenessPrompt

suspend fun PromptModel.showFaceMatcherLivenessPrompt(matcher: FaceMatcher, poses: List<FacePose> = listOf(FacePose.FRONT), reason: Reason = FaceLivenessReason, requireConfirmation: Boolean = false): Map<FacePose, ByteString>?

Prompts user to verify liveness and capture portrait photos for the specified poses using matcher.

Return

a map of captured portrait image bytes keyed by FacePose if liveness verification succeeded, or null if dismissed, failed, or cancelled.

Parameters

matcher

the FaceMatcher to use for liveness verification and portrait capture.

poses

ordered list of FacePoses to capture during the session. Defaults to [FacePose.FRONT].

reason

the Reason describing why face liveness verification is being requested. Defaults to FaceLivenessReason.

requireConfirmation

set to true to require explicit user confirmation after liveness verification succeeds.

Throws

if matcher does not support liveness detection.

if coroutineContext does not have PromptModel.

if the UI layer hasn't bound any UI for PromptModel.