react-native-aaiios-liveness-sdk(v2.0.7)

Migration Guides

  1. From v2.0.1, we refactored the code and aligned most of the js api with the android side, so please refer to the table below when migrating from the old version to v2.0.1.

    old method namenew method name
    NativeModules.RNAAILivenessSDK.initWithMarket("your-market")AAIIOSLivenessSDK.initSDKByLicense("your-market", false)
    NativeModules.RNAAILivenessSDK.initWithMarketAndGlobalService("your-market", isGlobalService)AAIIOSLivenessSDK.initSDKByLicense("your-market", isGlobalService)
    NativeModules.RNAAILivenessSDK.init("your-access-key", "your-secret-key", "your-market")AAIIOSLivenessSDK.initSDKByKey("your-access-key", "your-secret-key", "your-market", false)
    NativeModules.RNAAILivenessSDK.configDetectOcclusion(true)AAIIOSLivenessSDK.setDetectOcclusion(true)
    NativeModules.RNAAILivenessSDK.configResultPictureSize(600)AAIIOSLivenessSDK.setResultPictureSize(600)
    NativeModules.RNAAILivenessSDK.configUserId("your-reference-id")AAIIOSLivenessSDK.bindUser("your-reference-id")
    NativeModules.RNAAILivenessSDK.configActionTimeoutSeconds(10)AAIIOSLivenessSDK.setActionTimeoutSeconds(10)

Download SDK

See this part to get SDK download link.

Running the example app

  1. Download SDK and extract it, then go into the example directory: cd example

  2. Install packages: yarn install

  3. Go into the ios subdirectory and install pod dependencies: cd ios && pod install

  4. Go into the example directory and start Metro: cd .. && yarn start

  5. Modify example/App.js to specify your market and license content(The license content is obtained by your server calling our openapi).

  6. run example app: react-native run-ios or open example.xcworkspace in Xcode and run.

Getting started

Getting started (react-native >= 0.60)

If your react-navive version >= 0.60, you can refer this part to intergrate react-native-aaiios-liveness-sdk.

  1. First rename the folder name react-native-aaiios-liveness-sdk-V{sdkversion} to react-native-aaiios-liveness-sdk, then we can try to integrate the SDK. There are two ways to integrate the SDK:

    • As local package:

      1. Put the react-native-aaiios-liveness-sdk folder to your react-native project.
      1. cd your react-native project root path and link this local sdk package. yarn add link:./react-native-aaiios-liveness-sdk
    • As remote package:

      1. Upload all files in react-native-aaiios-liveness-sdk folder to your private git repository, make sure the name of your repository is react-native-aaiios-liveness-sdk.
      2. Navigate to the root directory of your react-native project and install SDK. $ npm install git+ssh://git@{your-git-domain}:{your-git-user-name}/react-native-aaiios-liveness-sdk.git --save
  2. Add pod dependencies AAINetwork and AAILiveness to your Podfile:

  3. After integrate the SDK then we link SDK to iOS project.

    cd ios && pod install

  4. Then add camera and motion sensor (gyroscope) usage description in Info.plist as bellow. Ignore this step if you have added those.

Getting started (react-native < 0.60)

  1. Download the AAILivenessSDK and AAINetwork, then extract them and add AAILivenessSDK folder, AAINetwork.xcframework to your project:

  2. Add the RNLivenessPlugin folder to your project.

  3. In Xcode, choose "TARGETS -> General" add the following system libraries and frameworks in the Frameworks, Libraries, and Embedded Content section:

    • libz.tbd
    • libc++.tbd
    • AVFoundation.framework
    • CoreMotion.framework
    • SystemConfiguration.framework
    • CoreTelephony.framework
    • Accelerate.framework
    • Metal.framework
    • MetalKit.framework
  1. In Xcode, add camera and motion sensor (gyroscope) usage description in Info.plist as bellow. Ignore this step if you have added those.

  2. Rename index.js to AAIIOSLivenessSDK.js, then add this js file to your react native project.

Usage

Change logs and release history

v2.0.7 Download

  1. Sync native SDK.

v2.0.6 Download

  1. Sync native SDK.

v2.0.5 Download

  1. Sync native SDK.

v2.0.4 Download

  1. Sync native SDK.
  2. Add configuration items playPromptAudio and showAnimationImgs.

v2.0.3 Download

  1. Sync native SDK.

v2.0.2 Download

  1. Sync native SDK.

v2.0.1 Download

  1. Refactored the code.

v1.3.4 Download

  1. Fix bugs.

v1.3.3 Download

  1. Optimizing the capture of face image.
  2. Support closed eye detection.
  3. Add localized string "pls_open_eye".
  4. Fix EXC_BAD_ACCESS bug that could occur in some cases.
  5. Fix the global service bug.
  6. Compressed images of AAIImgs.bundle.
  7. Removed 'android' folder.

v1.2.9.1 Download

  1. Fixed the bug that the audio could not be automatically switched with the language.

v1.2.9 Download

  1. Support setting language and prepareTimeoutInterval.

v1.2.8 Download

  1. Upgrade network module.

v1.2.1 Download

  1. Fix the bug that img of AAILivenessResult may be nil when the onDetectionComplete: method is called.

v1.2.0 Download

  1. Support to initialize SDK with license.

  2. Support face occlusion detection(only in the preparation phase, not in the action detection phase), this feature is off by default, you can turn it on if needed.

  3. Support Mexico,Malaysia,Pakistan,Nigeria,Colombia.