> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/mobile/ios/consent-screen.md).

# Consent Screen

The screen is instantiated as a dialog on top of your app so it is important to take this into consideration if you have any navigation that is expected and whether to show it from a view controller or from a navigation controller

### Show the screen

1. The below snippet will show the consent dialog

```
 SIDConsentManager.Builder(tag: <String>
  ,partnerLogo: <UIImage>
  ,partnerName: <String>
  ,privacyPolicyUrl: <String>)
  .setDelegate(delegate: self)
  .build()
  .start()
```

* **tag** \<STRING>This is important that it matches the same tag which may have been or will be used to capture the selfie and or id card document as it will determine if the job will be submitted or not when consent is required for the id type
* **partnerLogo** \<UIImage> This is a bitmap typically the app icon, so the user is familiar with what they will finally see which the SDK will present on the consent screen
* **partnerName** \<STRING>This is the company name that will be presented on the consent screen
* **privacyPolicyUrl** \<STRING> This is a link to a valid web page that contains your company's privacy policy the user can click this and view the privacy policy.
* **delegate** This is an instance of the protocol **SIDConsentManagerDelegate**

  has two methods decline and approve which means the user has declined or approved your consent request.
* start() This method will finally show the view controller.

![](/files/49jgt5LWkDOoHhWahy92)

## BVN Consent Screen

The SDK has prebuilt screens to request consent from a user before running a job with the BVN ID Type.

The screen is instantiated as a screen so it is important to take this into consideration if you have any navigation that is expected and whether to show it from a view controller or a navigation controlller

Show the consent when ready

```
SIDConsentManager.Builder(tag: <String>
  ,partnerLogo: <String>
  ,bundleId: <String>
  ,partnerName: <String>
  ,privacyPolicyUrl: <String>
  ,environment: <Boolean>
  ,bvnDelegate: <BVNConsentResultDelegate>)
  .setCountry(country: "NG")
  .setIdType(idType: "BVN_MFA")
  .build()
  .start()
```

{% hint style="info" %}
If `ENVIRONMENT` is set to `false` (for sandbox), enter the following on the screen for BVN and OTP:\
\
BVN: 00000000000\
OTP: 000000\
\
Any other BVN or OTP will return invalid errors
{% endhint %}

| Parameter        | Description                                                                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| tag              | This is a local unique job identifier which you can use to identify the end to end process for this job which should be an alphanumeric string |
| bundleId         | The bundle identifier of the logo image                                                                                                        |
| IdType           | Can be BVN or BVN\_MFA the user will be shown BVN as the id type they are consenting to                                                        |
| partnerName      | The company name to be shown to the user                                                                                                       |
| privacyPolicyUrl | A valid url to your company's privacy policy                                                                                                   |
| environment      | `true` for production and `false` for sandbox                                                                                                  |
| bvnDelegate      | An instance of a class that conforms to `BVNConsentResultDelegate`                                                                             |
| partnerLogo      | The file name of the company logo to be displayed                                                                                              |

BVNConsentResultDelegate

An instance of the listener of type `BVNConsentResult` that will get the callback results as per the user actions and api results the interface is defined for

1. onError\
   This will return an error with the tag and the error instance with a code and a message for the reason

```java
func onError(tag:String ,bvnConsentError:BVNConsentError );
```

Possible `ERROR_VALUE` are

* `CONFIG_ERROR_PARTNER_NAME_MISSING` Missing partner name
* `CONFIG_ERROR_PARTNER_LOGO_MISSING` Missing partner Logo
* `CONFIG_ERROR_CANNOT_LAUNCH` Error with your configuration please check documentation
* `USER_INPUT_DECLINED` User declined consent summary
* `NETWORK_ERROR` A network error occurred
* `AUTH_SMILE_ERROR` An error occurred with auth smile
* `INIT_CONSENT_ERROR` An error occurred after inputing the BVN number this may be the user entered an invalid BVN error or there was a connection issue whilst initiating consent
* `CONTACT_METHOD_ERROR` An error occurred after selecting the mode (sms/email) or the user clicked this is likely a network or server error
* `CONTACT_METHODS_INVALID_ERROR` An error occurred because the presented mode of confirmation are no longer valid for the user so they clicked these are invalid
* `CONFIRM_CONSENT_ERROR` An error occurred during OTP validation

2. onSuccess\
   This will return a success with a tag identifier, the entered bvnNumber and the sessionId to be used when submitting a job as identified in the [product](/integration-options/mobile/flutter/products-and-job-types.md) you are running by adding a `session_id key`. with the value returned as sessionid as part of the SIDUserIdInfo

```java
func onSuccess(tag:String , bvnNumber:String ,sessionId:String );
```

This will present the below screens and If at any point the screens encounter an api or user error these are dismissed and will return the respective result viea the BVNConsentError callback

#### BVN Consent Summary Screen

<figure><img src="/files/XbizloZMLW5eTc5tudS5" alt=""><figcaption></figcaption></figure>

#### BVN Number Screen

<figure><img src="/files/ARYSsgUGEHlSzLcu2k5y" alt=""><figcaption></figcaption></figure>

#### BVN Mode Selection Screen

<figure><img src="/files/orOtTPd90Zql5YhlEYhj" alt=""><figcaption></figcaption></figure>

#### BVN OTP Screen

<figure><img src="/files/D33A6PCHURq3wZ0mudVw" alt=""><figcaption></figcaption></figure>


---

# 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://legacy-docs.usesmileid.com/integration-options/mobile/ios/consent-screen.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.
