37

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.

2
  • 2
    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!
    – ewang
    Commented Sep 6, 2021 at 2:01
  • This comment was the solution.
    – Henrik
    Commented Jun 26, 2023 at 8:33

14 Answers 14

52

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.

2
  • 1
    You can understand the effect of the visuals from this answer. Commented Sep 30, 2019 at 12:29
  • 1
    This also helps to run via the VSCode later.
    – Cyber
    Commented Oct 2, 2022 at 11:46
35

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!

6
  • 2
    It has been 3 years since you commented and it still help :D Commented May 5, 2022 at 7:14
  • 1
    still helping. I wasted a whole day trying to figure this out and nothing worked but this
    – Maruta
    Commented Aug 29, 2023 at 9:33
  • 1
    dash was getting omitted for some reason when copy pasted... I had to manually type it in after revisiting scheme. thanks!
    – Mev
    Commented Mar 14, 2024 at 6:10
  • Glad it is still helping! Commented Mar 15, 2024 at 7:07
  • 1
    you saved my day.Thanks a ton !!!
    – vidhya c
    Commented Oct 15, 2024 at 14:58
32

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

1
  • 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
    Commented Oct 25, 2019 at 17:33
25

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
4
  • Thanks a lot. These two keys solved my problem.
    – hakki
    Commented Feb 22, 2021 at 14:56
  • 2
    Does the key FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE is still relevant? new GoogleServices-Info.plist files do not contains such field Commented Nov 2, 2021 at 14:42
  • isn't it FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED Commented Sep 14, 2022 at 11:36
  • @Abdullah, thank you so much! I would not have guessed that the plist would have an analytics flag disabled! Wow.
    – Rethunk
    Commented Aug 4, 2023 at 11:56
13

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...

1
  • 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
    Commented Aug 14, 2023 at 8: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.
2
  • 1
    I getting some very quirky and unstable results. The debug stream works, and suddenly it stops showing events,
    – Yaron Levi
    Commented Jul 23, 2017 at 1:00
  • 1
    The events were recorded once I updated Firebase by updating pods. So it worked for me. Commented Dec 6, 2018 at 10:06
7

I made it possible by writing the following:

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

    FirebaseApp.configure()
    Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}
2
  • 2
    I was skeptical based on comments that it is enabled by default + I had confirmed it was enabled in the plist. But yeah it did not work until I added this line. Commented Mar 27, 2021 at 23:43
  • still relevant? I'm using FirebaseAnalytics and it also comment that the setAnalyticsCollectionEnabled sets to true by default Commented Nov 2, 2021 at 14:56
3

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

0
2

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.

2

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.

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.

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!

0

The response from @Tristan Richard was incredibly helpful! After hours of troubleshooting and trying out all the suggestions, I finally realized that I had installed Adguard DNS. Once I turned it off, everything worked perfectly!

1
  • Please use comment on the correct response instead of posting a new answer
    – Saeed-rz
    Commented Dec 19, 2024 at 15:08
0

You probly cannot believe it but for us, the reason is someone added an AndroidClientID to our iOS Google plist. It works once I have this field removed.enter image description here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.