createLivenessSession

open fun createLivenessSession(poses: List<FacePose> = listOf(FacePose.FRONT)): FaceMatcherLivenessSession

Creates a new FaceMatcherLivenessSession driving an interactive session to check user liveness and capture a verified portrait photo of the subject.

The normal way to use this function is through the prompt machinery via org.multipaz.prompt.showFaceMatcherLivenessPrompt.

Unlike createSession, this flow operates without a reference portrait and is typically used during user onboarding, credential issuance, or provisioning flows where a fresh, verified live portrait photo must be captured from the user.

The implementation is required to verify that the subject in front of the camera is a live human being (e.g. through active challenge interactions, blink or head-turn detection, or passive presentation attack detection) and capture still portrait photos of the live subject for each requested pose in poses in that order. The captured portraits are returned in FaceMatcherLivenessPromptState.capturedImages when the session transitions to FaceMatcherLivenessPromptState.Status.SUCCESS.

Like matching sessions, the implementation communicates with the user throughout the interaction by calling FaceMatcherLivenessSession.updateState to provide instructions, challenge prompts, and dynamic visual overlays.

Return

a new FaceMatcherLivenessSession instance for this liveness verification and capture session.

Parameters

poses

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

Throws

if this matcher does not support liveness detection (supportsLiveness is false).