# Simple Consent

### Introduction

{% hint style="info" %}
Nowadays, using a Simple Consent management is no longer recommended. Please consider using an industry standard consent management such as the [IAB Transparency & Consent Framework](https://iabeurope.eu/transparency-consent-framework/) and connecting it via Managed or Vendor Consent.
{% endhint %}

To set if the user has given or withheld consent for the collection and use of personal data (used for non-IAB partners), use the [SimpleConsent](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-simple-consent/index.html) default initializer and pass any value of the [NonIABConsent](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-non-i-a-b-consent/index.html) enum

* `OBTAINED` if the user has given consent.
* `WITHHELD` if the user has declined.
* `UNKNOWN` if the user has not set a preference.

If `SimpleConsent` is used, AATKit will automatically read the IAB consent string stored (by third-party CMP) in SharedPreferences (if available) and respect the settings for Gravite.

### Usage

{% tabs %}
{% tab title="Java" %}

```java
private void configureAATKit() {
    AATKitConfiguration configuration = new AATKitConfiguration(this);
    ...
    Consent consent = new SimpleConsent(NonIABConsent.OBTAINED);
    configuration.setConsent(consent);
    ...
    AATKit.init(configuration);
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
private fun configureAATKit() {
    val configuration = AATKitConfiguration(this)
    ...
    val consent: Consent = SimpleConsent(NonIABConsent.OBTAINED)
    configuration.consent = consent
    ...
    AATKit.init(configuration)
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://aatkit.gitbook.io/android-integration/start/consent/simple-consent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
