Google Analytics logs only visible in debug mode with React Native

264 Views Asked by At

I'm using Google Analytics in my React Native app, and I'm facing an issue where I can only see the logs in the overview dashboard when the debug mode is enabled using the adb command adb shell setprop debug.firebase.analytics.app il.co.packageName. When I disable the debug mode by running adb shell setprop debug.firebase.analytics.app .none., the logs stop appearing in the dashboard. However, when I re-enable the debug mode using the first adb command, all the logs start appearing again. I have tried this on both a physical device and an emulator, and the behavior is consistent. The logs are only visible in the Firebase Analytics dashboard when the debug mode is enabled.

I have followed the documentation and properly integrated Firebase Analytics into my React Native project. The necessary configuration files, such as google-services.json, are correctly placed in the project directory.

Here's a snippet of how I initialize Firebase Analytics and log events in my React Native code:

import analytics from "@react-native-firebase/analytics";
    analytics()
      .logEvent("appearance", {
        id: "123456789",
        color: "red",
        via: "ProductCatalog",
      })
      .then(() => {
        console.log("done log");
      });

I have also tried troubleshooting the issue by verifying the initialization of Firebase Analytics and ensuring the correct placement of the configuration files. However, I'm still unable to see the logs in the Firebase Analytics dashboard unless the debug mode is enabled.

I expect the logs to be visible in the Firebase Analytics dashboard consistently, regardless of the debug mode setting.

Can someone please help me understand why the logs are only visible in the debug mode and how I can make them appear consistently in the overview dashboard?

0

There are 0 best solutions below