问题
I'm manually handling firebase notifications by overriding the onHandle intent of the FirebaseMessagingService.
And using the intent I generate a notification.
Is there a way to manually report the notification opened to the Firebase at all because I'm not getting opened statistics reported back to the firebase console.
As above, even when letting firebase notifications get handled per normal, these open notifications are not being reported either.
Thanks!
回答1:
The stats shown in the notifications panel of the Firebase console are only for messages sent from that notification panel. There is currently no way to trigger the stats for messages sent through the Firebase Cloud Messaging API directly.
Update: since late 2018 the Firebase now also reports messages sent through called to the Firebase Cloud Messaging API.
回答2:
For those curious to know my workaround at this time.
We run push campaigns. For each campaign we created a distinct, reusable event. We register the event "campaign_received" and "campaign_opened" When a message is received, we trigger the event. When the notification is opened, we trigger the event.
Then, under each event, we select the event, and we just filer there stats per day, week, month etc.
One needs to select the event to get to the event dashboard area, since the event list view shows the total amount of events sent and or received.
For bespoke notifications, one might reach the 500 event limit quite quickly so be sure to bundle your notifications into re-usable event categories if possible.
回答3:
According to https://firebase.google.com/docs/cloud-messaging/understand-delivery only "Sends" work for data-only messages:
Sends — The data message or notification message has been enqueued for delivery or has been successfully passed to a third-party service like APNs for delivery. See lifetime of a message for more information.
Impressions (available only for notification messages on Android devices) — The display notification has been displayed on the device.
Opens — The user opened the notification message.
来源:https://stackoverflow.com/questions/49574979/not-seeing-opened-firebase-notification-stats