Terms and Privacy Policy Flow
The SDK ships a built-in consent flow based on Google UMP (IAB TCF v2). It detects the user's region, shows the consent form only where required, and applies the result to every mediated ad network automatically.
Requesting Consent
Call requestConsent on your launch activity and initialize the SDK from its callback:
- Kotlin
- Java
EMAManager.requestConsent(this) {
EMAManager.init(
EMAConfiguration.Builder(application, "YOUR_APP_AD_IDENTIFIER").build()
)
}
EMAManager.INSTANCE.requestConsent(this, () -> {
EMAManager.INSTANCE.init(
new EMAConfiguration.Builder(getApplication(), "YOUR_APP_AD_IDENTIFIER").build()
);
return null;
});
note
Once consent is resolved, the SDK applies it to all ad networks. You do not need to bridge consent to any network yourself.
Letting Users Change Consent (Optional)
GDPR requires an entry point where users can revisit their consent choices. isPrivacyOptionsRequired tells you whether that applies to the current user (call it after the consent flow), and showPrivacyOptionsForm opens the form. A common placement is an item in your settings screen, but any entry point works.
- Kotlin
- Java
if (EMAManager.isPrivacyOptionsRequired(context)) {
privacyOptionsItem.isVisible = true
privacyOptionsItem.setOnClickListener {
EMAManager.showPrivacyOptionsForm(this)
}
}
if (EMAManager.INSTANCE.isPrivacyOptionsRequired(context)) {
privacyOptionsItem.setVisibility(View.VISIBLE);
privacyOptionsItem.setOnClickListener(v -> {
EMAManager.INSTANCE.showPrivacyOptionsForm(this);
});
}