Skip to main content

Flutter SDK

Getting Started

Latest release: Version 1.1.3

Requirements

  1. iOS 13.0 and higher Or API level 21 (Android 5.0) or higher
  2. Internet connection
  3. Camera

Resources

Integration Sample: Flutter Sample App

Installation

Tip

It’s always recommended to use the updated version

Step 1: Run this command: dart pub add facia_mobilesdk with dart or flutter pub add facia_mobilesdk with flutter
Or
Add dependency in pubspec.yaml as

dependencies: 
facia_mobilesdk: ^1.1.3

Step 2: Go to project > android > build.gradle file and add the following

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' } // add this line
}
}

Step 3: Import 'package:facia_mobilesdk/facia_mobilesdk.dart' in your class to send the request to Facia's SDK.

Basic Usage

Note

Make sure you have obtained authorization credentials before proceeding. You can get Login credentials (email & password) by contacting to Facia support team

Authorization

For authorization, Facia's SDKs require Access token. You can get access token from the API: https://app.facia.ai/backend/api/transaction/get-access-token/

Request Object

ParametersDescription
emailRequired: Yes
Type: String
passwordRequired: Yes
Type: String

Configuration

The Facia’s mobile SDKs can be configured on the basis of parameters provided in the config object. The details of parameters can be found here.

Map<String,Object> config = {
"showConsent": true,
"showVerificationType": true,
"showResult": true,
};

Initialisation

Facia’s mobile SDK can be initialised by using the given method and passing token and config object as the parameters.

FaciaSdk.sendRequest(token: 'ACCESS_TOKEN', configObject: config);

Callbacks

The SDK receive callbacks on termination, whether after the request completion or if the journey is left mid-way. The callbacks are received as

var response = await FaciaSdk.sendRequest(token: 'ACCESS_TOKEN', configObject: config);

The complete list of callback events can be found here.

Callback Handling

All the callbacks can be handled inside the client’s calling activity. The responses and callback handling can be seen below.

On SDK Completion

3D Liveness

if (event === "verification.accepted") {
// Verification accepted callback
}
else if (event === "verification.declined") {
// Verification declined callback
}

Photo ID Match

if (event === "photo_id.match_success") {
// Verification accepted callback
}
else if (event === "photo_id.match_failure") {
// Verification declined callback
}

On SDK Error

if (event === "permission.denied") {
// This callback is returned in case the permissions are declined by the end user.
}
else if (event === "request.timeout") {
// This callback is returned in case request took too long and is timed out
}
else if (event === "request.cancelled") {
// This callback is returned when verification is cancelled midway by the end user
}
else if (event === "error.occurred") {
// This callback is returned if the API request faces any issue
}
else if (event === "emulator.detected") {
// This callback is returned if the SDK is running on an emulator
}
else {
// Some error has been occured during the verification process
}

Customisation

Facia supports a set of customization options that will influence the appearance of the mobile SDK.

Android

To customize the UI of your Android module, you can add the related files in the "android>app>src>main>res>values" directory.

Colours

The colour of buttons and font can be customised by overriding the values of following variables in the project's color.xml file.

<color name="dark_text_color">#424242</color>
<color name="light_text_color">#9E9E9E</color>
<color name="face_detected_oval_color">#4E836C</color>
<color name="face_not_detected_oval_color">#F4495D</color>
<color name="dialog_button_text_color">#173DD0</color>
<color name="button_bg_color">#173DD0</color>
<color name="button_text_color">#FFFFFFFF</color>
<color name="ql_instruction_bg_color">#FFFFFFFF</color>

Changelog

DateSDK VersionsChanges
Mar 18, 20241.1.3Update Depedencies.
Feb 23, 20241.1.2Improve instructions flow.
Feb 15, 20241.1.1Improved user experience.
Feb 15, 20241.1.0Added Android 14 support.
Feb 02, 20241.0.9Improved Camera functionalities.
Jan 26, 20241.0.8Improved Camera functionalities.
Nov 17, 20231.0.7Improved Passive Liveness flow & design.
Nov 02, 20231.0.3Improved functionality and design
Oct 25, 20231.0.2Improved user experience
Oct 17, 20231.0.13D Liveness & Photo ID Match features are added.