I have setup firebase in both the console and in the app. Everything configures correctly, and events appear to be logging in the app.
Output to console:
<
Make sure to add ONE DASH before -FIRDebugEnabled
I wasted a whole day making silly mistake having missed that DASH
Hope that doesn't happen to others!
I made it possible by writing the following:
func application(_ application: UIApplication, didFinishLaunchingWithOptions, ...) {
// some other initialization
FirebaseApp.configure()
Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}
Check if you have an ad blocker enabled while visiting the Firebase website.
I had uBlock origin enabled and it would block every page (Dashboard, Events, StreamView, DebugView...) and they'd all be blank.
Everything worked as expected as soon as I whitelisted it.
Make sure to remove the OS_ACTIVITY_MODE:disable from the Environment Variables in your project scheme if you added it at some point.
Try this , This is work for me ,
Follow below steps ,
1.In Xcode, select Product → Scheme → EditScheme.
2.Select Run from left Menu and Select Arguments tab In the Arguments Passed on + option
add -FIRDebugEnabled
For detail debug view follow steps DebugView track Firebase doc
To send an event in XCode project follow code below,
Objective C
[FIRAnalytics logEventWithName:@"share_image"
parameters:@{@"name": name, @"full_text": text}];
Swift
Analytics.logEvent("share_image", parameters: ["name": name, "full_text": text])
For events log follow detail steps Log events in Application Firebase doc
Hope this will help someone.
Alternatively you can do that inside your AppDelegate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
var newArguments = ProcessInfo.processInfo.arguments
newArguments.append("-FIRDebugEnabled")
ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
}
---EXTRA---
And just some thoughts:
Regarding
Firebase.Analytics.setAnalyticsCollectionEnabled(true)
If we inspect the method:
So it's kind of POINTLESS...