28

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:

<FIRAnalytics/DEBUG> Logging event: origin, name, params: app, 
log_something, {
        "_o" = app;
        "full_text" = khbsdpibdsjl;
        name = lwkjbgskljsavdkjl;
    }

I have the debug flag enabled: -FIRDebugEnabled.

Yet in the debugging events console there is NOTHING. I see no devices available, no events being logged, absolutely 0 indication of anything connected. I must be missing something?

edit: I have been following this for setting up Debugging Events. https://firebase.google.com/docs/analytics/debugview#enabling_debug_mode

I am seeing events in the StreamView, but nothing in the debug view even though I have debug mode enabled.

CFowlie
  • 341
  • 1
  • 3
  • 11
  • 1
    For me at least, no events were being logged when I was testing the analytics logging feature on the simulator. However, when I tried it on an actual iPhone, it worked! – mj23 Sep 06 '21 at 02:01
  • This comment was the solution. – Henrik Jun 26 '23 at 08:33

12 Answers12

44

Try this , This is work for me ,

Follow below steps ,

1.In Xcode, select Product → Scheme → Edit Scheme.

enter image description here

2.Select Run from left Menu and Select Arguments tab In the Arguments Passed on + option

add -FIRDebugEnabled

enter image description here

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.

Westy92
  • 19,087
  • 4
  • 72
  • 54
Jaywant Khedkar
  • 5,941
  • 2
  • 44
  • 55
29

Make sure to remove the OS_ACTIVITY_MODE:disable from the Environment Variables in your project scheme if you added it at some point.

  • someone had put `OS_ACTIVITY_MODE=${DEBUG_ACTIVITY_MODE}` in our debug build, which was sometimes enabled and sometimes disabled, depending on what version of XCode you were running – jes5199 Oct 25 '19 at 17:33
28

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!

Dhaval H. Nena
  • 3,992
  • 1
  • 37
  • 50
21

Now it doesn't matter much but still for the people who are getting errors on this issue. Debug mode of firebase analytics does not work sometimes due to issue in GoogleServices-Info.plist file Simply makes these 2 changes.

  1. Set IS_ANALYTICS_ENABLED to YES
  2. Set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE to NO
RKRK
  • 1,284
  • 5
  • 14
  • 18
Abdullah
  • 227
  • 4
  • 13
10

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:

enter image description here

So it's kind of POINTLESS...

Reimond Hill
  • 4,278
  • 40
  • 52
  • On latest firebase version (SPM) i'm not able to log in debug mode using the ProcessInfo.processInfo programmatically. Is it working for you? In order to back it working, I have to set the -FIRDebugEnabled in Xcode settings. – arcangel06 Aug 14 '23 at 08:22
8

I also have the same problems.

1 check your Cocopods' s Firebase version.

  • use pod update Firebase
  • List item
  • make sure that is the latest

2 open debug mode

  • In the Arguments Passed On Launch part
  • add - FIRDebugEnabled.
Aamir
  • 16,329
  • 10
  • 59
  • 65
胡童心
  • 201
  • 2
  • 4
7

I made it possible by writing the following:

func application(_ application: UIApplication, didFinishLaunchingWithOptions, ...) {
    // some other initialization

    FirebaseApp.configure()
    Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}
mr5
  • 3,438
  • 3
  • 40
  • 57
1

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.

leolobato
  • 2,359
  • 3
  • 32
  • 51
1

Had this issue a few days ago, after trying every solution I found on the internet and none of them working, these are the steps I used to finally enabled DebugView to find my device:

  1. Close the app on the device you’re working on

  2. Go to the Firebase console and sign out of your account

  3. Sign back in again, go to the console and select the project you’re working on.

Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.

  1. It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.

Bonus tip:

Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...

When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.

GETEM5
  • 37
  • 1
  • 6
0

I recently had an issue where the Xcode console said everything was fine, and all was being logged and sent, and I had the "-FIRDebugEnabled" and I tried all other suggestions in this thread, but nothing worked. Nothing was being sent to Firebase's DebugView.

Looking through my git-history, I determined the issue occurred due to a pod update, and the solution to my issue was another pod update.

I don't know which pod had failed, but I suspect either Moya, Alamofire or FirebaseAnalytics... after this, I'm strongly considering locking my pod-versions.

Tim Kofoed
  • 61
  • 6
0

I had the same configuration as jaywant-khedkar, but no events or devices were showing up in the Firebase Debug View.

Found out that my pi-hole on my network was eating all the events. So if if you have any kind of ad blocker on your network, disable it and try again.

Happy debugging!

Tristan Richard
  • 3,385
  • 1
  • 15
  • 17
0

If you've done everything that the Firebase documentation states, then it could be that you have the wrong "Debug Device" selected in Firebase Analytics' "Debug View". After changing the debug device in the top left, all my analytics events from before were displayed! So it wasn't that my events weren't being sent to Firebase, I was just seeing the wrong view. Image attached.

Debug Device Picker

Nirvan Nagar
  • 189
  • 3
  • 11