title: FCM push with high priority to topic comes with delay
body: <p>I'm sending push messages to small group of devices (less than 5) subscribed to one topic with priority parameter set to <strong>high</strong></p>
  
  <blockquote>
    <p><strong>High priority.</strong> 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.</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>Setting <code>time_to_live</code> to 0 solves issues only on Marshmallow. Nougat still failing.</p>
  
  <p>So, I see only 3 possible causes of issue</p>
  
  <ol>
  <li><p>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.</p></li>
  <li><p>App must be in whitelist. But according to <a href="https://developer.android.com/training/monitoring-device-state/doze-standby.html#whitelisting-cases" rel="noreferrer">docs</a> it's not acceptable, if I'm using FCM. And I don't want it, because it will cause battery drain.</p></li>
  <li><p>Bug? <a href="https://github.com/firebase/quickstart-android/issues/100" rel="noreferrer">https://github.com/firebase/quickstart-android/issues/100</a></p></li>
  </ol>
  
  <p>If real cause is first, then why it isn't described in documentation?</p>