# Vendor Consent

### Introduction

You should consider using AATKit’s Vendor Consent, in case you want to utilize a CMP that AATKit has not yet adapted with its ManagedConsent. In that case, you might want to pass individual consents (coming from your CMP) to specific non-IAB compliant ad networks/vendors.

To use it, you should pass an [VendorConsent](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-vendor-consent/index.html) instance to the [AATKitConfiguration](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-a-a-t-kit-configuration/index.html) object while initializing AATKit. The vendor consent instance should be initialized with an object implementing [VendorConsentDelegate](https://android-sdk.aatkit.com/references/-a-a-t-kit/com.intentsoftware.addapptr/-vendor-consent/-vendor-consent-delegate/index.html).

Vendor Consent will also automatically read the IAB consent string stored (by third-party CMP) in SharedPreferences (if available). This means that the value returned by `getConsentForAddApptr` will only be used if there is no IAB TCF2.0 consent stored.

### Usage

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

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

// VendorConsentDelegate implementation

@NonNull
@Override
public NonIABConsent getConsentForNetwork(@NonNull AdNetwork network) {
    switch (network) {
        case ADMOB:
            return NonIABConsent.OBTAINED
            break;
        case APPLOVIN:
            return NonIABConsent.WITHHELD
            break;
        default:
            return NonIABConsent.UNKNOWN
    }
}

@NonNull
@Override
public NonIABConsent getConsentForAddapptr() {
    return NonIABConsent.OBTAINED;
}
```

{% endtab %}

{% tab title="Kotlin" %}

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

//VendorConsentDelegate implementation
override fun getConsentForNetwork(network: AdNetwork): NonIABConsent {
    return when (network) {
        AdNetwork.ADMOB -> NonIABConsent.OBTAINED
        AdNetwork.APPLOVIN -> NonIABConsent.WITHHELD
        else -> NonIABConsent.UNKNOWN
    }
}

override val consentForAddapptr: NonIABConsent
    get() = NonIABConsent.OBTAINED

```

{% endtab %}
{% endtabs %}
