Flutter SDK
Getting Started
Latest release: Version 1.2.2
Requirements
- iOS 13.0 and higher Or API level 21 (Android 5.0) or higher
- Internet connection
- Camera
Resources
Integration Sample: Flutter Sample App
Installation
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.2.2
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
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
Parameters | Description |
---|---|
Required: Yes Type: String | |
password | Required: 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
Date | SDK Versions | Changes |
---|---|---|
Dec 17, 2024 | 1.2.2 | Minor Tweaks. |
Jul 05, 2024 | 1.1.8 | Feature Improvement. |
Jun 27, 2024 | 1.1.5 | Features improvement. |
Jun 07, 2024 | 1.1.4 | UX improved. |
Mar 18, 2024 | 1.1.3 | Update Depedencies. |
Feb 23, 2024 | 1.1.2 | Improve instructions flow. |
Feb 15, 2024 | 1.1.1 | Improved user experience. |
Feb 15, 2024 | 1.1.0 | Added Android 14 support. |
Feb 02, 2024 | 1.0.9 | Improved Camera functionalities. |
Jan 26, 2024 | 1.0.8 | Improved Camera functionalities. |
Nov 17, 2023 | 1.0.7 | Improved Passive Liveness flow & design. |
Nov 02, 2023 | 1.0.3 | Improved functionality and design |
Oct 25, 2023 | 1.0.2 | Improved user experience |
Oct 17, 2023 | 1.0.1 | 3D Liveness & Photo ID Match features are added. |