# 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 [AATVendorConsent](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatvendorconsent) instance to the [AATConfiguration](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatconfiguration) object while initializing AATKit. The vendor consent instance should be initialized with an object implementing [AATVendorConsentDelegate](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatvendorconsentdelegate).

Vendor Consent will also automatically read the IAB consent string stored (by third-party CMP) in NSUserDefaults (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="Swift" %}

```swift
func configureAATKit() {
    let configuration = AATConfiguration()
    ...
    let consent = AATVendorConsent(delegate: self)
    configuration.consent = consent
    ...
    AATSDK.initAATKit(with: configuration)
}
// MARK: AATVendorConsentDelegate
func getConsentForNetwork(_ network: AATAdNetwork) -> NonIABConsent {
    switch network {
        case .INMOBI:
            return .obtained
        case .ADMOB:
            return .withheld
        case .APPLOVIN:
            return .unknown
        ...
    }
}

func getConsentForAddapptr() -> NonIABConsent {
    return .obtained
}
```

{% endtab %}

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

```objectivec
- (void)configureAATKit {
    AATConfiguration* configuration = [[AATConfiguration alloc] init];
    ...
    AATVendorConsent *consent = [[AATVendorConsent alloc] initWithDelegate:self];
    configuration.consent = consent;
    ...
    [AATSDK initAATKitWith:configuration];
}

#pragma mark - AATVendorConsentDelegate
- (enum NonIABConsent)getConsentForAddapptr {
    return NonIABConsentObtained;
}

- (enum NonIABConsent)getConsentForNetwork:(enum AATAdNetwork)network {
    switch (network) {
        case AATAdNetworkINMOBI:
            return NonIABConsentObtained;
            break;
        case AATAdNetworkADMOB:
            return NonIABConsentWithheld;
            break;
        case AATAdNetworkAPPLOVIN:
            return NonIABConsentUnknown;
            break;
        ...
    }
}
```

{% 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/ios-integration/start/consent/vendor-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.
