Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase notification records/log API

Tags:

I'm sending messages to several iOS Apps via FCM by using their HTTP protocol API,

and I need a list of message records including the payload, sent time, and platform like what I could monitor in the Firebase Notification Console.

It seems that messages sent via HTTP API wouldn't be recorded and shown in the console (only those sent manually in the console would).

I haven't found any API documents related to those messaging events/log fetching.

Is there a way to fetch this kind of message information from FCM?

like image 908
bluenowhere Avatar asked Oct 31 '16 10:10

bluenowhere


People also ask

How do I check my Firebase notification log?

You can log into your firebase console and check the Cloud Messaging section for the detailed overview of the notifications sent. You can check this answer as well for better understanding. To understand more about the lifetime of a message, you can see their developer documentation here.

What is FCM collapse_ key?

FCM allows a maximum of four different collapse keys per device to be used by the app server at any given time. In other words, the FCM connection server can simultaneously store four different collapsible send-to-sync messages per device, each with a different collapse key.

What is Registration_ids in FCM?

The registration_ids parameter refers to the Registration Tokens you want to add in that specific Device Group. Described as: An ID generated by the FCM SDK for each client app instance. Required for single device and device group messaging. Note that registration tokens must be kept secret.

What is payload in FCM?

Firebase Cloud Messaging (FCM) is a messaging solution that lets you reliably send messages at no cost to both Android & iOS devices. Using FCM, you can send data payloads (via a message) to a device for a specific application. Each message can transfer a payload of up to 4KB to a client.


2 Answers

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)

enter image description here

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


Update: The FCM Diagnostics page has been disabled since last year.


If you have a Play Dev Console account and if your app is in at least Alpha Testing, you can make use of the Diagnostics and Statistics page. However, if you're looking for an API, there is currently no API available for it.

Otherwise, I think most of the details you need (like the payload and time sent) can be logged from your app server alone.

And just to support what you already mentioned in your post, as stated by @FrankvanPuffelen here:

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.

like image 165
AL. Avatar answered Sep 17 '22 20:09

AL.


If you want to fetch data on push notification client side you could use the BigQuery exports of Analytics data.

Here is a list of events, as you can see there are several events on notifications, including notification_open and notification_send.

Unfortunately notification_send seems to be available only for Android apps. I don't know why since the Firebase GUI console Message Delivery Report does contain iOS sends as well.

like image 28
Giacomo Avatar answered Sep 20 '22 20:09

Giacomo