For the complete documentation index, see llms.txt. This page is also available as Markdown.

Video ID - VideoID

This component requires a minimum iOS13 version

Introduction

Face Capture is performed with the VideoID Component.

This component is responsible for recording a user while they identify themselves, showing their face and their Identity document.

  • Internal management of cameras, microphone, and permissions.

  • Connection with the services.

  • OCR reading and document capture.

In the section of Simplified Launch the necessary steps for the basic integration of the SDK are detailed. In this section, information is added for the launch of this component.

Dependency

To avoid conflicts and compatibility issues, if you want to install the component in a project that contains an old version of the Facephi libraries (Widgets), they must be completely removed before installing the components of the SDKMobile.

CocoaPods

  • The required dependencies that must have been installed previously (by adding them to the project's Podfile) are:

pod 'FPHISDKMainComponent', '~> $VERSION'
  • To install the NFC component, the following entry must be included in the application's Podfile:

pod 'FPHISDKVideoIDComponent', '~> $VERSION'

SPM

  • The mandatory dependencies that must have been installed previously are:

  • To install the video identification component, it must be included in the project's modules:

Permissions

In the client application where the components are to be integrated, it is necessary to include the following elements in the file Info.plist:

Available controllers

Controller

Description

VideoIdController

Main controller of video identification

SignatureVideoIdController

Controller for signing a process with a Capture

Simplified Launch

Once the SDK has been started and a new operation has been created, the component can be launched. Any of its controllers can be used to execute its functionality.

Launch:

Basic configuration

To launch the current component, an object VideoIdConfigurationData must be created, which will be the configuration of the component controller.

The basic configuration needed for this is as follows:

The different modes are:

  • .ONLY_FACE

  • .FACE_DOCUMENT_FRONT

  • .FACE_DOCUMENT_FRONT_BACK

Result reception

The controllers will return the necessary information in SdkResult format.

Error handling

In the error section, we will have the common enum ErrorType:

  • VID_CANCEL_BY_USER: The user has canceled the process

  • VID_CANCEL_LAUNCH: A general cancellation of the SDK has been performed

  • VID_COMPONENT_LICENSE_ERROR: The component License is not valid

  • VID_EMPTY_LICENSE: The License string is empty

  • VID_FACE_DETECTION_TIMEOUT: No face detected

  • VID_INITIALIZATION_ERROR: Initialization error

  • VID_MANAGER_NOT_INITIALIZED: The managers are null

  • VID_NETWORK_CONNECTION: Error in the internet connection

  • VID_NO_DATA_ERROR: The input data are null

  • VID_OPERATION_NOT_CREATED: There is no operation in progress

  • VID_PERMISSION_DENIED: The user has denied the permissions

  • VID_SOCKET_ERROR: Error in the services connection

  • VID_TIMEOUT: Timeout in the process

  • VID_VIDEO_ERROR: Error in video processing

  • VID_VIDEO_RECORDING_ACTIVE: It cannot be started because the video recording process is active

Successful execution receipt - data

In the SdkResult.Success part - data, we will have the VideoIdResult class.

The result returns the images in SdkImage format SdkImage, it is possible to extract the bitmap by accessing image.bitmap. If you wanted to convert it to base64, you can use the function:

Base64.encodeToString(this.toByteArray(), Base64.NO_WRAP)

The fields returned in the result are as follows:

frontDocumentData

Front document data. Includes:

  • documentImage: Document image

  • documentFullImage: Full captured image

  • documentFaceImage: If a face is found on the document, its image is returned.

  • iqaOverExposure: Numerical value between 0 and 1 that indicates the level of overexposure of the image; a high value suggests that the image is too bright, which can make the document harder to read.

  • iqaReadable: Numerical value between 0 and 1 that indicates the readability of the document text; higher values imply that the text is clearer and easier to recognize.

  • iqaSharpness: Numerical value between 0 and 1 that indicates the sharpness of the document image; high values reflect a more focused image, which improves data extraction capability.

  • documentFaceImageTokenized: If a face is found on the document, its encrypted image is returned.

backDocumentData

Back document data. Includes:

  • documentImage: Document image

  • documentFullImage: Full captured image

  • documentFaceImage: If a face is found on the document, its image is returned.

  • iqaOverExposure: Numerical value between 0 and 1 that indicates the level of overexposure of the image; a high value suggests that the image is too bright, which can make the document harder to read.

  • iqaReadable: Numerical value between 0 and 1 that indicates the readability of the document text; higher values imply that the text is clearer and easier to recognize.

  • iqaSharpness: Numerical value between 0 and 1 that indicates the sharpness of the document image; high values reflect a more focused image, which improves data extraction capability.

  • documentFaceImageTokenized: If a face is found on the document, its encrypted image is returned.

faceImage

User image captured in the first section of the process.

ocrMap

OCR map extracted from the document.

ocrDiagnostic

Dictionary with the OCR diagnosis of the document. The keys are the fields to validate and the values are instances of OcrDiagnostic.

OCR diagnosis extracted from the document.

  • OK: The OCR is correct.

  • NOT_FOUND: The OCR key is not found.

  • TOLERANCE_ERROR: The OCR is not correct.

  • WARNING: The OCR is not correct, but it is only a warning because it is an optional field.

matchingSidesScore

Numeric value between 0 and 1 that estimates the level of match between the faces of the document (front and back).

documentType

Document type obtained.

personalData

Reduced set of data obtained from the user:

  • issuer

  • documentNumber

  • issueDate

  • expiryDate

  • name

  • surname

  • fullName

  • gender

  • birthDate

  • birthPlace

  • nationality

  • address

  • nfcKey

  • numSupport

  • mrz

speechText

Text that the user must say during the video recording.

faceImageTokenized

Encrypted image of the user captured in the first section of the process.

Component Customization

Besides the changes that can be made at SDK level (which are explained in the document of SDK Customization), this specific component allows its interface to be modified.

Texts

The texts can be customized by overriding the value of the following keys in a Localizable.strings. The keys containing the suffix _alt are the literals used in the accessibility labels needed for the functionality of voice over.

Name

Value

video_id_component_init_message_face_content_desc

Place your face and the front of your document in the markers

video_id_component_finish_message

Video recording finished!

video_id_component_finish_button

FINISH

video_id_component_restart_button

RECORD AGAIN

video_id_component_ready_button

CONTINUE

video_id_component_exit_alert_cancel

Cancel

video_id_component_exit_alert_question

Are you sure you want to finish the process?

video_id_component_exit_alert_finish

Finish

video_id_component_exit_alert_accept

Accept

video_id_component_timeout_title

Timeout exceeded

video_id_component_timeout_desc

We couldn't complete the recording in time. Let's try again.

video_id_component_internal_error_title

An error has occurred

video_id_component_internal_error_desc

Let's try again.

video_id_component_close_button_alt

Close

video_id_component_back_button_alt

Back

video_id_component_logo_alt

Logo

video_id_component_document_front_message

Place the front of your document in the markers

video_id_component_document_front_message_readable

Keep the front of your document in the markers

video_id_component_document_front_message_not_readable

Bring the front of your document closer to the markers

video_id_component_document_back_message

Now place the back of your document

video_id_component_document_back_message_readable

Keep the back of your document in the markers

video_id_component_document_back_message_not_readable

Bring the back of your document closer to the markers

video_id_component_switch_camera_message

Prepare the document while the camera is being switched

video_id_component_face_message

Place your face within the frame.

video_id_component_multiple_face_message

Multiple faces detected. Place only your face within the frame

video_id_component_speech_message

Say out loud: "I (first and last name) accept the terms and conditions".

video_id_component_front_document_captured_message

Front of the document captured correctly

video_id_component_document_back_finish_message

Back of the document captured correctly

video_id_component_face_timeout_title

We have not detected your face

video_id_component_face_timeout_desc

Please place your face on the marker to start the process

video_id_component_ocr_error_desc

The document could not be read. Please check the lighting and the distance from the camera

Animations

If you want to modify the SDK animations (lottie), you must include the animations with the same name in the application's res/raw/ folder.

Last updated