Vendor Consent

Handle consent using AATKit 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 AATVendorConsentarrow-up-right instance to the AATConfigurationarrow-up-right object while initializing AATKit. The vendor consent instance should be initialized with an object implementing AATVendorConsentDelegatearrow-up-right.

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

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
}

Last updated