Check UMP consent admob without activity context android

88 views
Skip to first unread message

Click Sol

unread,
Jan 9, 2024, 4:27:59 AM1/9/24
to Google Mobile Ads SDK Developers

Hi , 


I have two questions related to implementation of UMP

First, after read documentation and check the sample code I can't find any method that check consent form without activity context is there any way to check if Consent form required or not without activity context?

Second, I need to load admob ads on Application class, Is there any alternative way check consent on app level and load ads in app level if consent form not required.


Note: canRequestAds() always returns false until you have called requestConsentInfoUpdate()


Mobile Ads SDK Forum Advisor

unread,
Jan 9, 2024, 5:04:58 AM1/9/24
to mk.cl...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

I will check with our team regarding your query and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.

This message is in relation to case "ref:!00D1U01174p.!5004Q02rVUhL:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team

 

Mobile Ads SDK Forum Advisor

unread,
Jan 9, 2024, 1:49:42 PM1/9/24
to mk.cl...@gmail.com, google-adm...@googlegroups.com

Hi Click Sol,

Regarding your three  questions:

1) No it is not possible to check for consent information from the Application Context. requestConsentInfoUpdate() is the correct method but it requires an Activity. That said, I have gone ahead and forwarded this as a request to the engineers to see if this is something we can include in a future update.

2) I am not sure I understand the second point. The Application context for the Google Mobile Ads SDK should be available from any activity using the `getApplicationContext()` API (example), meaning you should be able to do all needed work from an activity context.

3) Correct, canRequestAds() always returns false until you have called requestConsentInfoUpdate(). This is by design, please call requestConsentInfoUpdate() as demonstrated in our sample applications.

Hope this helps,
Nick



ref:!00D1U01174p.!5004Q02rVUhL:ref
Reply all
Reply to author
Forward
0 new messages