16

i know after posting message google will send back a message ID and it does not mean that the message was already delivered to the device.

is there anyway to receive delivery reports of sent notifications in FCM?

AL.
  • 36,815
  • 10
  • 142
  • 281
Payam Kokabi
  • 222
  • 1
  • 2
  • 15

2 Answers2

13

Yes, the message_id only identifies that the message was successfully delivered to the FCM servers.


December 17, 2019 - FCM Update

FCM has removed ongoing support for delivery reciepts via the XMPP protocol. In place of XMPP delivery receipts, developers should enable delivery data export in the FCM client SDK.

What I think you're looking for is Delivery Receipts:

Delivery Receipt: If the app server included delivery_receipt_requested in the downstream message, the XMPP connection server sends a delivery receipt when it receives confirmation that the device received the message.

AL.
  • 36,815
  • 10
  • 142
  • 281
  • can we get the reports without using xmpp? – Akshatha S R Sep 11 '19 at 04:57
  • Or do you have an example using xmpp to get delivery receipts? – Akshatha S R Sep 11 '19 at 04:58
  • @AkshathaSrinivas If its just reports, FCM has [this feature now](https://stackoverflow.com/a/42711266/4625829). I haven't had the chance to work on a project that has this requirement yet, so no. Cheers! – AL. Sep 11 '19 at 05:52
  • my requirement is, if the notification is not delivered to a device, I want to resend it. – Akshatha S R Sep 11 '19 at 09:15
  • 2
    Not working anymore:( https://firebase.google.com/support/releases#december_17_2019 December 17, 2019 FCM has removed ongoing support for delivery reciepts via the XMPP protocol. In place of XMPP delivery receipts, developers should enable delivery data export in the FCM client SDK. – Edd Feb 27 '20 at 14:08
  • Thanks @Edd. Updated it in. – AL. Feb 27 '20 at 17:36
  • In our firebase console, notification reports page is showing no data. We are sending 1000's messages via API. Is there something missing, how to view these metrics in firebase console ? We have not sent any messages via console. – Navin GV Nov 19 '20 at 14:18
  • Hey @NavinGV. Did you try changing if all filters (date, notification type) still doesn't show any data? It might take a while for _recent_ data to populate. If it still doesn't show up, I suggest reaching out to Firebase Support. – AL. Nov 20 '20 at 02:13
  • the logs on https://firebase.google.com/docs/cloud-messaging/understand-delivery#enable-message-delivery-data-export-on-android only appear for android tough, my team ended up building completely inhouse monitoring for this. – Vitor Reis Jan 11 '21 at 17:34
0

Method projects.androidApps.deliveryData.list reads:

List aggregate delivery data for the given Android application.

It needs a parent node projects/{project_id}/androidApps/{appId} passed and then returns:

{
  "androidDeliveryData": [
    {
      "appId": "",
      "date": {
        "year": 2021,
        "month": 12,
        "day": 19
      },
      "data": { ... }
    }, ...
}

The term "aggregate" rules out individual message delivery reports,

but daily aggregated stats are still better than no stats at all:

MessageOutcomePercents:

{
  "delivered": number,
  "pending": number,
  "droppedTooManyPendingMessages": number,
  "droppedAppForceStopped": number,
  "droppedDeviceInactive": number
}

DeliveryPerformancePercents:

{
  "deliveredNoDelay": number,
  "delayedDeviceOffline": number,
  "delayedDeviceDoze": number,
  "delayedMessageThrottled": number,
  "delayedUserStopped": number
}

MessageInsightPercents:

{
  "priorityLowered": number
}

Those categories are just the same, as one gets posted eg. as Push Kit notification receipt.


The SMS standard would also offer message receipts - because these are
individual messages - and not batches of 500 pub/sub subscribers each.
While this also isn't guaranteed, because one can disable these replies.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216