iOS - Is there are way to retain user's consent data after clearing UserDefaults.

19 views
Skip to first unread message

Cap Mike

unread,
Jun 13, 2025, 2:35:15 AMJun 13
to Google Mobile Ads SDK Developers
Hello Ads SDK Developers, 
I'm using GoogleMobileAds for my iOS app. 
Every time at app launch I will call
requestConsentInfoUpdate(with:completionHandler:) to gather consent information and then call loadAndPresentIfRequired(from:) to show the user consent form if needed. 
This works as expected where the consent form will be presented at first app launch, and for subsequent app launches the consent form won't be shown (as user consent information is already acquired). 
However after I've cleared UserDefaults.standard, all the acquired consent information is also cleared along with it, as a results, next time I launch the app loadAndPresentIfRequired(from:) will show the consent form again. 

I wonder if there is a way to retain the consent information after I've cleared UserDefaults.standard? 
Thanks in advance!

Mobile Ads SDK Forum Advisor

unread,
Jun 13, 2025, 8:45:47 AMJun 13
to google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

Please note that the UMP SDK does not offer any API to retain the consent state after a complete UserDefaults clear. There is no officially supported method to retain consent information once UserDefaults.standard has been cleared.

Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-06-13 12:44:29Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01rfBSo:ref" (ADR-00314169)



Cap Mike

unread,
Jun 16, 2025, 5:49:53 AMJun 16
to Google Mobile Ads SDK Developers
Thanks for the information. 
If that's the case, is there a way to specify another Userdefault suite for UMP SDK to use instead of the UserDefaults.standard?
Reply all
Reply to author
Forward
0 new messages