androidads

Ad Consent Android App - How to Clear so can try again


I have programmed the Ad consent for Europeans as per the page:

https://developers.google.com/admob/android/eu-consent

It seems to be working nicely, but I want to clear my choices so it thinks I have no made a choice yet, so I can retest. How can this be done?


Solution

  • You can either uninstall and reinstall the app, or just clear the app data on the device or emulator by going to "Settings -> Apps & Notifications -> Your App -> Storage -> Clear Data"

    The Consent SDK information about the user's choice is stored in SharedPreferences, which will be cleared by clearing the data or re-installing the app.

    If you are looking to do this programatically, you can reset the consent status to UNKNOWN manually by calling

    ConsentInformation.getInstance(context).setConsentStatus(ConsentStatus.UNKNOWN);
    

    which should trigger the consent dialog on the next launch at least (depending on where you call this relative to the dialog launch).