Process Customization
This article outlines the available Face SDK process customization options.
Session Video Recording
You can decide whether to record the liveness assessment session and how to save the video to the server:
- Record the session and send the video to the server with an additional request (default setting). This provides quicker user response, but there's a risk of video loss if the application is closed before transmission completion.
- Record the session and send the video to the server with a Liveness package. This may result in longer response times, as the response appears only after the package reaches the server completely.
- Disable video recording.
Recording the session and sending the video to the server with an additional request:
let configuration = LivenessConfiguration {
$0.recordingProcess = .asynchronousUpload
}
FaceSDK.service.startLiveness(from: viewController,
animated: true,
configuration: configuration) { response in
}
RFSLivenessConfiguration *configuration = [RFSLivenessConfiguration configurationWithBuilder:^(RFSLivenessConfigurationBuilder * _Nonnull builder) {
builder.recordingProcess = RFSRecordingProcessAsynchronousUpload;
}];
[RFSFaceSDK.service startLivenessFrom:viewController
animated:YES
configuration:configuration
onLiveness:^(RFSLivenessResponse * _Nonnull response) {
} completion:^{
}];
val configuration = LivenessConfiguration.Builder()
.setRecordingProcess(RecordingProcess.ASYNCHRONOUS_UPLOAD)
.build()
FaceSDK.Instance().startLiveness(
context,
configuration
) { response -> }
LivenessConfiguration configuration = new LivenessConfiguration.Builder()
.setRecordingProcess(RecordingProcess.ASYNCHRONOUS_UPLOAD)
.build();
FaceSDK.Instance().startLiveness(context,
configuration,
response -> {
});
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.ASYNCHRONOUS_UPLOAD
}, (response) => { }, _ => { })
var livenessResponse = await faceSdk.startLiveness(
config: LivenessConfig(
recordingProcess: RecordingProcess.ASYNCHRONOUS_UPLOAD,
),
);
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.ASYNCHRONOUS_UPLOAD
}, function (m) { }, function (e) { })
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.ASYNCHRONOUS_UPLOAD
})
// Android
LivenessConfiguration.Builder config = new();
config.SetRecordingProcess(RecordingProcess.AsynchronousUpload);
FaceSDK.Instance().StartLiveness(Platform.AppContext, config.Build(), this);
// iOS
RFSFaceSDK.Service.StartLivenessFrom(CurrentPresenter, true, RFSLivenessConfiguration.ConfigurationWithBuilder((RFSLivenessConfigurationBuilder builder) =>
{
builder.RecordingProcess = RFSRecordingProcess.AsynchronousUpload;
}), (RFSLivenessResponse response) =>
{
}, () => { });
Recording the session and sending the video to the server with a Liveness package:
let configuration = LivenessConfiguration {
$0.recordingProcess = .synchronousUpload
}
FaceSDK.service.startLiveness(from: viewController,
animated: true,
configuration: configuration) { response in
}
RFSLivenessConfiguration *configuration = [RFSLivenessConfiguration configurationWithBuilder:^(RFSLivenessConfigurationBuilder * _Nonnull builder) {
builder.recordingProcess = RFSRecordingProcessSynchronousUpload;
}];
[RFSFaceSDK.service startLivenessFrom:viewController
animated:YES
configuration:configuration
onLiveness:^(RFSLivenessResponse * _Nonnull response) {
} completion:^{
}];
val configuration = LivenessConfiguration.Builder()
.setRecordingProcess(RecordingProcess.SYNCHRONOUS_UPLOAD)
.build()
FaceSDK.Instance().startLiveness(
context,
configuration
) { response -> }
LivenessConfiguration configuration = new LivenessConfiguration.Builder()
.setRecordingProcess(RecordingProcess.SYNCHRONOUS_UPLOAD)
.build();
FaceSDK.Instance().startLiveness(context,
configuration,
response -> {
});
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.SYNCHRONOUS_UPLOAD
}, (response) => { }, _ => { })
var livenessResponse = await faceSdk.startLiveness(
config: LivenessConfig(
recordingProcess: RecordingProcess.SYNCHRONOUS_UPLOAD,
),
);
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.SYNCHRONOUS_UPLOAD
}, function (m) { }, function (e) { })
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.SYNCHRONOUS_UPLOAD
})
// Android
LivenessConfiguration.Builder config = new();
config.SetRecordingProcess(RecordingProcess.SynchronousUpload);
FaceSDK.Instance().StartLiveness(Platform.AppContext, config.Build(), this);
// iOS
RFSFaceSDK.Service.StartLivenessFrom(CurrentPresenter, true, RFSLivenessConfiguration.ConfigurationWithBuilder((RFSLivenessConfigurationBuilder builder) =>
{
builder.RecordingProcess = RFSRecordingProcess.SynchronousUpload;
}), (RFSLivenessResponse response) =>
{
}, () => { });
Disabling the session recording:
let configuration = LivenessConfiguration {
$0.recordingProcess = .notUpload
}
FaceSDK.service.startLiveness(from: viewController,
animated: true,
configuration: configuration) { response in
}
RFSLivenessConfiguration *configuration = [RFSLivenessConfiguration configurationWithBuilder:^(RFSLivenessConfigurationBuilder * _Nonnull builder) {
builder.recordingProcess = RFSRecordingProcessNotUpload;
}];
[RFSFaceSDK.service startLivenessFrom:viewController
animated:YES
configuration:configuration
onLiveness:^(RFSLivenessResponse * _Nonnull response) {
} completion:^{
}];
val configuration = LivenessConfiguration.Builder()
.setRecordingProcess(RecordingProcess.NOT_UPLOAD)
.build()
FaceSDK.Instance().startLiveness(
context,
configuration
) { response -> }
LivenessConfiguration configuration = new LivenessConfiguration.Builder()
.setRecordingProcess(RecordingProcess.NOT_UPLOAD)
.build();
FaceSDK.Instance().startLiveness(context,
configuration,
response -> {
});
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.NOT_UPLOAD
}, (response) => { }, _ => { })
var livenessResponse = await faceSdk.startLiveness(
config: LivenessConfig(
recordingProcess: RecordingProcess.NOT_UPLOAD,
),
);
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.NOT_UPLOAD
}, function (m) { }, function (e) { })
FaceSDK.startLiveness({
recordingProcess: RecordingProcess.NOT_UPLOAD
})
// Android
LivenessConfiguration.Builder config = new();
config.SetRecordingProcess(RecordingProcess.NotUpload);
FaceSDK.Instance().StartLiveness(Platform.AppContext, config.Build(), this);
// iOS
RFSFaceSDK.Service.StartLivenessFrom(CurrentPresenter, true, RFSLivenessConfiguration.ConfigurationWithBuilder((RFSLivenessConfigurationBuilder builder) =>
{
builder.RecordingProcess = RFSRecordingProcess.NotUpload;
}), (RFSLivenessResponse response) =>
{
}, () => { });
Turning Off Vibration
For the Liveness and Capture features, for each correct action a vibration signal is turned on by default:
- When the user aligns their face for a selfie and the system captures the frame (Liveness and Capture).
- As the user turns their head to the required segment and a frame is captured. This process is repeated for each required head movement segment, providing feedback through vibration each time a frame is successfully captured (Liveness).
To turn the vibration signal off, use the following code blocks.
Capture
let configuration = FaceCaptureConfiguration {
$0.vibrateOnSteps = false
}
FaceSDK.service.presentFaceCaptureViewController(from: viewController,
animated: true,
configuration: configuration) { response in
// handle response
} completion: {
// handle completion
}
RFSFaceCaptureConfiguration *configuration = [RFSFaceCaptureConfiguration configurationWithBuilder:^(RFSFaceCaptureConfigurationBuilder *builder) {
builder.vibrateOnSteps = NO;
}];
[RFSFaceSDK.service presentFaceCaptureViewControllerFrom:self.viewController
animated:YES
configuration:configuration
onCapture:^(RFSFaceCaptureResponse *response) {
} completion:^{
}];
val configuration: FaceCaptureConfiguration = FaceCaptureConfiguration.Builder()
.setVibrateOnStep(false)
.build()
FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
.setVibrateOnStep(false)
.build();
FaceSDK.startFaceCapture({
vibrateOnSteps: false
}, _ => { }, _ => { })
FaceSDK.instance.startFaceCapture(
config: FaceCaptureConfig(
vibrateOnSteps: false,
),
);
FaceSDK.startFaceCapture({
vibrateOnSteps: false
}, function (m) { }, function (e) { })
FaceSDK.startFaceCapture({
vibrateOnSteps: false
})
// Android
FaceCaptureConfiguration.Builder config = new();
config.SetVibrateOnStep(false);
FaceSDK.Instance().PresentFaceCaptureActivity(Platform.AppContext, config.Build(), this);
// iOS
RFSFaceSDK.Service.PresentFaceCaptureViewControllerFrom(CurrentPresenter, true, RFSFaceCaptureConfiguration.ConfigurationWithBuilder((RFSFaceCaptureConfigurationBuilder builder) =>
{
builder.VibrateOnSteps = false;
}), (RFSFaceCaptureResponse captureResponse) =>
{
}, null);
Liveness
let configuration = LivenessConfiguration {
$0.vibrateOnSteps = false
}
FaceSDK.service.startLiveness(from: viewController,
animated: true,
configuration: configuration1) { response in
// handle response
}
RFSLivenessConfiguration *configuration = [RFSLivenessConfiguration configurationWithBuilder:^(RFSLivenessConfigurationBuilder * _Nonnull builder) {
builder.vibrateOnSteps = NO;
}];
[RFSFaceSDK.service startLivenessFrom:viewController
animated:YES
configuration:configuration
onLiveness:^(RFSLivenessResponse * _Nonnull response) {
} completion:^{
}];
val configuration: LivenessConfiguration = LivenessConfiguration.Builder()
.setVibrateOnStep(false)
.build()
LivenessConfiguration configuration = new LivenessConfiguration.Builder()
.setVibrateOnStep(false)
.build();
FaceSDK.startLiveness({
vibrateOnSteps: false
}, _ => { }, _ => { })
FaceSDK.instance.startLiveness(
config: LivenessConfig(
vibrateOnSteps: false,
),
);
FaceSDK.startLiveness({
vibrateOnSteps: false
}, function (m) { }, function (e) { })
FaceSDK.startLiveness({
vibrateOnSteps: false
})
// Android
LivenessConfiguration.Builder config = new();
config.SetVibrateOnStep(false);
FaceSDK.Instance().StartLiveness(Platform.AppContext, config.Build(), this);
// iOS
RFSFaceSDK.Service.StartLivenessFrom(CurrentPresenter, true, RFSLivenessConfiguration.ConfigurationWithBuilder((RFSLivenessConfigurationBuilder builder) =>
{
builder.VibrateOnSteps = false;
}), (RFSLivenessResponse response) =>
{
}, () => { });