-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛] Analytics opt-in key in firebase.json not carried into iOS plist file #4473
Comments
Hi there! Your versions are out of date, so you'll need to update them prior to any reproduction having actual predictive value. Please do that as a necessary first step then report back It does seem like you're setting things correctly You may also need to do a full / clean build before the firebase.json settings are ingested as I believe they are "rendered" at build time into the AndroidManifest and plist https://firebase.google.com/docs/analytics/configure-data-collection?platform=ios (that is also how you could do this manually instead of relying on firebase.json to render it out, as a workaround) Perhaps that is it. I'm not sure that is clear from the documentation - that a clean build is needed At the same time I don't see the analytics settings rendered into the plist where I would expect them to be 🤔 https://github.com/invertase/react-native-firebase/blob/master/packages/app/ios_config.sh - though I might be missing exactly where things connect. Careful inspection of the plist post build to see what keys end up in there might be warranted |
Thanks for the reply @mikehardy, I'll look into this next week and will get back with the results. |
Hello 👋, to help manage issues we automatically close stale issues.
|
First of all, sorry for not coming back to this earlier, some higher priority issues came up. Unfortunately, the behavior is still exactly the same after upgrading to 10.2.0. However, if I set Thanks for syncing the component versions, the previous setup with different component versions was a complete mess to try to keep up-to-date in relation to each other. |
No problem at all, I totally understand time constraints. Thanks for circling back and reporting
Okay, so the firebase-ios-sdk is working correctly (that's the plist toggle) but for some reason we haven't hooked up firebase.json to plist correctly as you mention. I'll re-title this and label it for further investigation Note (related to time constraints) that the fastest way to resolve this will always be a PR, and there should be a pattern to follow with either crashlytics or admob ids going from firebase.json file to plist file
Yeah - credit where it's due the firebase-ios-sdk team started it after asking users their pain points, and after they synchronized their versioning I decided it seemed like a positive step so did it here. I was worried people would be scared since it looks like a big version bump but it is quite nice as a maintainer too. Cheers |
I can confirm that doing the same for Android, i.e. adding the relevant key/value to AndroidManifest.xml had the same effect, i.e. opt-in started to work. Would love to make a fix for this but there is just barely time to do all the worky-work stuff I need to do. Maybe, someday... |
Issue
We need to use an opt-in strategy for our analytics collection due to legal reasons. However, based on what I'm seeing in both production and Firebase's DebugView, it looks like the
analytics_auto_collection_enabled
setting infirebase.json
has no effect. Events are being sent until the user turns off collection in the app settings UI. I couldn't find any reference in the codebase that would be reading this setting, the only references are in docs and the type definition, hence I suspect the actual behaviour differs from what the documentation suggests. I have tested this only on iOS for now but I'd assume Android sports the same issue, as we're seeing way too many events in production when considering this should be an opt-in feature.We have set
analytics_auto_collection_enabled
to false infirebase.json
and in the settings UI we useanalytics().setAnalyticsCollectionEnabled
to toggle collection on/off.Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:package.json
aboveFirebase
module(s) you're using that has the issue:TypeScript
?React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: