Push Notification With Analytics Label showing 0 for Received, impression and open count

133 views Asked by At

I am recently working on a Node.js server application where I have a feature to send the notifictaion using admin-firebase sdk to my android app.

I added the analytic-label to the message options and I received the notification. But, when I check the report label, it is only showing 0 for Received, impression and open count. enter image description here

Since I am working with android, I have already added this dependencies implementation platform('com.google.firebase:firebase-bom:29.0.4') implementation 'com.google.firebase:firebase-inappmessaging-display' and implementation 'com.google.firebase:firebase-analytics'

and here is the basic example of my code for the node.js server app

  async sendPushNotification(data?: SendMessageFirebaseDTO) {
    // const { content, token } = data;
    const message = {
      notification: {
        title: 'test me',
        body: 'test meeee',
      },
      token:
        'eiieoeoeoeoetest',
      fcm_options: {
        analytics_label: 'test-label',
      },
    };

    (await this.firebaseAdmin())
      .messaging()
      .send(message)
      .then((response) => {
        this.logger.log(`Successfully sent push message: ${response}`);
      })
      .catch((error) => {
        this.logger.log(`Error sending push message: ${error}`);
      });
  }

is there some steps I am missing ?

0

There are 0 answers