Face Capture
This component requires iOS 13 or later.
Introduction
Facial capture is performed using the Selphi Component.
This component captures a selfie of the user and extracts their key facial features. It includes the following processes:
Internal camera and permission management.
Assistance during facial capture.
Generation of facial templates and the user's image.
Dependencies
To avoid conflicts and compatibility issues, if the project contains older versions of Facephi libraries (Widgets), remove them completely before installing the SDKMobile.
CocoaPods
Facephi libraries are distributed remotely through dependency managers. On iOS, CocoaPodsis used. The required dependencies must be installed beforehand (by adding them to the project's Podfile):
pod 'FPHISDKMainComponent', '~> $VERSION'To install the Selphicomponent, add the corresponding dependency to the project's Podfile along with the SDK's required dependencies.
pod 'FPHISDKSelphiComponent', '~> $VERSION'Swift Package Manager (SPM)
If you use SPM, make sure the SDK's required dependencies are installed first.
To install the Selphicomponent, include it in the project's modules.
Permissions
In the client application where the components will be integrated, add the following entry to the Info.plist:
Available controllers
Controller
Description
SelphiController
Main facial recognition controller
Error handling
finishStatus: Indicates whether the operation completed successfully. Possible values:
errorType: Errors specific to the widget.
On iOS, errorType is an ErrorType from the SDK. In the event of a timeout, the Swift enum may be .SELPHI_TIMEOUT(LivenessDiagnostic?) or, if interpolated directly, SELPHI_TIMEOUT. On iOS, there is no case TIMEOUT without a prefix.
To serialize the error, use:
This returns SPI_TIMEOUT whether the enum is SDK_TIMEOUT or SELPHI_TIMEOUT.
Timeout behavior
On timeout, the result has:
finishStatus:STATUS_ERRORdata:nil(aSelphiResult)errorType:.SELPHI_TIMEOUT(LivenessDiagnostic?)
The case SELPHI_TIMEOUT preserves the widget's liveness diagnostic when available. This information is not part of data; it can only be read on iOS by pattern matching on errorType:
If it arrives as SELPHI_TIMEOUT, the associated diagnostic may be nil when the timeout occurs through the widget's error path (FWETimeout) rather than the delegate extractionTimeout().
For native iOS integrations, treat the serialized value as SPI_TIMEOUT (includes SELPHI_TIMEOUT from the enum).
If showDiagnostic is enabled, the output is not invoked at the moment of the timeout: the diagnostic screen is displayed first, and the result is delivered when Close is tapped. With showDiagnostic disabled, the callback is executed immediately.
The following list includes errors from the cross-platform contract; some do not occur on iOS.
SPI_APPLICATION_CONTEXT_ERROR: The required application context is null.
SPI_BAD_EXTRACTOR_CONFIGURATION_ERROR: Widget: Incorrect extractor configuration.
SPI_CAMERA_PERMISSION_DENIED: The user denied the permissions.
SPI_CANCEL_BY_USER: The user canceled the process.
SPI_COMPONENT_LICENSE_ERROR: The component license is invalid.
SPI_EMPTY_LICENSE: The license String is empty.
SPI_EXTRACTION_LICENSE_ERROR: Widget: License error.
SPI_ACTIVE_LIVENESS_ERROR: Widget: Error during the active liveness process.
SPI_HARDWARE_ERROR: Widget: Hardware error.
SPI_INITIALIZATION_ERROR: Initialization error.
SPI_MANAGER_NOT_INITIALIZED: The managers are null.
SPI_NO_DATA_ERROR: The input data is null.
SPI_OPERATION_NOT_CREATED: There is no operation in progress.
SPI_RESOURCES_FILE_NOT_FOUND: The resources zip file was not found.
SPI_SETTINGS_PERMISSION_ERROR: Widget: Permission error.
SPI_TEMPLATE_ERROR:
SPI_TIMEOUT: Timeout during the process (
SELPHI_TIMEOUTfrom the enum).SPI_UNEXPECTED_CAPTURE_ERROR: Widget: Capture error.
SPI_UNKNOWN_ERROR: Unknown error.
SPI_WIDGET_RESULT_DATA_ERROR: Error in the widget's output data.
Last updated