> 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/sdks/sdk-mobile/ios-sdk/modulos/captura-de-huellas.md).

# Fingerprint Capture - Phingers

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

The *Component* covered in the current document is called ***Phingers Component***. It is responsible for capturing the user's fingerprints and the subsequent extraction of the fingerprint templates. Its main functionalities are as follows:

* Two operating modes: extraction of the four fingers of the hand (except the thumb), or extraction of only the thumb.
* Internal camera management.
* Permission management.
* Built-in liveness detection.
* Assistant in the fingerprint capture processes.
* Generation of templates with fingerprint features, images, and scores.

In the section of [Simplified Launch](/docs.facephi-en/sdks/sdk-mobile/ios-sdk/inicializacion/lanzamiento-simplificado.md) the steps necessary for the basic integration of the SDK are detailed. In this section, information is added for launching 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

```sh
pod 'FPHISDKMainComponent', '~> $VERSION'
```

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

```sh
pod 'FPHISDKPhingersTFComponent', '~> $VERSION'
```

* Once the dependencies are installed, the different functionalities of the component can be used.

### **SPM**

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

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

* To install the Selphid component, the following must be included in the project's modules:

<pre class="language-swift"><code class="lang-swift"><strong>//HTTPS
</strong>https://github.com/facephi-clienters/SDK-PhingersTF_Component-SPM.git
//SSH
git@github.com:facephi-clienters/SDK-PhingersTF_Component-SPM.git
</code></pre>

## Permissions

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

```
It is necessary to allow use of the camera (Privacy - Camera Usage Description)
```

## Available controllers

<table data-header-hidden><thead><tr><th width="184.63671875"></th><th></th></tr></thead><tbody><tr><td><strong>Controller</strong></td><td><strong>Description</strong></td></tr><tr><td>PhingersController</td><td>Main fingerprint capture controller</td></tr></tbody></table>

## Simplified Launch

```swift
let controller = PhingersController(data: phingersConfigurationData, output: { sdkResult in
        // Do whatever with the result
        ...
    }, viewController: viewController)
SDKController.shared.launch(controller: controller)

```

## Basic configuration <a href="#id-5-configuracion-basica" id="id-5-configuracion-basica"></a>

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

The basic configuration required for it is as follows:

```swift
static var phingersConfiguration: PhingersConfigurationData{
   var configPhingers = PhingersConfigurationData()
   configPhingers.reticleOrientation = .LEFT
   configPhingers.fingerFilter = .SLAP
   return configPhingers
}
```

The different orientations are:

* LEFT
* RIGHT

The different filters are:

* SLAP
* ALL\_4\_FINGERS\_ONE\_BY\_ONE
* ALL\_5\_FINGERS\_ONE\_BY\_ONE
* INDEX\_FINGER
* MIDDLE\_FINGER
* RING\_FINGER
* LITTLE\_FINGER
* THUMB\_FINGER

## Receiving the result <a href="#id-7-recepcion-del-resultado" id="id-7-recepcion-del-resultado"></a>

The controllers will return the necessary information in SdkResult format.

### Receiving errors <a href="#id-71-recepcion-de-errores" id="id-71-recepcion-de-errores"></a>

In the error section, we will have the common class *ErrorType:*

* PHG\_CANCEL\_BY\_USER: The user has canceled the process.
* PHG\_COMPONENT\_LICENSE\_ERROR: The component license is not correct.
* PHG\_EMPTY\_LICENSE: The license String is empty.
* PHG\_INITIALIZATION\_ERROR: Initialization error.
* PHG\_INTERNAL\_ERROR: Internal error.
* PHG\_LOW\_QUALITY: Low image quality.
* PHG\_OPERATION\_NOT\_CREATED: There is no operation in progress.
* PHG\_CAMERA\_PERMISSION\_DENIED: The user has denied the permissions.
* PHG\_CAMERA\_FAILURE: Camera failure.
* PHG\_FINGERPRINT\_TEMPLATE\_IO\_ERROR: IO failure
* PHG\_NO\_FINGERS\_DETECTED: Fingerprint detection error
* PHG\_TIMEOUT: Timeout in the process.

