Ionic-native/firebase:3.4.4 - analytics events not showing up


#1

I am using the firebase plugin for notification, what is working well and now I want to use analytics as well but I don’t see any events showing up in the firebase console.

Since the notification are working I assume that the configuration of the firebase plugin is correct.

My initialise looks like:

this.firebase.getToken().then(token => /* store the token */).catch(err => /* log error */); //working well
this.firebase.onTokenRefresh().subscribe(token => /* store the token */); //working well
this.firebase.onNotificationOpen().subscribe(data => /* handle notification */); //working well

on my pages I do the following:

ionViewDidEnter() {
  this.firebase.setScreenName("Home");
}

someAction() {
  this.firebase.logEvent("goto_details", {button: 'small'});
}

These events are not showing up in my firebase console. Did I miss anything to set up the firebase plugin? Any working example of using the firebase plugin and a working analytics would be helpful. Haven’t found anything on the ionic documentation nor on the plugin github page.


#2

Hi there,
I’m using firebase 4.6.1 and I have a really similar issue.
In my app.component I can do

this.firebase.getToken()
      .then(token => this.logger.debug('all is good')) // save the token server-side and use it to push notifications to this device
      .catch(error => this.logger.error('error', error));

without any error.
However, when I want to log an event on Firebase with

this.firebase.logEvent('myEventId').then(
        (data)=>{
          console.log('we sent an event!');
        },
        (error)=>{
          console.log("ERROR MSG")
          console.log(error)
        }
      )

I see in my console the expected message (‘we sent and event!’) but my dashboard in Firebase doesn’t show anything.
What I’m missing here?
Thx a lot in advance! :slight_smile: