title: FCM: Device receives only one of multiple notification messages
body: <p>I am currently writing an Android app using Flutter and a Node.js backend.</p>
  
  <p>On the client side, I followed the first 3 steps of the <a href="https://pub.dev/documentation/firebase_messaging/latest/index.html#android-integration" rel="nofollow noreferrer">firebase_messaging docs</a> to integrate FCM into my app. The logic of my app <a href="https://pub.dev/documentation/firebase_messaging/latest/firebase_messaging/FirebaseMessaging/subscribeToTopic.html" rel="nofollow noreferrer">subscribes</a> to und <a href="https://pub.dev/documentation/firebase_messaging/latest/firebase_messaging/FirebaseMessaging/unsubscribeFromTopic.html" rel="nofollow noreferrer">unsubscribes</a> from several topics <em>(one user is subscribed to 12 topics on average)</em> based on different settings.</p>
  
  <p>The server logic is supposed to send various notification messages based on <a href="https://firebase.google.com/docs/cloud-messaging/send-message#send-messages-to-topics" rel="nofollow noreferrer">conditions</a>:</p>
  
  <pre class="lang-js prettyprint-override"><code>const firebase = require('firebase-admin')
  
  firebase.initializeApp({
    credential: firebase.credential.applicationDefault(),
    databaseURL: 'https://&lt;PROJECT&gt;.firebaseio.com'
  })
  
  const title = ...
  const msgList = [...]
  const notifications = []
  for (let msg of msgList) {
    let condition = `'${msg.topicA}' in topics &amp;&amp; '${msg.topicB}' in topics`
    if (msg.topicX !== '') {
      condition = `${condition} &amp;&amp; !('${msg.topicX}' in topics)`
    }
    notifications.push(buildMessage(title, msg.body, condition))
  }
  
  new Promise((resolve, reject) =&gt; {
    return firebase.messaging().sendAll(notifications).then(resp =&gt; {
      console.log(`Sent ${resp.successCount} messages, ${resp.failureCount} failed`)
      resolve()
    })
  }).then(() =&gt; {
    firebase.app().delete()
  }).catch(err =&gt; {
    console.error(err)
  })
  
  function buildMessage(title, body, condition) =&gt; {
    return message = {
      notification: { title, body },
      android: {
        ttl: 24 * 60 * 60 * 1000, // 1d
        notification: {
          sound: 'default',
          vibrate_timings: [
            '0s', '0.1s',
          ]
        }
      },
      condition
    }
  }
  </code></pre>
  
  <p>When I run this code, it logs <code>Sent 72 messages, 0 failed</code>. Therefore, I assume that the sending of the messages worked. The number of messages sent and the corresponding topics as well as the title change at least daily. <strong>Based on my topic subscriptions I should actually receive about 4 push notifications on my phone. However, I only receive exactly one notification at a time.</strong> After I had reinstalled the app and therefore subscribed to the topics again with a new token, I received all the messages I was supposed to receive. After a few days, however, it has changed back to the old behavior and I receive exactly one message every time the server sends a batch of messages.</p>