Document Capture
This component requires a minimum iOS 9 version
Introduction
This component is responsible for the capture and analysis of identity documents, allowing structured information to be extracted and processed images of the document to be obtained.
Its main features are:
Internal camera and permission management.
Guided assistance for capturing the front and back of the document.
Automatic data extraction using OCR.
Obtaining processed images of the document and associated elements (face, signature, etc.).
High level of configuration: countries, languages, document types and models.
Dependencies
To avoid conflicts and compatibility issues, if the project contains old versions of Facephi libraries (Widgets), these must be removed completely before installing the components of SDK Mobile.
CocoaPods
Facephi libraries are distributed remotely through dependency managers. The dependencies required that must have been previously installed (by adding them to the project's Podfile file) are:
pod 'FPHISDKMainComponent', '~> $VERSION'To install the component SelphID, add the corresponding dependency in the
Podfileof the project.
Swift Package Manager (SPM)
If you use SPM, make sure that the SDK's required dependencies are previously installed.
To install the component SelphID, include it in the project modules.
Permissions
In the client application where the components will be integrated, it is necessary to include the following element in the file Info.plist:
Available controllers
Controller
Description
SelphIDController
Main document recognition controller
Error handling
finishStatus: which will indicate whether the operation has completed successfully. Possible values:
errorType: Widget-specific errors.
In iOS, if interpolated directly, it will show SELPHID_TIMEOUT. In iOS there is no TIMEOUT without prefix.
To serialize the error, the following must be used:
This returns SPD_TIMEOUT whether the enum is SDK_TIMEOUT or SELPHID_TIMEOUT.
Timeout behavior
In a timeout, the result has:
finishStatus:STATUS_ERRORdata:nil(aSelphIDResult)errorType:.SELPHID_TIMEOUT(UIImage?, UIImage?)
The case SELPHID_TIMEOUT retains, when available, the raw document images captured before the timeout (rawFrontDocument and rawBackDocument from the widget). That information do is part of data nor is it returned as rawFrontDocument / rawBackDocument from the success result; it can only be read on iOS by pattern matching on errorType:
If it arrives as SELPHID_TIMEOUT, the associated images may be nil when the timeout occurs through the widget error path (FWMETimeout) instead of the delegate captureTimeout().
In iOS, properties such as timeoutDiagnostic or captureProgress do are included in the SdkResult error. The component uses captureProgress internally to show the diagnostic screen message when showDiagnostic it is active.
If showDiagnostic it is active. output is not invoked at the moment of the timeout: the diagnostic screen is shown first and the result is delivered when close is pressed. With showDiagnostic disabled, the callback runs immediately.
The following list includes cross-platform contract errors; some do not occur on iOS (for example, SPD_MOVE_FAIL).
SPD_APPLICATION_CONTEXT_ERROR: The required application context is null.
SPD_BAD_EXTRACTOR_CONFIGURATION_ERROR: Widget: Incorrect extractor configuration
SPD_CAMERA_PERMISSION_DENIED: The user has denied permissions.
SPD_CANCEL_BY_USER: The user has canceled the process.
SPD_CANCEL_LAUNCH: A general SDK cancellation has been performed.
SPD_COMPONENT_LICENSE_ERROR: The component license is not valid.
SPD_CONTROL_NOT_INITIALIZATED_ERROR: Widget: Initialization error
SPD_EMPTY_LICENSE: The license string is empty.
SPD_EXTRACTION_LICENSE_ERROR: Widget: License error
SPD_HARDWARE_ERROR: Widget: Hardware error
SPD_INITIALIZATION_ERROR: Initialization error.
SPD_MOVE_FAIL: The user has not moved as specified in the process.
SPD_NO_DATA_ERROR: The input data is null.
SPD_OPERATION_NOT_CREATED: There is no operation in progress.
SPD_RESOURCES_NOT_FOUND: The resources zip was not found
SPD_SETTINGS_PERMISSION_ERROR: Widget: Permission error
SPD_TIMEOUT: Timeout in the process
SELPHID_TIMEOUTof the enum).SPD_UNEXPECTED_CAPTURE_ERROR: Widget: Capture error
SPD_UNKNOWN_ERROR: Unknown error
SPD_WIDGET_RESULT_DATA_ERROR: Error in the widget output data
Last updated