AdamEssenmacher/GoogleApisForiOSComponents

Missing consent enums

Opened this issue · 3 comments

First of all thanks for updating maintaining this library.

I've recently updated to version 10.18.0. Unfortunately something is not working properly. It was also not working in version 10.16.0 and also not working using the original nuget package from Microsoft.

I am trying to set the default consent mode for my app by adding 4 keys to the info.plist file:
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key> <true/> <key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE</key> <true/> <key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA</key> <true/> <key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS</key> <true/>

Documentation for this:
https://developers.google.com/tag-platform/security/guides/app-consent?platform=ios&consentmode=advanced#update-consent

Unfortunately these settings seem to be ignored for some reason. Any idea why?

PS. is saw in code that the enum currently misses two options (AdUserData and AdPeronalizationSignals, these two are new since Consent Mode v2 I think).
https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/blob/main/source/Firebase/Analytics/Enums.cs

Because these missing enum values, it is not possible to explicitly override the consent mode like:

Analytics.setConsent([
  .analyticsStorage: .granted,
  .adStorage: .granted,
  .adUserData: .granted,
  .adPersonalization: .granted,
])

Note: this example code is Swift from the official documentation:
https://developers.google.com/tag-platform/security/guides/app-consent?platform=ios&consentmode=advanced#update-consent

Thanks @stefan89. I'm focused right now on incrementally upgrading everything to at least 10.22 before the 1 May privacy manifest doomsday.

I noticed the additional consent enums. Those shouldn't be too hard to add.

Can you explain more about those settings being ignored? How can you tell?

Thank you for the quick response.

I was too fast creating this issue. After 2 days, the consent mode settings finally came in correctly in Google Analytics.
So using the info.plist keys it works fine.

Maybe it is still good to add the consent mode enum values so users of the library can manually override the preferred value in code if they want using the Analytics.SetContent method.

It would be good to add the enums. I'll leave this issue open until it's done. PRs or welcome, or I'll get to it when I can.