7

This is really a continuation of another question I posted, except now I'm using Azure's push notification telemetry and Google discontinued FCM diagnostics in the Play Console.

I get reports from users saying they haven't received notifications. But the Azure telemetry shows results like these, even for these notifications:

"GcmOutcomeCounts": {
    "Outcome": {
        "Name": "Success",
        "Count": "1"
    }
}

Crashlytics shows no crashes, so the only thing I've come up with is putting calls to a logging API in to see where it fails or stop working, but it never even reaches the app in this case.

There has to be a way of figuring out exactly where and why the notification fails. What is it?

Hossein Golshani
  • 1,847
  • 5
  • 16
  • 27
Questioner
  • 2,451
  • 4
  • 29
  • 50

1 Answers1

1

There has to be a way of figuring out exactly where and why the notification fails. What is it?

Here is my 2 cents. In general, there can be many points of failure for notifications. Your aim would be to figure out which at which point the issue lies. Below is the diagram from the home page of FCM:

Potential failure points:

  1. When the app sends registration token to your server.
  2. Handling update of the FCM registration token.

    • If there is an error sending registration token, then you can have a custom non-fatal exception send to Crashlytics. Since you already seem to have the token I don't think it is the issue. However in some cases the token might change, so just double check that you are implementing onNewToken() and sending the new registration token to server in case its changing.
  3. When sending notification from your server to FCM.

  4. When sending it from FCM to user device.

    • To confirm if there is no issue when sending the notification from your server -> FCM -> user device, you can try getting a delivery receipt from FCM as mentioned here: Receive delivery receipts. It says:

      For Android and Chrome client apps, you can get delivery receipts (sent from FCM to your app server) when a device confirms that it received a message sent by FCM.

      To enable this feature, the message your app server sends to FCM must include the field delivery_receipt_requested. When this field is set to true, FCM sends a delivery receipt when a device confirms that it received a particular message.

    • Also, I've seen sometimes issues with firewall on the user's network, back in days when there was GCM. There could be an issue where firewall is blocking the notification. IP range of google GCM push notification server? Try opening the potential list of ports if that's the case or try testing on carrier data network. Since you mention that you've to include log at various points in the app but it never reaches. Looking into the above points can be the next steps.

  5. Handling notification within your app / showing the notification in the notification drawer.

Hope this helps a bit in debugging your issue.

Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124
  • Problem is I already did the logging of those points with my own API. The delivery_receipt_requested feature requires an XMPP server but I'm looking into it. – Questioner Oct 22 '18 at 08:55
  • I can't get an XMPP server. What does 'Success' mean anyway? – Questioner Nov 11 '19 at 12:43