Integration (React Native)

Integration Documentation for React Native Compatible with Liveness Detection V4.x Version.

Overview-Android

Overview-iOS

SDK requirements and limitations as below:

Compliance Explanation

Click to view the compliance explanation

Release Notes

Click to show release notes

Demo

Install IDV-Demo.apk to your phone and log in with the test account.

Migration Guides

If you are upgrading from an older version of the Liveness SDK, please refer to this document to understand the changes.

Installation

Add the dependency in your React Native project’s package.json file.

For Android, you need to do:

Add the Maven repository to the settings.gradle or build.gradle file in the Android directory of your React Native project:

For iOS, you need to do:

  1. Add the spec source to the Podfile.
  1. Run pod install to install the dependencies in your project.
  2. Add camera usage description in Info.plist as bellow. Ignore this step if you have added those.

Usage

  1. Initialization SDK.

  2. Check license

    The license is obtained by your server calling our openAPI, you need to check license before starting the liveness detection activity.

    The returned values of checkResult:

  3. You can create SDK launch parameters using the method below

Customization (iOS)

The following customization options are currently supported on iOS only.

Language

Set the SDK display language via the language parameter. Supported values: "en", "zh-Hans", "id", "vi", "th", "es", "ms", "hi", "fil". If not set, the SDK follows the device system language.

Custom Prompt Text

Use localizedStrings to override specific SDK prompt texts. Keys follow the format "<language>.<key>". Only entries matching the effective language (from language or system language) are applied.

Some commonly used keys (examples):

KeyDefault (en)
no_facePlease put your face in the frame
move_closerGet closer
move_furtherStep back
stay_stillHold steady
pls_blinkPlease blink
pls_open_mouthPlease open your mouth and then close
low_lightGo to a brighter area
warn_muti_faceMultiple faces detected from the image, please only keep one face in the image

For the complete list of available keys, refer to the Localizable.strings file bundled with the SDK after running pod install:

Custom Font

Use font to customize the font of the state-hint label. fontName must be a valid PostScript name of a font registered in your app. If the font cannot be found, the SDK default font is used.

Customization (Android)

See FAQ for Android UI customization.

Error Code

See Error Code