FaceMatcherLivenessSession

abstract class FaceMatcherLivenessSession(val poses: List<FacePose> = listOf(FacePose.FRONT))

Session driving the interactive face liveness verification and photo capture UI.

A fresh session instance is created per liveness attempt via FaceMatcher.createLivenessSession. It directly controls the messages above and below the camera preview, the overlay, and verification status.

Constructors

Link copied to clipboard
constructor(poses: List<FacePose> = listOf(FacePose.FRONT))

Properties

Link copied to clipboard
protected val _state: MutableStateFlow<FaceMatcherLivenessPromptState>
Link copied to clipboard

ordered list of FacePoses to capture during the session. Must not be empty.

Link copied to clipboard

Observable reactive state stream consumed by UI dialogs.

Functions

Link copied to clipboard
open fun cancel()

Cancels the liveness session and releases any associated resources.

Link copied to clipboard
open suspend fun feedFrame(frame: CameraFrame)

Feeds a camera frame captured from the front camera into the liveness session.

Link copied to clipboard
open fun onTouchEvent(x: Float, y: Float)

Pushes a touch or tap event within the camera preview into the session.

Link copied to clipboard
protected fun updateState(message: String? = _state.value.message, status: FaceMatcherLivenessPromptState.Status = _state.value.status, overlay: OverlayFrame? = _state.value.overlay, capturedImages: Map<FacePose, ByteString> = _state.value.capturedImages, backgroundColor: Color? = _state.value.backgroundColor)

Atomically updates the prompt UI state.