Android Question How to deactivate Firebase Analytics and Crashlytics via "opting out"?

fredo

Well-Known Member
Licensed User
Longtime User
Firebase has great advantages for the operator of an app in terms of software quality and marketing. It uses cookie-like technologies to run the Google Analytics service.

In order to comply with the legal requirements of users regarding data privacy, the user should be given the opportunity to deactivate Firebase Analytics and Crashlytics by "opting out".

Does anyone have any experience with how to do this in practice?

Possibly set a persistent flag and force an app to restart, skipping the Firebase.init?​
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
https://firebase.google.com/docs/re...setanalyticscollectionenabled-boolean-enabled

B4X:
Dim jo As JavaObject = FirebaseAnalytics
jo.RunMethod("setAnalyticsCollectionEnabled", Array(False))

Note that this setting is persisted.

Opting out from Crashlytics requires two steps:
https://firebase.google.com/docs/cr...orts?platform=android#enable_opt-in_reporting

1. Add to manifest editor:
B4X:
AddApplicationText(
<meta-data
    android:name="firebase_crashlytics_collection_enabled"
    android:value="false" />
)
2. Call Crashlytics.Initialize for opt-in users.
 
Upvote 0
Top