> For the complete documentation index, see [llms.txt](https://valify.gitbook.io/valify-ios-sdk-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valify.gitbook.io/valify-ios-sdk-documentation/biometrics/ios-native-sdk/sdk-response.md).

# SDK Response

The response of the SDK will return in the following delegate

```swift
func onLivenessResult(VIDVLivenessResponse: VIDVLivenessResponse)
```

It will return an enum result of type `VIDVLivenessResponse`&#x20;

### `VIDVLivenessResponse` Cases

`success` : Process finished successfully

`capturedActions`: Images captured are returned in real-time

{% hint style="info" %}
Note: In `capturedActions, the returned` images are not processed yet
{% endhint %}

`userExit` : Process terminated by the user with no errors

`serviceFailure` : Process finished with the user's failure to pass the service requirements

`builderError` : Process terminated due to an error in the builder

#### Example

```swift
switch result {
case .success(let data):
    // data of type VIDVLivenessResult
case .builderError(let code, let message):
    // builder error code & error message
case .serviceFailure(let data, let code, let message):
    // service faluire error code & error message & data of type VIDVLivenessResult
case .userExit(let data, let step):
    // last step in the SDK & data of type VIDVLivenessResult
case .capturedImages(capturedActions: let capturedActions):
    // capturedActions of type capturedActions
    
}
```

{% hint style="info" %}
Note: Check your configurations
{% endhint %}

### Primary Response Object

`VIDVLivenessResult`

{% hint style="info" %}
Note: This is the first-level object that contains all the second-level objects
{% endhint %}

### Object Body

* `facematchTransactionID` \<string>
* `facematchSuccess` \<boolean>
* `livenessSuccess` \<boolean>
* `capturedImage` \<base64-string>
* `auditRequired` \<boolean>
* `auditCaseCreated` \<boolean>&#x20;

<details>

<summary><code>hmacDataList</code> &#x3C;list></summary>

* `serviceID:` ocr
* `hmacDigest` \<string>
* `rawResponse` \<string>

</details>

{% hint style="info" %}
The raw response in `hmacDataList` should be mapped to the result object as per the [HMAC Validation Documentation ](https://valify.gitbook.io/documentation/response-data-validation)
{% endhint %}

### Instance Responses

<mark style="color:blue;">`Success`</mark>

* `vidvLivenessResult` \<object>

<mark style="color:blue;">`CapturedActions`</mark>&#x20;

<details>

<summary><code>capturedActions</code> &#x3C;object></summary>

* `id` \<int>
* `action` \<string>
* `faceSample` \<base64-string>
* `status` \<boolean>

</details>

{% hint style="info" %}
`capturedAction` contains the images captured of the user's face during the SDK experience
{% endhint %}

<mark style="color:blue;">`UserExit`</mark>

* `vidvLivenessResult` \<sub-object>
* `step` \<string>

{% hint style="info" %}
Note: step \<string> identifies the point where the user chose to exit the SDK
{% endhint %}

<mark style="color:red;">`ServiceFailure`</mark>

* `errorCode` \<int>
* `errorMessage` \<string>
* `vidvLivenessResult` \<object>

<mark style="color:red;">`BuilderError`</mark>

* `errorCode` \<int>
* `errorMessage` \<string>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://valify.gitbook.io/valify-ios-sdk-documentation/biometrics/ios-native-sdk/sdk-response.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
