Amplify UI

Customization

Customize your FaceLivenessDetector

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

  1. 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.
  2. 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.

Amplify open source software, documentation and community are supported by Amazon Web Services.

© 2025 Amazon Web Services, Inc. and its affiliates. All rights reserved. View the site terms and privacy policy.

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.