others-how to disable firebase data collection before user consent?
1. Purpose
You know for now, every app needs to provide a user-agree UI to show the privacy policy to users, and the app can not get any information from users until users click the Agree
or Accept
button, just as the following picture shows(an example of privacy policy agree UI):
But if we integrate the firebase sdk, how to control the behaviour of the firebase sdk?
2. Solution
According to this website,add the below lines to your application in androidmanifest.xml
:
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
<meta-data android:name="google_analytics_ssaid_collection_enabled" android:value="false" />
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
The most important line is:
<meta-data android:name="google_analytics_ssaid_collection_enabled" android:value="false" />
The above line disable the firebase SDK to collect the ANDROID_ID
before user consent.
3. Summary
In this post, I demonstrated how to disable the privacy-related behaviours of firebase SDK. That’s it, thanks for your reading.