How to Disable/Remove Firebaseanalytics

How to disable/remove FirebaseAnalytics

To disable the collection of data by Firebase Analytics in your app, see the instructions here.

In summary, to disable temporarily, set FIREBASE_ANALYTICS_COLLECTION_ENABLED to NO in the GoogleServices-Info.plist file. To disable permanently, set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES in the same plist file.

Completely disable Firebase/Analytics to stop console spam on app startup

To the best of my knowledge, these two lines:

[[FIRConfiguration sharedInstance] setLoggerLevel:FIRLoggerLevelMin];
[[FIRAnalyticsConfiguration sharedInstance] setAnalyticsCollectionEnabled:NO];

placed very early in the app delegate's didFinishLaunchingWithOptions: will completely disable FireBase analytics, including stopping all the console output.

I've also since discovered that the Google/SignIn cocoapod is deprecated - the recommended one to use is GoogleSignIn (ie. no '/'). If you use GoogleSignIn, then this doesn't have a dependency on Firebase Analytics, so the original problem goes away. Now I have Google Drive support in my app and don't have Firebase Analytics!

How to disable FirebaseAnalytics or Crashlytics completely

Here is how I fixed it
First implement the solution provided on https://stackoverflow.com/a/37529032/11038684

Then set FirebaseScreenReportingEnabled (Boolean) to NO in info.plist

How disable firebase analytics for the whole device ( a test device -android & iOS ) in flutter?

I think I found a way to make that happen. Of course, you have to do the query about which device it is, depending on how you recognize a test device. Probably via packages like "imei_plugin". We recognize this by the APi the app is connected to.

If you know that the device is a test device, then all you have to do is the following:

FirebaseAnalytics().setAnalyticsCollectionEnabled(false);

or true if you want to enable the collection of data.

Disable Firebase Analytics for iOS Debug builds

Firebase collects data for debug mode also.

You can check for debug mode using :

#ifdef DEBUG
analyticsEnabled = false
updateDataCollectionConfiguration()

Canonical way to disable analytics in flutter debug build

I assume you're using Firebase Analytics in Flutter (I don't think there's GA for Flutter). You can use kReleaseMode flag when setting navigatorObservers of MaterialApp and creating FirebaseAnalyticsObserver instance. Here's how I do it in my app (notice that I also use preferences which allow user to turn on/off analytics, as well as desktop platforms where there's no Firebase support which is why I specifically check for Web, iOS and Android platforms):

MaterialApp(
...
navigatorObservers: preferences.isAnalyticsEnabled &&
kReleaseMode &&
(kIsWeb || Platform.isAndroid || Platform.isIOS)
? [
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics()),
]
: [],
...

Disable Firebase in development mode in Android

Checkout https://firebase.google.com/docs/analytics/configure-data-collection?platform=android

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />

To do this automatically add the following line to manifest:

 <meta-data
android:name="firebase_analytics_collection_deactivated"
android:value="@bool/FIREBASE_ANALYTICS_DEACTIVATED"/>

Set different value of boolean for debug and release in your app/build.gradle

buildTypes {
debug {
resValue("bool", "FIREBASE_ANALYTICS_DEACTIVATED", "true")
}
release {
resValue("bool", "FIREBASE_ANALYTICS_DEACTIVATED", "false")
}
}

Disabling Firebase Analytics and App performance

You can enable/disable collection of performance monitoring data from within your application code with:

FirebasePerformance.getInstance().setPerformanceCollectionEnabled(false);

Also see:

  • the Firebase guide on disabling performance monitoring
  • the reference documenation


Related Topics



Leave a reply



Submit