Message by Google AdMob "Later this year, Google will require all publishers serving ads to EEA and UK users to use a Google-certified Consent Management Platform (CMP). You can use any Google-certified CMP for this purpose, including Google's own consent management solution. If you are interested in using Google's consent management solution, start by setting up your GDPR message and implementing the UMP SDK. Learn more"
I tried to implement this by following their guide. but I don't think their testing way is working. maybe I have to go to the EU to test this. lol
There is no error I faced its a simple and smooth implementation but I am not able to see any content form in my app. Basically its not working.
I found one error, I don't know why it exists in the code which is provided by Google.
Error:
Failed to run Action[load_complete]:
kotlin.UninitializedPropertyAccessException: lateinit property consentForm has not been initialized
at in.example.example.MainActivity.loadForm$lambda$5(MainActivity.kt:138)
at in.example.example.MainActivity.$r8$lambda$jkGgotp8_qLudSBMRBMOaxvo-Zc(Unknown Source:0)
at in.example.example.MainActivity$$ExternalSyntheticLambda0.onConsentFormLoadSuccess(Unknown Source:2)
How I solved this:
I did very little change in loadForm()
UserMessagingPlatform.loadConsentForm(
this,
UserMessagingPlatform.OnConsentFormLoadSuccessListener { form ->
this.consentForm = form
// Rest of your code
// ...
With that little change, you will be able to see the form on your app.
TIP - Use emulator for testing and use "TEST_EMULATOR" in the place of TEST-DEVICE-HASHED-ID
I hope it helps