Main component
It is the SDK's most important component, as it contains the libraries needed to ensure everything works correctly.
The installation of the Core Plugin is required, regardless of the products to be used and the defined use case. It contains basic functionality for the SDK to operate, as well as other cross-cutting functionality required by the auxiliary plugins.
Dependencies
React Native:
npm i @facephi/sdk-core-react-native@<versión>Android - Gradle:
api "com.facephi.androidsdk:sdk:$version"
api "com.facephi.androidsdk:core:$version"
implementation "com.facephi.androidsdk:tracking_component:$version"iOS - CocoaPods:
s.dependency 'FPHISDKMainComponent', '~> $version'
s.dependency 'FPHISDKTrackingComponent', '~> $version'
s.dependency 'FPHISDKLicensingComponent', '~> $version'
s.dependency 'FPHISDKTokenizeComponent', '~> $version'
s.dependency 'FPHISDKStatusComponent', '~> $version'Available methods
This component contains several methods that perform different functions:
Method
Description
initSession
Main component controller, responsible for validating licenses, among other things.
initOperation
Method responsible for generating a new operation. Its ID is retrieved from the result object, in the data parameter.
getExtraData
The getExtraData method generates the identifiers required for an operation that needs to continue in the Facephi Validation Service (Backend).
closeSession
Before the application is destroyed, the SDK session must be closed to notify the platform that it has finished.
initSession
Before using any component, the SDK session must be initialized. This initialization should be performed as early as possible, preferably when the application starts. Likewise, once all operations with the SDK Mobile are complete, the session must be closed.
The current component can be initialized in two ways, depending on how you want to inject the license.
The new licensing method lets you manage licenses transparently for the integrator. The license can be injected in two ways:
a. Retrieving the license through a service using a URL and API key
b. Injecting the license directly as a String
In both cases, the result is returned through a Promise containing an object of the CoreResult.
Basic Configuration
To launch the current component, you must create an object InitSessionConfiguration that will serve as the component controller’s configuration.
The basic configuration required is as follows:
Advanced component configuration
All the fields that are part of this class are described below.
Init Session ConfigurationinitOperation
When starting a process or Flow, always call the launchInitOperation method
Basic Configuration
To launch the current component, create an object InitOperationConfiguration which will be the component controller's configuration.
The basic configuration required is as follows:
Advanced component configuration
All the fields that are part of this class are described below.
Init Operation ConfigurationcloseSession
Before the application is destroyed, the SDK session must be closed to notify the platform that it has ended. To do this, execute the following code snippet:
getExtraData
The getExtraData method generates the identifiers required for an operation that must continue in the Facephi Validation Service (Backend). This situation usually occurs when, after obtaining the necessary information in the client application, that information must be sent to a specific service for subsequent validation or analysis. If the results of these processes need to be tracked on the Platform, it must be able to link the first part of the process, carried out on the client, with the final part, carried out by the service, since they are ultimately part of the same operation.
Launching IDV
The IDV process launches a flow configured on the platform using its ID (flowID). To do this, you need to invoke two methods: initFlow + startFlow.
launchInitFlow
This method sets the required configuration: the ID of the flow configured on the platform (flowID) and the customer ID (customerID). See the code below:
To configure the flow controller, create a list of the controllers for the components that will participate in the process so they can be initialized correctly. The order in which they are defined does not matter; the flow itself determines the order in which they are executed. For example:
setSelphiFlow: Face Capture
setSelphidFlow: Document capture
Code to launch the flow:
Receiving the result
Launching ALL methods will return information in CoreResult format. It is possible to distinguish between a successful launch and an unsuccessful one:
Core ResultLast updated