5

The graph below from Firebase Cloud Messaging (FCM) Console shows how only ~95% of our push are being received by the phones. This is causing lots of issues for us as we're creating a VoIP app and need the push to be received immediately. Can anyone explain why this is happening and how to get this rate closer to 100%?

Some important notes:

  • All phones are Android
  • All phones had our app open at the time they received the push or up to 2 minutes prior
  • All push are data push (i.e. no body/title) with priority high
  • The push is sent with expiration 10 seconds to prioritize them following Android docs
  • We had ~30 errors (registration-token-not-registered and internal-error) sending push in the same period, which is nothing compared to the ~500 undelivered push

Screenshot from FCM Console

pir
  • 5,513
  • 12
  • 63
  • 101

3 Answers3

5

pir,

As far as I understand, there are many reasons why a message might not be delivered. I think without looking at your specific data, it is going to be difficult for anyone to give a conclusive answer.

What I do recommend is that you spend some time reading Understanding message delivery on the Firebase Documentation. Although I recommend you read the entire article, of particular interst for you will probably be the BigQuery data export section. This covers exporting your message data to BigQuery. Data exported to BigQuery is covered in the What data is exported to BigQuery? section. I think you're going to be interested in the event field which holds data about the type of event that occurred. These events types include:

  • MESSAGE_ACCEPTED: the message was received by the FCM server and the request is valid;
  • MESSAGE_DELIVERED: the message has been delivered to the app's FCM SDK on the device. By default, this field is not propagrated. To enable, follow the instructions provided in setDeliveryMetricsExportToBigQuery(boolean)).
  • MISSING_REGISTRATIONS: the request was rejected due to a missing registration;
  • UNAUTHORIZED_REGISTRATION: the message was rejected because the sender is not authorized to send to the registration;
  • MESSAGE_RECEIVED_INTERNAL_ERROR: there was an unspecified error when processing the message request;
  • MISMATCH_SENDER_ID: the request to send a message was rejected due to a mismatch between the sender id sending the message, and the one declared for the end-point;
  • QUOTA_EXCEEDED: the request to send a message was rejected due to insufficient quota;
  • INVALID_REGISTRATION: the request to send a message was rejected due to an invalid registration;
  • INVALID_PACKAGE_NAME: the request to send a message was rejected due to an invalid package name;
  • INVALID_APNS_CREDENTIAL: the request to send a message was rejected due to an invalid APNS certificate;
  • INVALID_PARAMETERS: the request to send a message was rejected due to invalid parameters;
  • PAYLOAD_TOO_LARGE: the request to send a message was rejected due to a payload larger than the limit;
  • AUTHENTICATION_ERROR: the request to send a message was rejected due to an authentication error (check the API Key used to send the message);
  • INVALID_TTL: the request to send a message was rejected due to an invalid TTL.

I hope this helps. Good luck!

oreid
  • 1,336
  • 2
  • 13
  • 25
  • Thanks. I tried this. However, the only events we get are `MESSAGE_ACCEPTED` and 14 `MESSAGE_RECEIVED_INTERNAL_ERROR` events corresponding to the errors I mentioned in my original post. We'll add the code needed for `MESSAGE_DELIVERED`, but so far this doesn't give us much insight into what's happening. Any advice? – pir May 26 '20 at 17:27
1

There are several reasons that could make notification not delivered.

  • There are devices that might have a specific battery optimization that will stop notifications from showing. And to fix that you might ask user to do the following. check Settings > Battery > Battery Optimization or Adaptive Battery > Find your app and press Don't optimize

  • The app has might push permissions Disabled In Device Settings, user can turn on and off push notifications. From notification setting under Settings > Apps

Ibrahim Ali
  • 1,237
  • 9
  • 20
1
  • All phones had our app open at the time they received the push or up to 2 minutes prior

How do you know that all phones are on and not is sleepmode ? Are you 100% sure ?

  • All push are data push (i.e. no body/title) with priority high The push is sent with expiration 10 seconds to prioritize them following Android docs

I also use data FCM to coordinate updates between devices, in my case the vast majority of messages are received in less than 1/2 second but sometimes I have observed that they are delayed up to about 20 seconds and then several are received suddenly.

With a TimeToLive of only 10 seconds in your case they would be lost.

Also Google claims that 95% of the messages are delivered in fewer than 250 milliseconds, but the remaining 5% does not, that would already justify those lose.

from56
  • 3,976
  • 2
  • 13
  • 23
  • Thanks. I'll try increasing the time-to-live! – pir May 18 '20 at 23:55
  • We know that they were open at that time or 2 minutes before because we only allow recently-online users to be called. – pir May 19 '20 at 00:07