LivenessCamera SDK Guide

Platform Support

Android iOS
✔️ ✔️



Add three rows to the ios/Runner/Info.plist:

  • one with the key Privacy - Camera Usage Description and a usage description.
  • one with the key Privacy - Microphone Usage Description and a usage description.

Editing Info.plist as text, add:

  <string>Camera Access</string>
  <string>Microphone Access</string>


Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

  minSdkVersion 21


You can use LivenessCamera SDK to detection step of your e-KYC flow. This works both on Android and iOS.

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intp_flutter_liveness_sdk/intp_flutter_liveness_sdk.dart';

Future<void> main() async {
  runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
      home: const MyHomePage(title: 'Liveness detection'),

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  State<MyHomePage> createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Future<String?> buildDialog(Map<String, dynamic> value) {
    debugPrint("_buildDialog: $value");

    String content = "Detection failed !!!";

    if (value['Liveness'] != null && value['Liveness']['detectSuccess']) {
      content = "Detection success !!!";

    if (value['statusCode'] != null && value['statusCode'] != 200) {
      content = "Error : $value";

    return showDialog<String>(
      context: context,
      builder: (BuildContext context) => AlertDialog(
        title: const Text('Result'),
        content: Text(content),
        actions: <Widget>[
            onPressed: () => Navigator.pop(context, 'OK'),
            child: const Text('OK'),

  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      body: SafeArea(
        child: LivenessCamera(
          livenessResponse: (Map<String, dynamic> value) {
            // handle your next event or navigation from below
          endpoint: "API_ENDPOINT",
          apiKey: "API_KEY",
          transactionId: "TRANSACTION_ID",
          // actionsInstruction: const {
          //   'SHAKE_LEFT': 'New caption turn your head left',
          //   'SHAKE_RIGHT': 'New caption turn your head right',
          //   'NOD_HEAD': "New caption nod your head",
          //   'MOUTH': "New caption open your mouth",
          // },
          // numberOfActions: 2,
          // numberOfRetry: 1,
          // backgroundColor:,
          // fontFamily: "Kanit-Regular", /* Load font from assets */


Available options in LivenessCamera

Property Type Status Default Description
livenessResponse Function required Receiving function for liveness result
endpoint String required The API endpoint
apiKey String required The API key generated from Finema for the customer to use
transactionId String required The transaction id generated from Finema for the customer to use
actionsInstruction Map<String, dynamic> optional
'SHAKE_LEFT': 'Turn your head left',
'SHAKE_RIGHT': 'Turn your head right',
'NOD_HEAD': 'Nod your head',
'MOUTH': 'Open your mouth',
Custom text instruction each action
numberOfActions Int optional 1 The number of randomised action out of 4 actions ['SHAKE_LEFT', 'SHAKE_RIGHT', 'NOD_HEAD', 'MOUTH'] This value can be between 1 and 4
numberOfRetry Int optional 0 The number of retries that should be performed if the user fails the liveness check. The SDK will repeat up to and including this if the user fails the test repeatedly before failing the entire flow
backgroundColor Color optional Colors.white Background color
fontFamily String optional "Roboto" Font family from your assets
prepareText String optional "Ensure your face is in the circle" Prepare text
titleFontColor Color optional Colors.black87 Font color
titleFontSize Double optional 20 Font size
loadingColor Color optional Colors.white Loading indicator color
loadingSize Double optional 20 Loading indicator size
loadingText String optional "Loading..." Loading text
verifyText String optional "Verify..." Verify text
loadingFontColor Color optional Colors.white Text color of loadingText, verifyText
loadingFontSize Double optional 16 Text size of loadingText, verifyText
subtitleFontSize Double optional 12 Text size of recordText, uploadText
recordText String optional "Recording in process..." Indicator record step
uploadText String optional "Upload in process..." Indicator upload step
buttonLabel String optional "Tap to start" Button label
buttonStyle ButtonStyle optional
backgroundColor: MaterialStateProperty.all(,
textStyle: MaterialStateProperty.all(
fontFamily: widget.fontFamily
Custom button style for look and feel match your CI
buttonPadding EdgeInsets optional EdgeInsets.all(25) Padding of button
hintPositionFromBottom Double optional screen height * 0.15 Adjust hint position from bottom
buttonPositionFromBottom Double optional screen height * 0.01 Adjust button position from bottom


Available properties in response

Property Type Description
detectSuccess Boolean Detection status
detectActionsResult Array of object Array of detection results
totalRetry Int Total number of retry
statusCode Int HTTP response error status codes
errorMessage String HTTP response error message