Skip to content

React Native

This is a React Native-specific Face SDK installation guide. Before proceeding further, make sure you've read the Installation page and have selected the Core type to install.

Warning

Face SDK release 7.1 introduced the unified NPM package that supports React, Ionic, and Cordova wrappers in a single JavaScript distribution. The individual packages for each wrapper are now deprecated and will only be supported for a few upcoming releases before being removed in future versions. We’ll provide advance notice prior to their removal. Follow the Migration Guide for detailed transition steps to the new unified package.

Requirements

  • For iOS, the minimum target is iOS 13.0
  • For Android, the minimum Android API level is 21

Installation

The Face SDK is available on npm.

1. Run the following command to add the SDK to the project:

npm install @regulaforensics/face-sdk
npm install @regulaforensics/face-core-basic
npm install @regulaforensics/face-sdk
npm install @regulaforensics/face-core-match

2. To use Core Match, it's necessary to include the uncompressed faceSdkResource.dat file in the APK. When integrating the Face SDK into a multi-module project, remember to add the code snippet to the android section at the end of the app's Gradle file, rather than within the module itself. If you use Core Basic, skip this step.

Simply add the following configuration into android section of your android/app/build.gradle:

    aaptOptions {
        noCompress "Regula/faceSdkResource.dat"
    }

Android permisions

Most likely You will need to add internet permission(except some rare cases). Permissions are added to the top section of android/app/src/main/AndroidManifest.xml like this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    ...
</manifest>

Import the Face SDK

You should now be able to import face-sdk:

import { FaceSDK } from '@regulaforensics/face-sdk'

Info

You can always use our demo application on GitHub.

Next Step