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:

APPLICATION_ID_NOT_MATCH: The package name is not within the authorized scope, please check your package name.

LICENSE_EXPIRE: The license has expired, please confirm that the user has calibrated the phone time.

ERROR_LICENSE(1): The license parsing succeeded, but necessary authentication information is missing, this case generally will not occur.

ERROR_LICENSE(2): The license parsing succeeded, but the internal format is incorrect, this case also generally will not occur.

ERROR_LICENSE(3): It is highly likely that an incompatible SDK license is being used, such as using an IQA license for liveness detection.

ERROR_LICENSE(4, 5): Parsing failed, please check if the license has issues like mismatched quotes, line breaks, etc.

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