@bigbangcore/react-native-linkface
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

react-native-linkface

LinkFace SDK wrapper for React Native

keywords: 人脸识别, 活体检测, 身份证识别, Face recognition, Liveness detection, IDCard OCR

Getting started

$ yarn add @bigbangcore/react-native-linkface

Automatic installation

Using in React Native > 0.60 with Cocoapods the autolinking will handle the dependencies

iOS

  1. Add Camera Permission to Info.plist
<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>

Android

  1. Add android:allowBackup="true" in AndroidManifest.xml and maybe you need tools:replace="android:allowBackup"

  2. In android/build.gradle add this:

// ...
allprojects {
  repositories {
    // ...
    flatDir {
      dirs project(':@bigbangcore_react-native-linkface').file('libs')
    }
    // ...
  }
}

Usage

Init SDK

Before use any linkface functions, you need to Init the SDK with LinkFace app info:

import Linkface, {CardScanType} from '@bigbangcore/react-native-linkface';

Linkface.initSdk('<LINKFACE_APP_ID>', '<LINKFACE_APP_SECRET>');

Clean

Clean the linkface images/video data

Linkface.clean();

OCR scan of Chinese ID Card

Return the ID card data, see the ILinkFaceInfo interface

// Front
const idFrontInfo = await Linkface.startIDCardScan(CardScanType.FRONT);

// Back
const idBackInfo = await Linkface.startIDCardScan(CardScanType.BACK);

Liveness detection of Face recognition

Return the verification data, see the ILinkFaceLiveness interface

const livenessData = await Linkface.startIDFaceScan();

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @bigbangcore/react-native-linkface

      Weekly Downloads

      1

      Version

      1.0.14

      License

      MIT

      Unpacked Size

      116 MB

      Total Files

      238

      Last publish

      Collaborators

      • thomasgaz