title: Why is my postman (data) message not reaching my Android app?
body: <p>In a <a href="https://stackoverflow.com/questions/57076964/how-to-get-data-from-firebase-message-while-android-app-is-in-background">previous question</a> I was facing the problem, that firebase messages are not triggering the onMessageReceived() event in my firebase class within my app, while the app is in the background. As <a href="https://stackoverflow.com/users/2228226/hardik-bambhania">this friendly user</a> pointed out, the reason seems to be, that the firebase console can't send data messages, it only sends notification messages which won't reach the event. He suggested using postman to send data messages to my app. I set up a POST-request to <a href="https://fcm.googleapis.com/fcm/send" rel="nofollow noreferrer">https://fcm.googleapis.com/fcm/send</a> and added the API-key of my project as well as the content type to the Headers-section like this:</p>
  <pre><code>Authorization = key=[firebase project key]
  Content-Type = application/json
  </code></pre>
  <p>and I addressed my app with the help of its firebase-token:</p>
  <pre><code>{
      &quot;to&quot;: &quot;[token]&quot;,
      &quot;notification&quot;: {
          &quot;title&quot;: &quot;This is a title&quot;
          &quot;body&quot;: &quot;This is a test&quot;
      },
      &quot;data&quot;: {
          &quot;title&quot;: &quot;This is a data title&quot;
          &quot;body&quot;: &quot;This is a data message&quot;
          &quot;key1&quot;: &quot;value1&quot;
      }
  }
  </code></pre>
  <p>The version I've shown you works just like the firebase console messages. It reaches the app correctly when in foreground (displaying the contents of the notification-section) and transmitting the data. But when in background it reaches the app but without triggering the onMessageReceived() event. I tried to cut out the notification section to make the message a &quot;pure&quot; data-message, but in this case the message won't reach my app at all.
  Does somebody know what I'm doing wrong?</p>
  <p>(I can tell that it does not reach the onMessageReceived event because within there I'm giving the notification a different logo for test purposes)</p>