NFC Component
0. SDK Mobile Base Requirementsβ
SDK Mobile is a set of libraries (Components) that offer a series of functionalities and services, allowing their integration into a Mobile application in a simple and fully scalable way. Certain components must be installed depending on the use case required. Its high level of modularity allows other new components to be added in the future without affecting those already integrated into the project.
For more information on the base configuration, go to the Mobile SDK
1. Introductionβ
The Component discussed in the current document is called NFC Component. It is responsible for NFC reading of ID cards and passports. Its main functionalities are the following:
-
Internal management of the NFC sensor.
-
Permission management.
-
Document analysis.
-
Progress analysis.
-
Assistant in reading processes.
-
Return all possible information to be read
-
Return of images when they are available for reading.
1.1 Minimum requirementsβ
The minimum iOS SDK version required is as follows:
-
Minimum iOS version: 13
-
Minimum device: iPhone 6s - the first to have an NFC reader
2. Integration of the componentβ
β οΈ Before integrating this component, it is recommended to read the documentation related to Mobile SDK and follow the instructions indicated in said document.
This section will explain step by step how to integrate the component current in an existing project.
2.1. Dependencies required for integrationβ
β οΈ To avoid conflicts and compatibility problems, if you want to install the component in a project containing an old Facephi libraries (Widgets) version, these must be removed entirely before installing the SDKMobile components.
- Currently FacePhi libraries are distributed remotely through different dependency managers, in this case Cocoapods. The mandatory dependencies that must have been previously installed (adding them to the project's Podfile file) are:
Cocoapodsβ
The mandatory dependencies that must have been previously installed (adding them to the project's Podfile file) are:
pod 'FPHISDKMainComponent', '~> 2.0.0'
To install the NFC component, the following entry must be included in the application's Podfile:
pod 'FPHISDKNFCComponent', '~>2.8.0'
SPMβ
The mandatory dependencies that must have been previously installed are:
//HTTPS
https://github.com/facephi-clienters/SDK-SdkPackage-SPM.git
//SSH
git@github.com:facephi-clienters/SDK-SdkPackage-SPM.git
To install the NFC component, it must be included in the project modules:
//HTTPS
https://github.com/facephi-clienters/SDK-NFC_component-SPM.git
//SSH
git@github.com:facephi-clienters/SDK-NFC_component-SPM.git
Once the dependencies are installed, you can use the different functionalities of the component.
- If developing with XCode15, a post-installation script must be included:
2.2 Permissions and settingsβ
In the client application where the components are going to be integrated, it is necessary to incorporate the following elements in the Info.plist file:
It is necessary to allow the use of NFC - (Privacy - NFC Scan Usage Description)
Indicate NFC identifiers - (ISO7816 application identifiers for NFC Tag Reader Session)
A0000002471001
A0000002472001
00000000000000
It is necessary to add the Near Field Communication Tag Reading option in the Signing & Capabilities section of the target
3. Start a new operationβ
In order to generate the associated information correctly in the platform, the newOperation command must be executed first.
βΉοΈ This command must have been executed before launch.
To learn more about how to start a new operation, it is recommended to consult the Mobile SDK documentation, which details and explains what this process consists of.
4. Available controllersβ
Controller | Description |
NFCController | NFC main reader controller |
5. Component configurationβ
Once initialized, a NFCConfigurationData object must be created and passed as a parameter to the SDKController during component launch to configure the current component.
The following section will show the fields part of this class and what each is used for.