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:
- Select Scheme toolbar
- Edit Scheme
- Select Run
- 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
Implementing Unit Testing with iOS
Ipad: Drag a Uitableviewcell from One Uitableviewcontroller and Drop It into Another
Uiwebview Random Crash at [Uiviewanimationstate Release]: Message Sent to Deallocated Instance
iOS Steps to Create Custom Uitableviewcell with Xib File
Still Not Optimized for iPhone 6 and iPhone 6 Plus
iOS 13 - How to Login in In-App Purchase Sandbox Account
Url Scheme "Open Settings" iOS
Open Target="_Blank" Links Outside of Uiwebview in Safari
How to Tell If Your Code Is Running on an iPhone or an Iphone3G
Tableview:Numberofrowsinsection:]: Unrecognized Selector Sent to Instance
How to Create a Glow Around a Sprite via Skeffectnode
iOS Autolayout Vertically Equal Space to Fill Parent View
How to Downscale a Uiimage in iOS by the Data Size
How to Get Uiviewcontroller of a Uiview's Superview in iOS
Text Color Based on Background Image
Slservicetypefacebook Setinitialtext Is Not Working
"'Cdvplugin.H' File Not Found" in Cordova as Component (Cleaver)