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 VendorConsentarrow-up-right instance to the AATKitConfigurationarrow-up-right object while initializing AATKit. The vendor consent instance should be initialized with an object implementing VendorConsentDelegatearrow-up-right.

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

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;
}

Last updated