title: Flutter Firebase how to control notification not to show when the app is in foreground
body: <p>I had a flutter app with a chat room feature. Firebase messaging is used to push remote notification. I want to hide the notification popup if the app is at foreground and it happens to be at the exact chat room where that coming notification belongs to.</p>
  <p>This is a common behavior when you're chatting with someone. The message appends to chat room directly instead of popup.</p>
  <p>My question is how to interfere the remote notification on receiving? I used <strong>onMessage</strong> callback on notification received event. But it always popups no matter the app is at foreground or background or termiated.</p>
  <p>In firebase React Native version, it has an <strong>onNotification</strong> callback which does exactly what I want. But there is no equivalence for flutter. My research leads me to send <strong>Data</strong> and <strong>Notification</strong> type of message. In such a way, I need to keep app status synchronized with my backend server (Am I right?).</p>
  <p>Any help or suggestion is welcome. Thank you.</p>
  <p><strong>P.S. firebase_messaging 8.0.0-dev.10</strong></p>