> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/products/idv-suite/flujos-and-integraciones/configuracion-tecnica-del-cliente/sdk-mobile/ios-sdk/modulos/captura-de-nfc.md).

# NFC Capture

### Introduction <a href="#id-1-introduccion" id="id-1-introduccion"></a>

The *Component* discussed in the current document is called ***NFC Component***. It is responsible for reading NFC from identity documents and passports. Its main functionalities are as follows:

* Internal management of the NFC sensor.
* Permission management.
* Document analysis.
* Progress analysis.
* Assistant in the reading processes.
* Return of all possible information to be read
* Return of images when they are available for reading

## Dependencies <a href="#id-21-dependencias-requeridas-para-la-integracion" id="id-21-dependencias-requeridas-para-la-integracion"></a>

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 file) are:

```
pod 'FPHISDKMainComponent', '~> $SDK_VERSION'
```

* To install the NFC component, the following entry must be included in the application's Podfile:

```
pod 'FPHISDKNFCComponent', '~> $NFC_VERSION'
```

### **SPM**

* The required dependencies that must have been installed previously 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's modules:

```
//HTTPS
https://github.com/facephi-clienters/SDK-NFC_component-SPM.git
//SSH
git@github.com:facephi-clienters/SDK-NFC_component-SPM.git
```

## Available controllers <a href="#id-4-controladores-disponibles" id="id-4-controladores-disponibles"></a>

| **Controller** | **Description**             |
| -------------- | --------------------------- |
| FNFCController | Main NFC reading controller |

## Error handling <a href="#id-7-recepcion-del-resultado" id="id-7-recepcion-del-resultado"></a>

In the error part, **internally** we have the class NFCPassportReaderError. This enum contains many specific errors that do not provide useful information if they are returned to the integrator, so they are transformed into a simpler type (**ErrorType**):

* NFC\_CANCEL\_BY\_USER: The user has canceled the process.
* NFC\_COMPONENT\_LICENSE\_ERROR: The component license is not valid.
* NFC\_EMPTY\_LICENSE: The license String is empty.
* NFC\_EXTRACT\_DATA\_ERROR: Error in the extracted data.
* NFC\_INITIALIZATION\_ERROR: Initialization error.
* NFC\_LAST\_COMMAND\_EXPECTED: Error in the termination command
* NFC\_ERROR: General error
* NFC\_ERROR\_DATA: Error in the input data
* NFC\_ERROR\_DISABLED: NFC disabled
* NFC\_ERROR\_ILLEGAL\_ARGUMENT: NFC with an incorrect tag
* NFC\_ERROR\_IO: Input/output error
* NFC\_ERROR\_NOT\_SUPPORTED: NFC not supported
* NFC\_ERROR\_TAG\_LOST: Connection lost
* NFC\_OPERATION\_NOT\_CREATED: There is no operation in progress.
* NFC\_TIMEOUT: Timeout in the process.

**NOTE**: `NFC_INVALID_MRZ_KEY` *means that the connection could not be established because the configuration input data (documentNumber, birthDate, expiryDate) are not correct. All read attempts for that NFC will fail until a new NFCController is initialized with the correct data.*
