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 instance to the AATKitConfiguration object while initializing AATKit. The vendor consent instance should be initialized with an object implementing VendorConsentDelegate.
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;
}
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