How to check the successfully received rate of firebase cloud message notification? - firebase

I am using firebase api call to send the notification to the users and I want to check how many users got the notifications. I read the documentation of firebase but was unable find how to check send rate, if there is any api call for that. When I send notification to all the users from firebase admin panel after some time firebase start showing send rate and open rate.
I want to know how to get this data if I send the notification through the api call?

Related

Flutter push notification using FCM by topic

hello I'm new to flutter and trying to get push notification in flutter , I have successfully subscribed the user to a topic and sent a notification through the firebase console by topic , what I'm trying to do is to have a button for admins in the app and when they post for a particular topic the users with that topic get the notification I have heard about cloud functions but I don't know exactly where to start ! i hope I made my point ! I have seen some videos that talks about type script but is there is any workaround this ?
The Firebase documentation names notifying the user when something interesting happens as an example use-case. From there:
Developers can use Cloud Functions to keep users engaged and up to date with relevant information about an app. Consider, for example, an app that allows users to follow one another's activities in the app. Each time a user adds themselves as a follower of another user, a write occurs in the Realtime Database. Then this write event could trigger a function to create Firebase Cloud Messaging (FCM) notifications to let the appropriate users know that they have gained new followers.
The function triggers on writes to the Realtime Database path where followers are stored.
The function composes a message to send via FCM.
FCM sends the notification message to the user's device.
To review working code, see Send FCM notifications.

how to send data message to user segment From Rest API

I'm using Advanced REST API to send data message for push notification.
In firebase console i can select user segment
as "Version","language",Country" etc..But how to select user segment for
Data message sent from REST API?
Or is their any other way to use select User segment for data message?
Also i want to send the notification for the user who has not opened app for few days.Is it possible with firebase data message?
When using the FCM rest API to send message, you can't target Analytics user segments. You can only send to devices identified by their unique token, or to topics where the client app is subscribed. The only way to send a message to a user segment is through the Firebase console.

Enabling the notification feature for my firebase app

I have made an app with the use of firebase. It is basically a chat application in which you van send and receive the text and images. I want to add a functionality in it that whenever a user sends a msg, then another user should get a notification . When I try to send a notification through the firebase console, then it is working, but when a user messages through the app, then it is not showing any notification to another user. So, can anyone tell me that how can this functionality be achieved ?Also, provide some sample code to see how things are working
You need to use cloud functions for that:
https://firebase.google.com/docs/functions
Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests
First, you can register the user to a topic:
FirebaseMessaging.getInstance().subscribeToTopic("news");
https://firebase.google.com/docs/cloud-messaging/android/topic-messaging
Then when the message is sent to the database, you can use onWrite() in cloud functions which is a database trigger to be able to send the notification.
https://firebase.google.com/docs/functions/database-events

How to reflect push notifications sent by API on Firebase console

We are using Firebase API (CURL to https://fcm.googleapis.com/fcm/send) to send push notifications to multiple devices by topic but when we send them these are not reflected on the console. We can only see notifications sent by the console.
Thanks in advance!
firebaser here
The charts in the Firebase Notifications console only reflect messages sent from that console. It does not count messages sent by the Firebase Cloud Messaging API.
Also see my answer here: Is it possible to get push notification stats like count of deliveries and opens when sending messages through Firebase notification API?

Firebase Cloud Messaging Statistics API

I'm using an application server to send messages by Firebase Cloud Messaging.
Firebase console does not list such a message which sent by app server.
When I use Firebase console directly to send messages, it will display some analysis on its own messages.
Like this:
The questions is, how can I access message statistics when I'm using an app servers?
As of August 2018 (announced in this blog post), API send stats can be viewed in the "Reports" tab of the FCM console. By default it only shows notification type messages, so if you're only sending data messages with the API, be sure to choose the "Data" filter.
Before August 2018:
The Firebase Notifications charts only show analytics for messages that were sent using the Firebase Notifications panel.
There is currently no public API to send Notifications to audiences. The web interface in the console is the only way to send them.
There is currently no API to feed your own FCM messages into the Firebase Notifications analytics panels.

Resources