Skip to main content

Overview

The User Messaging Platform (UMP) SDK helps you manage user consent for personalized advertising in compliance with GDPR (General Data Protection Regulation) and CCPA (California Consumer Privacy Act).
UMP integration requires the adrop-ads-backfill module. Make sure you have completed the Getting Started installation guide first.

Basic Usage

Use the Consent Manager to request user consent after initializing Adrop.
import io.adrop.ads.Adrop
import io.adrop.ads.consent.AdropConsentListener
import io.adrop.ads.consent.AdropConsentResult

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // Call after Adrop.initialize()
        Adrop.consentManager?.requestConsentInfoUpdate(this, object : AdropConsentListener {
            override fun onConsentInfoUpdated(result: AdropConsentResult) {
                if (result.error != null) {
                    Log.e("Consent", "Error: ${result.error}")
                }
            }
        })
    }
}

The consent manager returns one of the following statuses:
StatusDescription
UNKNOWNConsent status not yet determined
REQUIREDConsent required (popup will be shown)
NOT_REQUIREDConsent not required (non-GDPR region)
OBTAINEDConsent already obtained

Debug Settings (Test Mode)

Test GDPR/CCPA consent flows during development:
import io.adrop.ads.consent.AdropConsentDebugGeography

if (BuildConfig.DEBUG) {
    // Set debug geography before requesting consent
    Adrop.consentManager?.setDebugSettings(
        testDeviceHashedIds = listOf("YOUR_HASHED_DEVICE_ID"),  // Check Logcat
        geography = AdropConsentDebugGeography.EEA  // Test GDPR
    )

    // Reset consent for testing
    Adrop.consentManager?.reset(this)
}

Debug Geographies

GeographyDescription
DISABLEDUse actual device location
EEATest GDPR (European Economic Area)
REGULATED_US_STATETest CCPA (California, etc.)
OTHERTest non-regulated regions
Debug settings should only be used during development. Remove or disable them before releasing to production.

Best Practices

Request Early

Request consent as early as possible in your app lifecycle, ideally right after SDK initialization.

Handle Errors

Always handle consent errors gracefully and provide fallback behavior.

Test All Scenarios

Use debug settings to test all consent scenarios (required, not required, obtained) before release.

Respect User Choice

Once consent is obtained or declined, respect the user’s choice and don’t repeatedly ask.