---
title: Receiving the result
canonical: https://developer.unico.io/dual-api/developers/sdks-and-tools/ios/capture-flow/receiving-the-result
locale: en
generated_by: markdown-export
---

The SDK returns the capture result through callbacks defined in the delegate interfaces used during the capture session.

## AcessoBioSelfieDelegate

****`onSuccessSelfie`****

Called when the image is captured successfully. Returns a `SelfieResult` object with:

  - **`base64`** — captured image; can be used to display a preview in your application.
  - **`encrypted`** — JWT payload that must be sent to your backend to complete biometric validation via the REST API.

  ### Swift

    ```swift
    func onSuccessSelfie(_ result: SelfieResult!) {
      let base64 = result.base64
      let encrypted = result.encrypted // JWT to send to your backend
    }
    ```

### Objective-C

    ```objectivec
    - (void)onSuccessSelfie:(SelfieResult *)result {
      NSString *base64 = result.base64;
      NSString *encrypted = result.encrypted; // JWT to send to your backend
    }
    ```

  :::danger[`encrypted` usage]
  - The `encrypted` attribute is strictly intended for sending the image through the by Client APIs. It must not be opened, serialized, or modified — its characteristics may change without prior notice. It must be sent to the API within **10 minutes** of capture. Unico is not responsible for any damages resulting from improper handling.
  - The `base64`/`encrypted` files may vary in size depending on device quality, generated photo size, and Unico's business rules. **Do not limit the size** of the string generated by the SDK in your programming logic or infrastructure.
  :::

  :::tip[Base64 to bitmap]
  If you need to convert `base64` to a bitmap, the standard method does not work directly on iOS — split the string at the comma (`,`) first. See [How to convert a Base64 string into a Bitmap image to show it in an ImageView?](https://stackoverflow.com/questions/4837110/how-to-convert-a-base64-string-into-a-bitmap-image-to-show-it-in-a-imageview).
  :::

****`onErrorSelfie`****

Called when an error occurs during capture. Returns an `ErrorBio` object with `getCode()` and `getDescription()`. See [Error handling](/developers/sdks-and-tools/ios/error-handling) for the full list of error codes and recommended handling.

  ### Swift

    ```swift
    func onErrorSelfie(_ errorBio: ErrorBio!) {
      let code = errorBio.getCode()
      let description = errorBio.getDescription()
    }
    ```

### Objective-C

    ```objectivec
    - (void)onErrorSelfie:(ErrorBio *)errorBio {
      NSString *code = [errorBio getCode];
      NSString *description = [errorBio getDescription];
    }
    ```

## AcessoBioDocumentDelegate

****`onSuccessDocument`****

Called when the document image is captured successfully. Returns a `DocumentResult` object with:

  - **`base64`** — captured image; can be used to display a preview.
  - **`encrypted`** — JWT payload that must be sent to your backend within **10 minutes** and must never be modified or deserialized.

  ### Swift

    ```swift
    func onSuccessDocument(_ result: DocumentResult!) {
      let base64 = result.base64
      let encrypted = result.encrypted // JWT to send to your backend
    }
    ```

### Objective-C

    ```objectivec
    - (void)onSuccessDocument:(DocumentResult *)result {
      NSString *base64 = result.base64;
      NSString *encrypted = result.encrypted; // JWT to send to your backend
    }
    ```

****`onErrorDocument`****

Called when an error occurs during document capture. Returns an `ErrorBio` object. See [Error handling](/developers/sdks-and-tools/ios/error-handling) for the full list of error codes.

  ### Swift

    ```swift
    func onErrorDocument(_ errorBio: ErrorBio!) {
      let code = errorBio.getCode()
      let description = errorBio.getDescription()
    }
    ```

### Objective-C

    ```objectivec
    - (void)onErrorDocument:(ErrorBio *)errorBio {
      NSString *code = [errorBio getCode];
      NSString *description = [errorBio getDescription];
    }
    ```