Google Consent Management Platform
private val consentManager by lazy { ConsentManager(this) }
when (BuildConfig.DEBUG) {
true -> consentManager.initDebugConsent(onConsentResponse = onConsentResponse)
false -> consentManager.initReleaseConsent(onConsentResponse = onConsentResponse)
}
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")
}
}