Start View
FaceLivenessDetectorView contains an initial (start) view with instructions and information about the Face Liveness check for the end user. By default, the start view is shown before the Face Liveness check. The start view can be disabled, allowing you to provide your own start view before FaceLivenessDetectorView is displayed in the app:
FaceLivenessDetectorView(
sessionID: <session ID>,
region: <region>,
disableStartView: true,
isPresented: $isPresentingLiveness,
onCompletion: { result in
switch result {
case .success:
// ...
case .failure(let error):
// ...
default:
// ...
}
}
)
Challenge Options
Certain liveness challenges have client-side options that you can configure based on your business requirements. For example, you can configure the FaceMovement
challenge to use either the device's front-facing camera or back-facing camera.
FaceLivenessDetectorView(
sessionID: <session ID>,
region: <region>,
challengeOptions: .init(faceMovementChallengeOption: .init(camera: .back)),
isPresented: $isPresentingLiveness,
onCompletion: { result in
switch result {
case .success:
// ...
case .failure(let error):
// ...
default:
// ...
}
}
)
When the FaceLivenessDetector is rendered, Rekognition will mark the session ID as used and any future usages of the FaceLivenessDector will require a new session ID. So if you want to change which camera is used for the FaceMovement challenge at runtime, you will need to create a new liveness session and pass the new session ID into the FaceLivenessDetector with the new Camera option.
Internationalization (I18n)
The text in FaceLivenessDetectorView is defined as string resources in the component's Localizable.strings file. These values can be translated/overwritten by following the instructions here.
Best Practices
- The get ready screen has been optimized for increasing the end user's success rate and we strongly discourage making any changes to that screen.
- We do not recommend modifying the countdown time, face fit timeout, and oval size, as they affect the security and accuracy of the Face Liveness check.