### Successful execution response - *data* <a href="#id-72-recepcion-de-ejecucion-correcta-data" id="id-72-recepcion-de-ejecucion-correcta-data"></a>

In the part of *data*, we will have the class *PhingersResult*.

The field *data* is variable and will depend on which component returned the result. In the case of this component, the returned fields are as follows:

#### **Fingers**

**position**

Returns an integer that represents the captured item. This value is set according to the instructions of NIST\_POS\_CODE.

**displayImage**

Contains the processed image.

**wsq**

The fingerprint in WSQ format.

**minutiaesNumber**

Returns the number of minutiae found in the biometric capture.

**quality**

Integer representing the quality of the processed item.

**nistQuality**

Integer representing the quality of the processed item using NIST standards.

**nist2Quality**

Integer representing the quality of the processed item using an alternative version of the NIST standards.

**livenessScore**

Contains a value of the confidence indicator in the capture.

**template**

Contains the generated template.

#### **SlapImages**

**position**

Returns an integer that represents the captured item. This value is set according to the instructions of NIST\_POS\_CODE.

**image**

Contains the processed image.

**livenessScore**

Contains a value of the confidence indicator in the capture.

## Advanced information

This section expands the component information.

### Advanced component configuration <a href="#id-71-configuracion-avanzada-del-componente" id="id-71-configuracion-avanzada-del-componente"></a>

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

Below are all the fields that are part of this class.

**reticleOrientation**

Configures which hand will be captured. Allowed values are:

* **LEFT**: Activates capture of the fingers of the **left**.
* **RIGHT**: Activates capture of the fingers of the **right**.

**fingerFilter**

Configures the fingerprint detection mode that will be used during capture. Allowed values are:

* **INDEX\_FINGER**: Configures capture with the **index**.
* **MIDDLE\_FINGER**: Configures capture with the **middle**.
* **RING\_FINGER**: Configures capture with the **ring**.
* **LITTLE\_FINGER**: Configures capture with the **little**.
* **THUMB\_FINGER**: Configures capture with the **thumb**.
* **SLAP**: Configures the capture of the **four** fingers in a single photo.
* **ALL\_4\_FINGERS\_ONE\_BY\_ONE**: Configures the capture of the **four** fingers taking one photo for each of them.
* **ALL\_5\_FINGERS\_ONE\_BY\_ONE**: Configures the capture of the **five** fingers taking one photo for each of them.

**templateType**

Specifies the template with which the fingerprint will be returned in the result. The enumerated ***TemplateType*** has the following possible values:

* **ISO\_TEMPLATE**: This template refers to the standard **ISO/IEC 19794-4**.
* **NIST\_TEMPLATE**: This template refers to the NIST standard.
* **NIST\_TF\_TEMPLATE**: **This is the default value.** This template refers to a variant of the NIST standard that facilitates processing and evaluation of the sample.

**extractionTimeout**

Sets the maximum time allowed for reading.

**showPreviousTip**

Shows a screen before capture launch with information about the process to be carried out and a button to launch it.

**showTutorial**

Indicates whether the component enables the tutorial screen. In this view, how capture is performed is explained intuitively.

**vibrationEnabled**

If set to true, vibration is activated on errors and if the widget response is OK.

**showDiagnostic**

Show diagnostic screens at the end of the process.

**livenessThreshold**

Configures the **liveness** threshold of the fingerprint detector. Replaces the old single parameter **`threshold`** (from **2.8.1**). **Default value: 0.9.**

**detectorThreshold**

Configures the threshold of the **detector** of fingerprints. Replaces the old single parameter **`threshold`** (from **2.8.1**). **Default value: 0.9.**

