googleads / googleads-consent-sdk-android

Consent SDK
https://developers.google.com/admob/android/eu-consent
Apache License 2.0
100 stars 82 forks source link

Please expose consentData.getPublisherIds #60

Open frevds opened 6 years ago

frevds commented 6 years ago

If an update request fails, the saved consent is for some publishers that might be different to currently used publisher ids, and there is no way to find out about that.

rampara commented 6 years ago

@frevds at different points in your app are you collecting consent for different publisher ids? I'm not sure I understand why this value would change.

frevds commented 6 years ago

@rampara When ConsentData is saved, it is linked to one or more publisherIds (and their ad providers) for which consent was given. Imagine a new publisher ID is later added to a game, and the saved consents will now all be incomplete. There is no way to determine whether the saved consent was given for the new publisherId as well, without a call to requestUpdate. Only after the call to requestUpdate it might notice a difference in the ad providers and invalidate the saved consent. I'm writing a plugin that uses the ads with the consent SDK. In my plugin, banners and interstitials show non-personalized ads by default and only switch to personalized ads if consent is available (saved or newly consented) or not necessary as by the location. I cannot know which publisher IDs the user of the plugin will specify when, but I must make sure that if the user uses banners and interstitials before initializing the consent and before requestUpdateConsentInfo is called, that the banner and interstitials check for consent. They can only check for a saved consent, they CANNOT call requestUpdateConsentInfo, because that would invalidate the saved consent if they don't specify the WHOLE list of publisherIDs in the call (which is not known by the plugin). So I NEED a way to find out (in the banner in the plugin) whether the consent was saved for a specific PublisherId, namely the publisher from the AdUnitID the banner/interstitial is using. Long story short - I'm using reflection now to get that information from the ConsentData, but it would be way easier (for others) if one had a property for that.