> For the complete documentation index, see [llms.txt](https://docs.1kosmos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1kosmos.com/mobile-sdk/native/ios/api-reference/classes/liveidscannerhelper.md).

# LiveIDScannerHelper

**public class** LiveIDScannerHelper extends **NSObject**

The LiveIDScannerHelper class  work with the Live ID feature.

### Constructors

**public** init(bidScannerView: **BIDScannerView**, overlayFrame: **CGRect**? = nil, liveIdResponseDelegate: **LiveIDResponseDelegate**)

* Creates an object of LiveIDScannerHelper.

| Parameter              |                                                                                                                   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- |
| bidScannerView         | **BIDScannerView**: A custom view to be provided by the application. This is generally used for UI customization. |
| overlayFrame           | **CGRect**: An overlay rect which is placed on top of the BIDScannerView object.                                  |
| liveIdResponseDelegate | **LiveIDResponseDelegate**: The block to execute after the response is received.                                  |

***

### Method Summary

| **void** | startLiveIDScanning(isWithoutLivenessCheck: Bool? = false, dvcID: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil) | <p>- isWithoutLivenessCheck is optional value. By default LiveID scanning will perform the Liveness but when isWithoutLivenessCheck = true SDK will skip the Liveness check.<br>- Starts the LiveID scanning. dvcID (Document Verification Connector Identifier) is optional.<br>- If dvcID is provided, Liveness check is performed using the dvcID<br>- else Liveness check performed using default dvcID set against the License key</p> |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **void** | stopLiveIDScanning                                                                                                                                | Stops Live ID scanning.                                                                                                                                                                                                                                                                                                                                                                                                                     |

### Method Details

#### startLiveIDScanning

startLiveIDScanning(isWithoutLivenessCheck: Bool? = false, dvcID: String? = nil, mobileSessionId: String? = nil, mobileDocumentId: String? = nil)

* Starts the LiveI D scanning. dvcID (Document Verification Connector Identifier) is optional.
* If dvcID is given, Liveness check is performed using  dvcID
*

| Parameter              | Description                                                                                       |
| ---------------------- | ------------------------------------------------------------------------------------------------- |
| isWithoutLivenessCheck | Bool: (Optional) Pass true to skip the liveness check on the image.                               |
| dvcID                  | String: (Optional) Document Verification Connector Identifier.                                    |
| mobileSessionId        | String: (Optional) Unique Session ID that can be used for event tracking or validation purposes.  |
| mobileDocumentId       | String: (Optional) Unique Document ID that can be used for event tracking or validation purposes. |

#### stopLiveIDScanning

**public void** stopLiveIDScanning()

* Stops Live ID scanning.

### Interface Summary

| LiveIDResponseDelegate | Callback for the event when Live ID is captured, face expressions are changed, or face is out of focus. |
| ---------------------- | ------------------------------------------------------------------------------------------------------- |

#### Method Summary

| **void** | faceLivenessCheckStarted()                                                                                                                                                                   | Called when scanner has started liveness check. This protocol method is **Optional**.                             |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **void** | focusOnFaceChanged(isFocused: **Bool**?, message: String?)                                                                                                                                   | Called when if the user's face focus changes within the scanner focus area. This protocol method is **Optional**. |
| **void** | liveIdDetectionCompleted(\_ liveIdImage: **UIImage**?, signatureToken: **String**?, livenessResult: String?, mobileSessionId: String?, mobileDocumentId: String?, error: **ErrorResponse**?) | Called when Live ID scanning is completed. This protocol method is **Required**.                                  |
| **void** | liveIdDidDetectErrorInScanning(error: **ErrorResponse**?)                                                                                                                                    | Called when an error is occurred during Live ID scanning. This protocol method is **Optional**.                   |

**faceLivenessCheckStarted**

**func** faceLivenessCheckStarted()

* Called when the scanner has started liveness check.

**focusOnFaceChanged**

**func** focusOnFaceChanged(isFocused: **Bool**?, message: String?)

* Called when the user's face focus changes within the scanner focus area.

|           |             |                                                                                                              |
| --------- | ----------- | ------------------------------------------------------------------------------------------------------------ |
| isFocused | **boolean** | A flag that indicates if the user's face is in the focus area.                                               |
| message   | **String**  | <p>Message:<br>- Please align the face in the center.<br>- Face is not found.<br>- Multiple faces found.</p> |

**liveIdDetectionCompleted**

**func** liveIdDetectionCompleted(\_ liveIdImage: **UIImage**?, signatureToken: **String**?, String?, livenessResult: String?, mobileSessionId: String?, mobileDocumentId: String?, error: **ErrorResponse**?)

* Called when Live ID scanning is completed.

| Parameters       | Type              | Description                                                                                                                                                           |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| liveIdImage      | **UIImage**       | An image of person's face.                                                                                                                                            |
| signatureToken   | **String**        | A token that carries information about Live ID. This is used to verify if the user's Live ID is modified or not before storing it on the BlockID blockchain platform. |
| livenessResult   | **String**        | JSON String result data of Liveness check.                                                                                                                            |
| mobileSessionId  | **String**        | (Optional) Unique Session ID                                                                                                                                          |
| mobileDocumentId | **String**        | (Optional) Unique Document ID                                                                                                                                         |
| error            | **ErrorResponse** | An object of ErrorResponse.                                                                                                                                           |

**liveIdDidDetectErrorInScanning**

**func** liveIdDidDetectErrorInScanning(error: **ErrorResponse**?)

* Called when an error occurs during Live ID scanning.

| Type  | Parameter         | Description      |
| ----- | ----------------- | ---------------- |
| error | **ErrorResponse** | An error object. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.1kosmos.com/mobile-sdk/native/ios/api-reference/classes/liveidscannerhelper.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
