Skip to main content

Feedback and localization

The predefined UI can show geometry, pose, and V3 lighting guidance without enabling debug mode.

Show feedback in production​

let style = MBUIOptions(
showProgressBar: true,
showFaceStatusLabel: true,
showCountdownTimerLabel: true
)

let options = MBCaptureSessionOptions(
isDebugging: false,
captureConstraints: .v3
)

isDebugging controls diagnostics. The MBUIOptions visibility properties control the user-facing interface.

Customize V3 messages​

let faceTexts = MBFaceStatusTexts(
faceTooFarAway: "Move closer",
faceTooClose: "Move farther away",
facePoseInvalid: "Look straight at the camera",
checkingLighting: "Checking the light",
unevenLighting: "Use more even lighting",
insufficientLight: "Move to a brighter area"
)

let localizations = MBTextLocalizations(
countdownLabelText: "Hold still",
faceStatusTexts: faceTexts
)

let style = MBUIOptions(
showFaceStatusLabel: true,
showCountdownTimerLabel: true,
textLocalizations: localizations
)

Available face messages​

PropertyDefault textUsed for
faceTooFarAwayFace too far awayDistance
faceTooCloseFace too closeDistance
faceTooFarUpFace too far upPosition
faceTooFarDownFace too far downPosition
faceTooFarLeftFace too far leftPosition
faceTooFarRightFace too far rightPosition
faceNotFoundFace not foundDetection
tooManyFacesToo many facesDetection
validFaceValid faceValid state
facePoseInvalidLook straight aheadV2 and V3 pose
checkingLightingChecking lightingV3 lighting pending
unevenLightingFind more even lightingV3 uneven lighting
insufficientLightFind more lightV3 insufficient light

Customize the camera permission alert​

let permissionAlert = MBCameraPermissionAlert(
title: "Camera access required",
message: "Enable camera access in Settings to continue.",
settingText: "Open Settings",
cancelText: "Cancel"
)

let localizations = MBTextLocalizations(
cameraPermissionAlert: permissionAlert
)

Keep instructions short and actionable. When several checks fail, guide the user through geometry first and lighting second.