Quickstart

Get up and running with Face SDK

1. Get the service

Face SDK runs as an online service. You are required to set up your own web service.

Please contact us so we can provide you with more information.

In a meantime, you can still proceed with setup instructions and use our sandbox service to check out the functionalities we provide!

2. Install the Face SDK

See the installation guides below to integrate the Face SDK into all of your apps!

3. Configure Face SDK

To configure your web service check out Regula Face SDK Web Service installation instructions.

Once you get yourself a running server instance you can provide your own service URL for the Face SDK client.

Regula's sandbox service URL is used by default.

Swift
Objective-C
Kotlin
Java
React Native
Flutter
Cordova
Ionic
Swift
import FaceSDK
FaceSDK.service.serviceURL = "YOUR_WEB_SERVICE_URL"
Objective-C
#import <FaceSDK/FaceSDK.h>
RFSFaceSDK.service.serviceURL = @"YOUR_WEB_SERVICE_URL";
Kotlin
FaceSDK.Instance().serviceUrl = "YOUR_WEB_SERVICE_URL"
Java
FaceSDK.Instance().setServiceUrl("YOUR_WEB_SERVICE_URL");
React Native
import FaceSDK from '@regulaforensics/react-native-face-api';
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
Flutter
import 'package:flutter_face_api/face_api.dart';
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
Cordova
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
Ionic
import { FaceSDK } from '@regulaforensics/ionic-native-face-api-beta';
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');

4. Permissions

The FaceSDK requires a few devices permission. For instance, our Liveness and Face Capture modules use the devices' cameras.

To work properly iOS platform requires explicitly specify these permissions.

Although Android is not required to insert any additional permissions, please note that your application will inherit the permissions FaceSDK provides.

iOS, React Native, Flutter
Android
Cordova
Ionic
iOS, React Native, Flutter

Please add the following usage descriptions to your Info.plist.

<key>NSCameraUsageDescription</key>
<string>Requires access to your phone’s camera.</string>
Android

Optional to include as they will be merged by the build system to your AndroidManifest.xml automatically.

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />

INTERNET permission is compulsory permission.

Cordova

Please add the following configuration to your config.xml at the root <widget></widget> node.

<config-file platform="ios" target="*-Info.plist" parent="NSCameraUsageDescription">
<string>Requires access to your phone’s camera.</string>
</config-file>
Ionic

Please add the following configuration to your config.xml at the root <widget></widget> node.

<config-file platform="ios" target="*-Info.plist" parent="NSCameraUsageDescription">
<string>Requires access to your phone’s camera.</string>
</config-file>

5. Detect Liveness

Now you are ready to call the SDK. Below is an example of showing the Liveness detection UI module.

Swift
Objective-C
Kotlin
Java
React Native
Flutter
Cordova
Ionic
Swift
import FaceSDK
FaceSDK.service.startLiveness(
from: viewController,
animated: true,
onLiveness: { response in
// ... check response.liveness for detection result.
},
completion: nil
)
Objective-C
#import <FaceSDK/FaceSDK.h>
[RFSFaceSDK.service startLivenessFrom:viewController
animated:YES
onLiveness:^(RFSLivenessResponse * _Nonnull response) {
// ... check response.liveness for detection result.
} completion:nil];
Kotlin
FaceSDK.Instance().startLiveness(this@MainActivity) { livenessResponse: LivenessResponse ->
// ... check livenessResponse.liveness for detection result.
}
Java
FaceSDK.Instance().startLiveness(MainActivity.this, livenessResponse -> {
// ... check livenessResponse.liveness for detection result.
});
React Native
import FaceSDK, { LivenessResponse } from '@regulaforensics/react-native-face-api';
FaceSDK.startLiveness(livenessResponse => {
const response = LivenessResponse.fromJson(JSON.parse(livenessResponse));
// ... check response.liveness for detection result.
}, e => { });
Flutter
import 'dart:convert';
import 'package:flutter_face_api/face_api.dart';
FaceSDK.startLiveness().then((livenessResponse) {
var response = LivenessResponse.fromJson(jsonDecode(livenessResponse));
// ... check response.liveness for detection result.
});
Cordova
FaceSDK.startLiveness(livenessResponse => {
const response = FaceSDK.LivenessResponse.fromJson(JSON.parse(livenessResponse));
// ... check response.liveness for detection result.
}, e => { });
Ionic
import { FaceSDK, LivenessResponse } from '@regulaforensics/ionic-native-face-api';
FaceSDK.startLiveness().then(livenessResponse => {
const response = LivenessResponse.fromJson(JSON.parse(livenessResponse));
// ... check response.liveness for detection result.
});

See our Liveness guide for more information and configuration example. Also, make sure to browse other features as well such as the Face Capture and the Match Faces.

You have now successfully integrated the Face SDK. Congrats! 🎉

Next Steps

Other Features

Check out what else our Face SDK can do. Take a look at the detailed guide for Liveness. See how to automatically capture a photo with a person's face with Face Capture. Or find out the similarity of faces on given images using the Match Faces feature!

Sample Apps

Sample apps provide extensive examples of customization and use cases. Check out the resource page.

Tune your UI

The Face SDK comes with a flexible customization approach. Check out how you can make the UI look the way you want!