Currently I use the following code to configure the Firebase Analytics:
analyticsEnabled = // Fetch whether the analytics should be enabled
FirebaseApp.configure()
// analyticsEnabled = false can be added here for DEBUG builds
updateDataCollectionConfiguration()
}
@objc public static func updateDataCollectionConfiguration() {
Analytics.setAnalyticsCollectionEnabled(analyticsEnabled)
}
I've added a line, where I can force disable analytics for debug builds, but the two questions are still relevant - whether it's needed (is such analytics data even collected for debug builds) and is there any "simpler" way to achieve the same goal, e.g. filter debug-data in the Firebase Console?
Firebase collects data for debug mode also.
You can check for debug mode using :
#ifdef DEBUG
analyticsEnabled = false
updateDataCollectionConfiguration()