Importing the Face Capture SDK to a Project¶
To include the Face Capture SDK in your application requires the following steps:
- Copy files to the following directories in your React Native project
Source File (src=FaceCapture, installation) | Destination Folder (dst) |
---|---|
/src/react_native/aw_face_capture/face_capture.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_android_image.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_camera.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_capture_state.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_constants.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_enums.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_errors.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/face_capture_workflow.js | /dst/src/face_capture/ |
/src/react_native/aw_face_capture/android/
FaceCaptureImageInternal.java
|
/dst/android/app/src/main/java/com/
face_capture/
|
/src/react_native/aw_face_capture/android/
FaceCaptureAppPackage.java
|
/dst/android/app/src/main/java/com/
face_capture/
|
/src/react_native/aw_face_capture/android/
FaceCaptureInternal.java
|
/dst/android/app/src/main/java/com/
face_capture/
|
/src/samples/Profiles/face_capture_foxtrot_client.xml | /dst/android/app/src/main/assets/profiles/ |
/src/samples/Profiles/face_capture_foxtrot_client_landscape.xml | /dst/android/app/src/main/assets/profiles/ |
/src/lib/arm64-v8a/libaw_face_capture_jni.so | /dst/android/app/src/main/jniLibs/arm64-v8a/ |
/src/lib/arm64-v8a/libaw_face_capture.so | /dst/android/app/src/main/jniLibs/arm64-v8a/ |
/src/lib/arm64-v8a/libaw_preface7.so | /dst/android/app/src/main/jniLibs/arm64-v8a/ |
/src/lib/arm64-v8a/libc++_shared.so | /dst/android/app/src/main/jniLibs/arm64-v8a/ |
/src/java/aware-face_capture-1.1.jar | /dst/android/app/libs/ |
/src/lib/aar/Aware-FaceCapture-DeviceControl.aar | /dst/android/app/libs/ |
- Add the following to /dst/android/app/build.gradle
...
defaultConfig {
minSdkVersion 23
multiDexEnabled true
ndk {
abiFilters 'arm64-v8a'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
}
- Add the following to /dst/android/app/src/main/AndroidManifest.xml
...
<uses-permission android:name="android.permission.INTERNET" />
<!-- Permissions options for the `camera` group -->
<uses-permission android:name="android.permission.CAMERA"/>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>
- Add FaceCaptureAppPackage to your getPackages function in your MainApplication class (e.g. /dst/android/app/src/main/java/com/myapp/MainApplication.java)
...
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new FaceCaptureAppPackage());
return packages;
}
- Run “npm install” in /dst
- Import the Face Capture wrapper classes into your sources as necessary
...
import { FaceCapture } from "../face_capture/face_capture";