Quickstart
Five quick steps to get started with the Face SDK.
1. Get the service
Info
The Face SDK runs as an online service. You are required to set up your own web service.
Please contact us to get 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
Use the installation guides below to integrate the Face SDK into all of your apps.
- iOS Installation
- Android Installation
- React Native Installation
- Flutter Installation
- Cordova Installation
- Ionic Installation
- Xamarin Installation
3. Configure Face SDK
To configure your web service, check out Regula Face SDK Web Service installation instructions.
Once you get a running server instance, you can provide your own service URL for the Face SDK client.
Info
The Regula's sandbox service URL is used by default.
import FaceSDK
FaceSDK.service.serviceURL = "YOUR_WEB_SERVICE_URL"
#import <FaceSDK/FaceSDK.h>
RFSFaceSDK.service.serviceURL = @"YOUR_WEB_SERVICE_URL";
FaceSDK.Instance().serviceUrl = "YOUR_WEB_SERVICE_URL"
FaceSDK.Instance().setServiceUrl("YOUR_WEB_SERVICE_URL");
import FaceSDK from '@regulaforensics/react-native-face-api';
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
import 'package:flutter_face_api/face_api.dart';
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
import { FaceSDK } from '@regulaforensics/ionic-native-face-api-beta';
FaceSDK.setServiceUrl('YOUR_WEB_SERVICE_URL');
4. Permissions
The Face SDK requires a few devices permission. For instance, our Liveness and Face Capture modules use the devices' cameras.
To work properly, the iOS platform requires the following permissions to be specified explicitly.
For Android, it's required to allow the INTERNET permission. Note that your application will inherit the permissions the Face SDK provides.
Add the following usage descriptions to your Info.plist
.
<key>NSCameraUsageDescription</key>
<string>Requires access to your phone’s camera.</string>
INTERNET
is a mandatory permission.
<uses-permission android:name="android.permission.INTERNET" />
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" />
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>
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.
import FaceSDK
FaceSDK.service.startLiveness(
from: viewController,
animated: true,
onLiveness: { response in
// ... check response.liveness for detection result.
},
completion: nil
)
#import <FaceSDK/FaceSDK.h>
[RFSFaceSDK.service startLivenessFrom:viewController
animated:YES
onLiveness:^(RFSLivenessResponse * _Nonnull response) {
// ... check response.liveness for detection result.
} completion:nil];
FaceSDK.Instance().startLiveness(this@MainActivity) { livenessResponse: LivenessResponse ->
// ... check livenessResponse.liveness for detection result.
}
FaceSDK.Instance().startLiveness(MainActivity.this, livenessResponse -> {
// ... check livenessResponse.liveness for detection result.
});
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 => { });
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.
});
FaceSDK.startLiveness(livenessResponse => {
const response = FaceSDK.LivenessResponse.fromJson(JSON.parse(livenessResponse));
// ... check response.liveness for detection result.
}, e => { });
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 the Liveness guide for more information and a configuration example. Also, make sure to browse other features as well such as Face Capture and Match Faces.
Success
You have successfully integrated the Face SDK. Congrats! 🎉
Next Steps
Other Features
Check out what else the 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 Samples 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.