Is there a way to see all the notifications sent via Firebase?
I can't find anything in the docs or anywhere else.
It'd be cool if it is possible over the console, but HTTP would do as well! Any ideas?
Unfortunately, there is no available API as of the moment to retrieve your GCM/FCM logs. However, there's been a recent improvement in the Firebase Notifications console where stats (sent count only for now) for messages sent using the FCM API is included in the Firebase Notification console stats. From my answer in the similar post:
As of August 2018, stats for messages sent using the FCM API are now visible from the console. From the Cloud Messaging section, click on the Reports tab. From there, you will be able to filter by message type (notification, data, and all)
It would seem that the Impressions and Opens are still only available for messages sent using the console. But Sends for sure now counts the messages sent using the FCM API.
Reference: https://firebase.googleblog.com/2018/08/in-app-messaging-crashlytics.html
As you might already know, only notifications sent via the console are visible in the Firebase Console itself. In the left-side panel, just select on the Notifications and you will see the list of Notifications sent using the console.
One approach is also to make use of the Google Play Developer Console, but the app should at least be in Alpha Testing.
Kinda similar posts:
Firebase Cloud Messaging Statistics API
Firebase notification records/log API
Related
Good afternoon!
We’ve faced the problem when we decided to use flurry and firebase for our Android app analytics. It works well in general, except push-notification analytics. We send push notifications via firebase. They are fully automated and sent from our backend. To make things clear, the event has happened and from the backend, it goes to firebase - the title, the text, the picture, FCM user’s token. Push comes and everything’s alright.
But in Events, these pushes are not being tracked. However, Firebase has original events: notification_dismiss notification_open notification_receive
It turned out that events worked only on those pushes that were sent from FCM and it’s unbelievable! In other words: you write text manually and get the statistic but Google says: “you don’t need 90% of statistic for automated pushes”.
So my question is: What shall we do? How can we track automated pushes that are being sent from the backend? Which analytics allows to track push notifications that are being sent from FCM API?
Shall we change analytics for push notifications?
The automatically collected notification events (notification_dismiss notification_open notification_receive) only populate in the Analytics console when the notifications are sent via Notification console.
Push notifications sent through server are not captured as part of the automatically collected notification events.
I am already obtaining successfully the Firebase Cloud Messaging (FCM) device token by using FirebaseInstanceId.getInstance().getToken(). I used the following code to subscribe the client app to a topic:
String topic = "toronto";
FirebaseMessaging.getInstance().subscribeToTopic(topic);
I assume everything is correct but in order to confirm, I would like to have a Graphical User Interface (GUI) provided by FCM to manage, monitor and see all of the devices that are subscribed to specific topics. With the code I used, I would expect to see the topic "toronto", and at least one device subscribed to that topic, for example by showing the FCM device token.
I was reading at https://developers.google.com/instance-id/reference/server#get_information_about_app_instances how it is possible to get information about app instances to find out details about a client app instance's subscriptions, including each topic name and subscribe date, but does FCM provide a GUI to see that?
UPDATE 1:
I was able to subscribe devices to topics and unsubscribe devices from topics. But when I want to confirm/monitor that a device was subscribed successfully, I am using this for example (for privacy I changed values of keys and tokens):
C:\curl>curl -X GET -k --header "Authorization: key=[My key]" "https://iid.googleapis.com/iid/info/[My device token]?details=true"
{"applicationVersion":"22","connectDate":"2017-12-05","attestStatus":"NOT_ROOTED","application":"com.[My app]","scope":"*","authorizedEntity":"[My app ID]","rel":{"topics":{"San-salvador":{"addDate":"2017-12-05"}}},"connectionType":"WIFI","appSigner":"[My signature]","platform":"ANDROID"}
C:\curl>
I was expecting Firebase Cloud Messaging to provide a Graphical User Interface with a dashboard, charts and reports to see the topics that have been created and the list and number of devices subscribed to each of the topics, something similar to the Google Analytics reports, maybe even with maps to see where devices are subscribing from or anything visual that can help to visualize and monitor topic subscriptions. Instead, I am having to do everything with cURL with code similar to what I am showing in this UPDATE 1. I am surprised Firebase Cloud Messaging does not provide a GUI, since the tool comes from Google and they could easily provide a dashboard or something similar to Google Analytics.
FCM currently doesn't have a GUI that displays the list/count of topics you have or the subscribers (count/registration tokens) the topic has.
At most, you could use the Instance ID API (the one from your post) to check a single registration token to which topics it is subscribed to. However, do note that the Instance ID API was meant to be used on your Server side.
Other than that, you will have to implement your own mapping with the topics (which tokens are subscribed to it).
Kinda similar/possibly helpful posts:
Firebase Cloud Messaging - Check existing or available Topics
Count subscribers of a topic in Firebase Cloud Messaging
Android/Firebase - Check to see if you are subscribed to topic
Firebase Cloud Messaging - Managing Registration Tokens
Is there a way to send a message to an entire application instead of a list of devices / topic outside the Firebase console?
Inside the console you can accomplish this like so:
But if I'm using their API, I can't find a way to send the message to the app.
I have found a workaround (subscribing every app to the same topic) that works perfectly, but I would prefer the app option.
Once you subscribe users of your app to a topic, every user gets the message sent to that topic.
You can't send message to the entire users of your app with API without a topic. It only works in Firebase Console. See this explanation: FCM (Firebase Cloud Messaging) how to send to all Phones?
I am just starting using Firebase in my Android App. I can receive perfectly a notification from Firebase console on my device, that's amazing.
My question to you is, in the firebase console when you see the messages sent in Notifications, when I open a sample notification, I can not see the people who i sent the notifiacion, opened the notifaction, the conversions that i have.
Am I missing something? Should I implement anything to response to server with device-id?
Thanks.
Notification events stats are found in the Analytics tab. Firebase automatically logs some events for you - see list here.
You are not missing anything, it's just that the information about sent, open and conversions events it's not in realtime . Indeed it will take few hours for that information to be computed and presented in the console.
Is signup for "Upstream Google Cloud Messaging and User Notifications Sign-up" at link "https://services.google.com/fb/forms/gcm/" compulsory to get notification from server app to device?
I have created sample app and sending the sample notification from server. i m getting "OK" response along with message_id, i assume that means my message has been accepted by GCm bit the message is not getting delivered to registered Device? I read somewhere with GCM, registration to the link above is required. I tried that too but i didnt get any response back from google. am i missing anything?
Harshil.
Yes, it is compulsory. When sending a message through GCM, you need to specify a SENDER_ID which is given to you when you create a Project inside, and for this, you have to sign up. So even if you got an OK response, I doubt you specified a correct SENDER_ID so this message probably got discarded.
Maybe this might help:
How to send location of the device on server when needed
As of June 2014, sign-up is no longer required for GCM upstream user notifications (among other features).
There's a post on the Android Developer Blog with more info. Specifically:
At Google I/O we announced the general availability of several GCM
capabilities, including the GCM Cloud Connection Server, User
Notifications, and a new API called Delivery Receipt. This post
highlights the new features and how you can use them in your apps. You
can watch these and other GCM announcements at our I/O
presentation.