Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 872 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 872 Bytes

CMP

Google Consent Management Platform

Step 1

private val consentManager by lazy { ConsentManager(this) }

Step 2

when (BuildConfig.DEBUG) {
    true -> consentManager.initDebugConsent(onConsentResponse = onConsentResponse)
    false -> consentManager.initReleaseConsent(onConsentResponse = onConsentResponse)
}

Step 3

private val onConsentResponse = object : OnConsentResponse {
    override fun onResponse(errorMessage: String?) {
        errorMessage?.let {
            Log.e("TAG", "onResponse: Error: $it")
        }
        loadAds()
    }

    override fun onPolicyRequired(isRequired: Boolean) {
        Log.d("TAG", "onPolicyRequired: Is-Required: $isRequired")
    }
}

Sample Video

Recording.mp4