File Upload and QR Management
This component requires a minimum iOS 14 version
Introduction
File upload and the reading and generation of QR Codes are performed with the Capture Component.
This component allows document upload by taking a photo with the device camera or from the gallery. FileUploader, QR Reader and QR Generator use the KMP Widget FPHICaptureWidget (it has no native UI of its own). Its main features are:
Document upload via camera or gallery.
QR Code reading.
QR Code generation.
In the Initialization the steps required for the basic Integration of the SDK are detailed. This section adds the information for the launch of this component.
Dependencies
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), these must be completely removed before installing the components of the SDKMobile.
CocoaPods
Currently, Facephi libraries are distributed remotely through different dependency managers, in this case CocoaPods. The dependencies mandatory that must have been installed beforehand (by adding them to the project's Podfile) are:
pod 'FPHISDKMainComponent', '~> $VERSION'To install the Capture component, the following entry must be included in the application's Podfile:
pod 'FPHISDKCaptureComponent', '~> $VERSION'SPM
The mandatory dependencies that must have been installed beforehand are:
To install the SelphID component, it must be included in the project's modules:
Available controllers
Controller
Description
FileUploaderController
Controller for document capture
QrReaderController
Controller for QR capture
QrGeneratorController
Controller for QR generation
Error handling
Errors will be returned as a 'CaptureError' object.
List of errors:
CAP_ACTIVITY_RESULT_MSG_ERROR: The result returned by the activity is incorrect or does not contain the necessary information to continue.
CAP_APPLICATION_CONTEXT_ERROR: The required application context is null or invalid, preventing the capture module from being initialized correctly.
CAP_CAMERA_ERROR: An internal error related to the device camera has occurred (failure to open, Initialization, or capture).
CAP_CAMERA_PERMISSION_DENIED: The user has denied the permissions required to access the camera.
CAP_CANCEL_BY_USER: The user has manually canceled the capture process.
CAP_CANCEL_LAUNCH: The process has been generally canceled by the SDK or by an external action.
CAP_COMPONENT_LICENSE_ERROR: The component License is not valid, has expired, or does not match the required configuration.
CAP_EMPTY_LICENSE: The License string is empty or has not been provided.
CAP_FETCH_DATA_ERROR: An error occurred while fetching or processing the data required to execute the Flow. (Includes additional information in the field
error.)CAP_FLOW_ERROR: An internal error occurred during the execution of the capture Flow. (Includes additional information in the field
error.)CAP_INITIALIZATION_ERROR: Error while initializing the necessary SDK components. (Includes detailed information in the field
error.)CAP_FILE_UPLOADER_CAPTURE_ERROR: Error during the process of uploading the files generated in the capture.
CAP_IMAGE_TOO_LARGE: The image selected from the gallery exceeds the maximum size configured in
maxGalleryImageSizeKb.CAP_MANAGER_NOT_INITIALIZED: The managers required to execute the process have not been initialized correctly.
CAP_NO_DATA_ERROR: The required input data are null, nonexistent, or insufficient to continue the process.
CAP_OPERATION_NOT_CREATED: It was not possible to create or retrieve an active operation required to continue. (Includes detailed information in the field
error.)CAP_QR_CAPTURE_ERROR: Error during the capture or reading of the QR Code.
CAP_QR_GENERATION_ERROR: Error while generating the requested QR Code.
CAP_TIMEOUT: The maximum allowed time has been reached in one of the phases of the process.
CAP_FLOW_VIDEO_RECORDING_ERROR: Error during video recording within the established Flow.
CAP_FLOW_TRACKING_ERROR: Error while performing the Tracking required to complete the capture Flow.
Document capture configuration
In FileUploaderConfigurationData, together with parameters such as allowGallery and maxScannedDocs, the behavior of selection from the gallery can be adjusted:
onlyGalleryMode: Opens the Flow directly in gallery mode, without showing the camera capture. By defaulttrue.maxGalleryImageSizeKb: Maximum size allowed for images selected from the gallery, in KB. By default2048. If an image exceeds this limit, the component returnsCAP_IMAGE_TOO_LARGE.
Last updated