Hi Liran Barsisa,
Thank you for contacting the Mobile Ads SDK Support team.
By reviewing your concern, I understand that you are facing issues with a situation where obtaining consent information in your Android app is causing some issues related to memory and performance.
If you're facing problems with memory leaks and performance, you might consider the following approaches:
Use Application Context Instead of using the Activity context. The Application context doesn't have the same lifecycle as an Activity, so you won't run into issues like memory leaks related to holding references to activities.
UserMessagingPlatform.getConsentInformation(getApplicationContext());
For checking cache you need to implement the readFromCache(), isCacheExpired(), and handleConsentInformation() methods according to your caching strategy.
ConsentInformation cachedConsentInfo = readFromCache();
if (cachedConsentInfo != null && !isCacheExpired()) {
// Use cached information
handleConsentInformation(cachedConsentInfo);
} else {
// Fetch new consent information
requestConsentInfoUpdate();
}
Kindly share the below information to investigate further.
![]() |
Mobile Ads SDK Team |
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/1CM5e000000000000000000000000000000000000000000000S5N08700Luq9-3FsQiyEr3-G8n0Uuw%40sfdc.net.