Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling Debug Mode for Firebase Analytics for Flutter

I want to test receiving Firebase Analytics events on my development device. The documentation here says you need to do this by adding a command line argument to Xcode.

To enable Analytics Debug mode on your development device, specify the following command line argument in Xcode :

-FIRDebugEnabled

How are you supposed to do this for Flutter? When you're using it through VS Code or via flutter run?

Update

I tried following the answer here but to no avail. I think Flutter uses Xcode build, so perhaps it makes sense that adding the params to the run scheme doesn't work with flutter?

I also tried setting IS_ANALYTICS_ENABLED to true in GoogleService-Info.plist, but also didn't seem to work.

Update 2

I've gotten the events to now show up in the Debug Events Console on Firebase, but only if I launch the app from Xcode. If I do so from Flutter it still wont send the events (which is what I'm trying to accomplish).

like image 863
thefoxrocks Avatar asked May 23 '20 17:05

thefoxrocks


People also ask

How do I enable debug mode in Firebase Analytics?

To enable Analytics debug mode in your browser, install the Google Analytics Debugger Chrome extension. Once installed, enable the extension and refresh the page. From that point on, the extension will log events in your app in debug mode. You can view events logged in the DebugView in the Firebase console.

How do I use Firebase Analytics in Flutter app?

To use Firebase Analytics in a Flutter application, first you have to integrate the project with the Firebase account. In the Firebase Console, you probably need to define some new custom dimensions or metrics if you want to set custom user properties or log custom events.

What is debug view Google Analytics?

The DebugView report shows you data (from events, event parameters, and user properties) as Analytics collects the data. The report can help you set up data collection, troubleshoot issues as issues arise, and understand a user's behavior as the user explores your website or app.

What is Firebase Analytics in flutter?

Metadata. Flutter plugin for Google Analytics for Firebase, an app measurement solution that provides insight on app usage and user engagement on Android and iOS.


2 Answers

Open Xcode

  1. SelctProduct->Scheme > Edit scheme
  2. Select Run from the left menu.
  3. Select the Arguments tab. In the Arguments Passed On Launch section, add -FIRAnalyticsDebugEnabled.

Answered at Turning Firebase Analytics on on Xcode for greater visibility added the link and answer both, Credit should the owner of this answer @checklist.

like image 80
Rubiya Faniband Avatar answered Sep 18 '22 08:09

Rubiya Faniband


I think you might need to use Flutter flavors to pass the FIRDebugEnabled flag when you start the app with flutter run instead of through XCode. Please see https://medium.com/@salvatoregiordanoo/flavoring-flutter-392aaa875f36

like image 35
Tom Bailey Avatar answered Sep 22 '22 08:09

Tom Bailey