Recently I implemented consent dialog for users based on https://developers.google.com/admob/ump/android/quick-start
Today I received the next issue in my Admob account:
IAB TCF v2.0 errors detected. We've detected an issue on your IAB TC string on one or more of your sites or apps. These errors may affect your ability to serve ads to European users. A detailed report is available for you on the EU user consent page.
I pressed "GO TO EU USER CONSENT" button and this was shown:
Downloaded csv file, here's content:
iab_tcf_errors_12_3_2020.csv
Mobile App,Ad unit,Error,Error count,Last detected date
com.*.*,7579454036,1.2,140,12/2/2020
com.*.*,3141515571,1.2,140,12/1/2020
Error code 1.2 from https://support.google.com/adsense/answer/9999955:
Consent code in my app (userConsentSDKSetup
is called in onCreate
of launch activity):
fun userConsentSDKSetup() {
val params = ConsentRequestParameters.Builder().build()
val information = UserMessagingPlatform.getConsentInformation(activity)
information.requestConsentInfoUpdate(
activity,
params,
{
// The consent information state was updated.
// You are now ready to check if a form is available.
if (information.isConsentFormAvailable && information.consentStatus == ConsentInformation.ConsentStatus.REQUIRED) {
activity.lifecycleScope.launchWhenStarted {
loadUserConsentForm(information)
}
}
},
{ Timber.e("userConsentSDK error ${it.message}") }
)
}
private fun loadUserConsentForm(information: ConsentInformation) {
UserMessagingPlatform.loadConsentForm(
activity,
{ consentForm ->
if (information.consentStatus == ConsentInformation.ConsentStatus.REQUIRED) {
activity.lifecycleScope.launchWhenStarted {
consentForm.show(activity) { // Handle dismissal by reloading form.
loadUserConsentForm(information)
}
}
}
}
) { Timber.e("userConsentSDK error loadForm ${it.message}") }
}
So what is wrong here? How can I solve this issue?