# 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 [AATSimpleConsent](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatsimpleconsent) default initializer and pass any value of the [NonIABConsent](https://ios-sdk.aatkit.com/references/documentation/aatkit/noniabconsent) enum

* `.obtained` if the user has given consent.
* `.withheld` if the user has declined.
* `.unknown` if the user has not set a preference.

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

### Usage

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

```swift
func configureAATKit() {
    let configuration = AATConfiguration()
    ...
    let consent = AATSimpleConsent(nonIABConsent: .obtained)
    configuration.consent = consent
    ...
    AATSDK.initAATKit(with: configuration)
}
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
- (void)configureAATKit {
    AATConfiguration* configuration = [[AATConfiguration alloc] init];
    ...
    AATSimpleConsent *consent = [[AATSimpleConsent alloc] initWithNonIABConsent:NonIABConsentObtained];
    configuration.consent = consent;
    ...
    [AATSDK initAATKitWith:configuration];
}
```

{% endtab %}
{% endtabs %}
