> 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/android-sdk/componentes-modulos/terminos-y-condiciones.md).

# Terms and conditions

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

Acceptance of the terms and conditions of use is handled by the ***Terms Conditions Component***.

This component captures the user's response to a set of terms and conditions of use. Its main processes are:

* Launching an HTML text viewer.
* Capturing the user's response.

The [Simplified Launch](https://docs.facephi.com/docs.facephi-en/sdks/sdk-mobile/android-sdk/inicializacion/lanzamiento-simplificado.md) section describes the steps required for basic SDK integration. This section provides information on launching this component.

## Dependency <a href="#id-2-dependencia" id="id-2-dependencia"></a>

The component-specific dependency is:

```
implementation "com.facephi.androidsdk:terms_conditions_component:$version"
```

## Available controllers <a href="#id-3-controladores-disponibles" id="id-3-controladores-disponibles"></a>

<table data-header-hidden><thead><tr><th width="193.87109375"></th><th></th></tr></thead><tbody><tr><td><strong>Controller</strong></td><td><strong>Description</strong></td></tr><tr><td>TermsConditionsController</td><td>Main controller for capturing acceptance of the terms</td></tr></tbody></table>

## Simplified Launch

Once the SDK has been initialized and a new operation has been created, you can launch the component. You can use any of its controllers to run its functionality.

Launching the capture:

```kotlin
val response = SDKController.launch(
    TermsConditionsController(TermsConditionsConfigurationData(...))
)
when (response) {
    is SdkResult.Error -> Napier.d("ERROR - ${response.error.name}")
    is SdkResult.Success -> response.data
}
```

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

To launch this component, create a *TermsConditionsConfigurationData* object, which will configure the component's controller.

The basic configuration required is as follows:

```kotlin
TermsConditionsConfigurationData(
  termsConditions = "...html..."
)
```

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

The launch returns the information in SdkResult format. You can distinguish between a successful and an unsuccessful launch:

```
when (response) {
    is SdkResult.Error -> Napier.d("ERROR - ${response.error}")
    is SdkResult.Success -> Napier.d("Accepted")
}
```

### Error handling <a href="#id-61-recepcion-de-errores" id="id-61-recepcion-de-errores"></a>

Errors are returned as a 'TermsConditionsError' object. Each error exposes the fields `name`, `reason` and `code` (some also include an `error` field with additional information).

List of errors (name and code):

* `CANCEL_BY_USER` (`TER_000`): The user canceled the process
* `TIMEOUT` (`TER_001`): Process timed out
* `COMPONENT_LICENSE_ERROR` (`TER_002`): The component license is invalid
* `EMPTY_LICENSE` (`TER_003`): The license string is empty
* `INITIALIZATION_ERROR` (`TER_004`): Initialization error
* `NO_DATA_ERROR` (`TER_005`): Input data is null
* `OPERATION_NOT_CREATED` (`TER_006`): There is no operation in progress
* `CANCEL_LAUNCH` (`TER_007`): A general SDK cancellation has been performed
* `ACTIVITY_RESULT_MSG_ERROR` (`TER_650`): The activity result is incorrect
* `APPLICATION_CONTEXT_ERROR` (`TER_651`): The required application context is null
* `FETCH_DATA_ERROR` (`TER_652`): Error retrieving the result
* `MANAGER_NOT_INITIALIZED` (`TER_653`): Managers are null
* `FLOW_VIDEO_RECORDING_ERROR` (`TER_654`): Error recording video in the flow
* `FLOW_TRACKING_ERROR` (`TER_655`): Error tracking the flow
* `TRACKING_STEP_ERROR` (`TER_656`): Error in the tracking step
* `INTERNAL_ERROR` (`TER_657`): Internal error
* `USER_REJECTED_TERMS_AND_CONDITIONS` (`TER_658`): The user has rejected the terms and conditions
* `FLOW_ERROR` (`TER_659`): Error in the flow process

### Successful result received - *data* <a href="#id-62-recepcion-del-resultado-correcto-data" id="id-62-recepcion-del-resultado-correcto-data"></a>

The user will have accepted the terms if SdkResult.Success is received. The returned data is an object *TermsConditionsResult* with no fields.

***

## Advanced information <a href="#id-7-informacion-avanzada" id="id-7-informacion-avanzada"></a>

This section provides additional information about the component.

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

To launch this component, create a *TermsConditionsConfigurationData* object, which will configure the component's controller.

All the fields that are part of this class are described below.

* `termsConditions`: Text of the terms and conditions of use to be shown to the user
* `extractionTimeout`: Sets the maximum time (in milliseconds) allowed for capture. Default value: 60000.

***

## Component customization <a href="#id-8-personalizacion-del-componente" id="id-8-personalizacion-del-componente"></a>

In addition to the changes that can be made at the SDK level (which are explained in the document on [SDK Customization](https://docs.facephi.com/docs.facephi-en/sdks/sdk-mobile/android-sdk/personalizacion.md)), this particular component also allows its interface to be modified.

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

To modify the SDK text, include the following XML file in the client's application and change the value of each *String* to the desired value.

| **Name**                                   | **Value**                                                                              |
| ------------------------------------------ | -------------------------------------------------------------------------------------- |
| disclaimer\_widget\_agree\_button          | Accept                                                                                 |
| disclaimer\_widget\_decline\_button        | Decline                                                                                |
| disclaimer\_widget\_cancel\_alert\_title   | Decline GDPR                                                                           |
| disclaimer\_widget\_cancel\_alert\_desc    | Declining the GDPR terms will end the current session. Do you want to end the session? |
| disclaimer\_widget\_cancel\_alert\_accept  | Log Out                                                                                |
| disclaimer\_widget\_cancel\_alert\_dismiss | Cancel                                                                                 |
