High priority FCM load on topic comes with a delay

I send push messages to a small group of devices (less than 5), subscribed to the same topic with the priority setting set to high

High priority. FCM attempts to send high priority messages immediately, allowing the FCM service to wake the sleeping device when possible and open a network connection to your application server. Applications with notification of instant messages, chats, or voice calls, for example, generally need to open a network connection and make sure that FCM provides communication to the device without delay. Set a high priority only if the message is time critical and requires immediate interaction, but be careful to set your messages to high priority contributing more to battery leakage than normal message priority.

But when I put the device in IDLE state, it comes with a long delay. The delay of Nuggat 7.1 is more than 10 minutes. This type of pressing requires a delay of less than 10 seconds.

Setting time_to_live to 0 solves problems only on Marshmallow. Nougat still does not work.

So, I see only 3 possible causes of the problem

  • Messages sent to a topic cannot be high priority. But sending independent messages to each device will increase the load on the server application. I need to download a new token from the Firebase database, so the result will be 10 HTTP requests for 5 users, not 1.

  • The application should be in the white list. But according to docs, this is unacceptable if I use FCM. And I do not want this because it will cause a battery leak.

  • Error

    ? https://github.com/firebase/quickstart-android/issues/100

If the first reason is the first, then why is it not described in the documentation?

+5
source share

Source: https://habr.com/ru/post/1259725/


All Articles