How to Stop Firebase from Logging Status Updates When App Is Launched

How to stop Firebase from logging status updates when app is launched

You can disable the debug logging with the flag -FIRDebugDisabled.

You can add it to your scheme:

  1. Select Scheme toolbar
  2. Edit Scheme
  3. Select Run
  4. Click Arguments and add -FIRDebugDisabled

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!

Firebase Analytics (iOS): How to deactivate the logging of events when running an app in the Xcode simulator?

Here is what I ended up using:

func isRunningLive() -> Bool {
#if targetEnvironment(simulator)
return false
#else
let isRunningTestFlightBeta = (Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt")
let hasEmbeddedMobileProvision = Bundle.main.path(forResource: "embedded", ofType: "mobileprovision") != nil
if (isRunningTestFlightBeta || hasEmbeddedMobileProvision) {
return false
} else {
return true
}
#endif
}
if isRunningLive() {
FirebaseApp.configure()
Analytics.setAnalyticsCollectionEnabled(true)
} else {
FirebaseApp.configure()
Analytics.setAnalyticsCollectionEnabled(false)
}

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.



Related Topics



Leave a reply



Submit