AdamEssenmacher / GoogleApisForiOSComponents

A community-supported fork of the abandoned Xamarin.iOS.* binding libraries from Microsoft
MIT License
40 stars 7 forks source link

Missing consent enums #8

Open stefan89 opened 2 months ago

stefan89 commented 2 months ago

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: `GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE

GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS ` 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
AdamEssenmacher commented 2 months ago

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?

stefan89 commented 1 month ago

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.

AdamEssenmacher commented 1 month ago

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.