@bigbangcore/react-native-linkface
v1.0.14
Published
LinkFace SDK wrapper for React Native
Downloads
19
Readme
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
- 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
Add
android:allowBackup="true"
in AndroidManifest.xml and maybe you need tools:replace="android:allowBackup"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();