{% hint style="warning" %}
In versions **2.8.0** and earlier there was a single parameter **`threshold`** (default **0.7**). When updating to **2.8.1**, replace it with **`livenessThreshold`** and **`detectorThreshold`** (default **0.9**).
{% endhint %}

**enableFlash**

Activates the flash during capture. **Default value: `false`.** From **2.8.1**, the flash can also be activated automatically if the process detects **low light** in the image to improve the capture process, even if the parameter is set to `false`.

**showEllipses**

Draws an ellipse during capture when a possible fingerprint is detected.

**cropWidth & cropHeight**

Indicates a width and height to perform a crop of the capture.

**showPreviousFingerSelector**

Indicates whether the "showPreviousFingerSelector" screen is shown or not.

**fingerSelectorHandOrientation**

Indicates which hand options will be shown on the screen `PreviousFingerSelectorView`.

**fingerSelectorOptions**

Indicates which finger options will be shown on the screen `PreviousFingerSelectorView`.

## Component customization

Apart from the changes that can be made at the SDK level (which are explained in the document of *SDK Customization*), this particular component allows modification of its interface.

### Texts <a href="#id-81-textos" id="id-81-textos"></a>

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 necessary for the functionality of ***VoiceOver***.

```xml
<!-- Previous Tip -->
    <string name="phingers_widget_tip_title">Fingerprint Capture</string>
    <string name="phingers_widget_tip_message">Place your finger inside the mark</string>
    <string name="phingers_widget_tip_message_alt">Place your finger inside the mark</string>
    <string name="phingers_widget_tip_button">Start</string>
    <string name="phingers_widget_tip_button_alt">Start fingerprint capture</string>
    <string name="phingers_widget_tip_close_button_alt">Back</string>
    <string name="phingers_widget_tip_info_button_alt">See tips</string>
    <string name="phingers_widget_tip_anim_desc">Instruction animation for fingerprint capture</string>
    <!-- Previous Tip (specific types) -->
    <string name="phingers_widget_tip_title_left_slap">Left hand fingerprints</string>
    <string name="phingers_widget_tip_message_left_slap">Put your fingers together. Move your hand closer or farther until your fingerprints are in focus.</string>
    <string name="phingers_widget_tip_title_right_slap">Right hand fingerprints</string>
    <string name="phingers_widget_tip_message_right_slap">Put your fingers together. Move your hand closer or farther until your fingerprints are in focus.</string>
    <string name="phingers_widget_tip_title_left_finger">Left hand fingerprints</string>
    <string name="phingers_widget_tip_message_left_finger">Focus the index finger in the box. Move the finger closer or farther until your fingerprint is in focus.</string>
    <string name="phingers_widget_tip_title_right_finger">Right hand fingerprints</string>
    <string name="phingers_widget_tip_message_right_finger">Focus the index finger in the box. Move the finger closer or farther until your fingerprint is in focus.</string>
    <string name="phingers_widget_tip_title_thumb">Thumb fingerprint</string>
    <string name="phingers_widget_tip_message_thumb">Focus the thumb in the box. Move the finger closer or farther until your fingerprint is in focus.</string>
    <!-- Finger selector -->
    <string name="phingers_widget_selector_hand_question">Which hand will you use?</string>
    <string name="phingers_widget_selector_hand_left">Left</string>
    <string name="phingers_widget_selector_hand_right">Right</string>
    <string name="phingers_widget_selector_secondary_question">Which fingerprints do you want to scan?</string>
    <string name="phingers_widget_selector_option_index">Index finger</string>
    <string name="phingers_widget_selector_option_middle">Middle finger</string>
    <string name="phingers_widget_selector_option_ring">Ring finger</string>
    <string name="phingers_widget_selector_option_little">Little finger</string>
    <string name="phingers_widget_selector_option_thumb">Thumb finger</string>
    <string name="phingers_widget_selector_option_all4">4 fingers (index, middle, ring, and little)</string>
    <string name="phingers_widget_selector_option_all4_sequence">4 fingers (one by one)</string>
    <string name="phingers_widget_selector_option_all5_sequence">5 fingers (one by one)</string>
    <string name="phingers_widget_selector_primary_button">Continue</string>
    <!-- Capture -->
    <string name="phingers_widget_capture_close_button_alt">Back</string>
    <!-- Tutorial -->
    <string name="phingers_widget_tutorial_message_1">Place your face in the center and look straight at the camera.</string>
    <string name="phingers_widget_tutorial_message_2">Remove any element covering your face.</string>
    <string name="phingers_widget_tutorial_message_3">Find a well-lit environment, without shadows on your face.</string>
    <string name="phingers_widget_tutorial_message_1_anim_desc">The photo is taken when the person is in the center.</string>
    <string name="phingers_widget_tutorial_message_2_anim_desc">A person removes their sunglasses and moves their hair away from their eyes.</string>
    <string name="phingers_widget_tutorial_message_3_anim_desc">The image appears dark and a person turns on the light.</string>
    <string name="phingers_widget_tutorial_close_button_alt">Back to the previous tutorial</string>
    <!-- Confirmation -->
    <string name="phingers_widget_image_captured">Image captured</string>
    <string name="phingers_widget_confirmation_message">Does your photo look clear and sharp?</string>
    <string name="phingers_widget_confirmation_retry">Retry</string>
    <string name="phingers_widget_confirmation_continue">Continue</string>

    <!-- Camera status (ES) -->
    <string name="phingers_widget_camera_status_position_fingers">Place your fingers inside the mark</string>
    <string name="phingers_widget_camera_status_processing">Processing…</string>
    <string name="phingers_widget_camera_status_too_far">Move your hand closer</string>
    <string name="phingers_widget_camera_status_too_close">Move your hand farther away</string>
    <string name="phingers_widget_camera_status_low_focus">Move your finger to focus</string>
    <string name="phingers_widget_camera_status_good_focus">Keep your finger still</string>
    <string name="phingers_widget_camera_status_wrong_angle">Place your finger vertically</string>
    <string name="phingers_widget_camera_status_too_few">The finger has not been detected</string>
    <string name="phingers_widget_camera_status_too_many">Multiple fingers detected</string>
    <string name="phingers_widget_camera_status_wrong_hand_left">You must place the left-hand finger</string>
    <string name="phingers_widget_camera_status_wrong_hand_right">You must place the right-hand finger</string>
    <string name="phingers_widget_camera_status_error">Capture error</string>
    <string name="phingers_widget_camera_status_timeout">Capture time out</string>
    <string name="phingers_widget_camera_status_success">Fingerprint captured!</string>
    <string name="phingers_widget_camera_status_keep_hand_steady">Keep your hand steady</string>
    <string name="phingers_widget_timeout_desc">The capture has exceeded the time limit. Try again.</string>

    <!-- Dynamic finger hint (ES) -->
    <!-- %1$s = side (left/right), %2$s = finger (index/middle/ring/little/thumb) -->
    <string name="phingers_widget_hint_place_finger_mark">Place your %2$s %1$s inside the mark</string>
    <string name="phingers_widget_side_left">left</string>
    <string name="phingers_widget_side_right">right</string>
    <string name="phingers_widget_finger_index">index</string>
    <string name="phingers_widget_finger_middle">middle</string>
    <string name="phingers_widget_finger_ring">ring</string>
    <string name="phingers_widget_finger_little">little</string>
    <string name="phingers_widget_finger_thumb">thumb</string>
```

Thus, if you want to modify for example the text “*Start*” of the key `phingers_widget_tip_button` for the language **es**, you must go to the file **Localizable.strings** of the folder **es.lproj** if it exists (if not, it must be created) and there, add:

`"phingers_widget_tip_button"="Start";`

If a message is not specified in the language file, it will be filled with the default message.

## Animations

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

```
phingers_anim_left_finger
phingers_anim_left
phingers_anim_right_finger
phingers_anim_right
phingers_anim_thumb_right
phingers_anim_thumb_left
```
