I'm sending push messages to small group of devices (less than 5) subscribed to one topic with priority parameter set to high
High priority. FCM attempts to deliver high priority messages immediately, allowing the FCM service to wake a sleeping device when possible and open a network connection to your app server. Apps with instant messaging, chat, or voice call alerts, for example, generally need to open a network connection and make sure FCM delivers the message to the device without delay. Set high priority only if the message is time-critical and requires the user's immediate interaction, but beware that setting your messages to high priority contributes more to battery drain compared with normal priority messages.
But when I put device to IDLE state it comes with big delay. On Nougat 7.1 delay is more than 10 mins. This type of push requires delay less than 10 secs.
Setting time_to_live
to 0 solves issues only on Marshmallow. Nougat still failing.
So, I see only 3 possible causes of issue
Messages sent to topic can't be high priority. But sending independent messages to each device will increase app-server load. I need to load fresh token from Firebase Database, so the result will be - 10 http requests for 5 users instead of 1.
App must be in whitelist. But according to docs it's not acceptable, if I'm using FCM. And I don't want it, because it will cause battery drain.
Bug? https://github.com/firebase/quickstart-android/issues/100
If real cause is first, then why it isn't described in documentation?
delay_while_idle
set tofalse
? – AL.delay_while_idle
not set at all, default values isfalse
. Also it will be deprecated tomorrow – Dima Rostopira