AWS Rekognition Face Liveness Plugin for Flutter

pub package

A Flutter plugin for AWS Rekognition Face Liveness detection, allowing secure face biometric verification using AWS's Rekognition service. This package provides a bridge to the native AWS Amplify Face Liveness SDKs for both Android and iOS.

Features

  • Perform face liveness detection using AWS Rekognition
  • Native integration with AWS Amplify Face Liveness SDKs
  • Support for both iOS and Android platforms
  • Simple Flutter widget interface for easy integration
  • Uses AWS Amplify for authentication and credentials

Requirements

  • AWS account with Rekognition access
  • AWS Amplify configuration for authentication
  • Backend service to create Face Liveness sessions

Getting Started

Installation

Add this package to your pubspec.yaml:

dependencies:
  face_liveness_detector: ^0.1.0

⚙️ Setup PreRequisite

Before using the package, you need to configure Amplify in your project. Follow these steps:

1️⃣ Set Up Amplify

Complete the Amplify Quickstart and Step 1: Configure Auth before proceeding.

2️⃣ Configure Authentication

Android

  1. Add the Amplify configuration file to your project:
    • Place amplifyconfiguration.json in android/app/src/main/res/raw/

Update android/app/build.gradle:

android { compileSdkVersion 35

defaultConfig {
    minSdkVersion 24
}

} Ensure that the MainActivity class extends FlutterFragmentActivity instead of FlutterActivity: import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity : FlutterFragmentActivity() {}

####iOS Add the Amplify configuration files to your project:

Place amplifyconfiguration.json and awsconfiguration.json in the ios directory. Open Xcode and manually add these files to your project to ensure they are recognized.

Update your ios/Podfile:

platform :ios, '13.0' use_frameworks! Run: cd ios pod install cd .. 3️⃣ Grant Camera Permissions Ensure you request camera access in both platforms:

Android Add the following permission in AndroidManifest.xml: