title: How to run a function when a notification is received with Firebase Messaging ^8.0.0-dev.8 in Flutter?
body: <p>Hello I'm using Flutter to build my app and I need to to show an alert whenever a new notification is received.<br>
  I've been using <code>firebase_messaging 7.0.3</code> but I run into an error with <code>onBackgroundMessage</code>. A quick Google search helped me find out that the error I was getting hasn't been fixed yet. However one of the devs posted an update 20 days ago about a new version of the package which fixed that issue.<br>
  The new version removed the old onMessage handlers and introduced new ones.
  Now they got new event handlers which return streams, but haven't been able to make them fire by using the
  <code>.listen()</code> function. Whenever I receive a notification a get a this: <code>D/FLTFireMsgReceiver(22032): broadcast received for message</code> printed in the console but the code in the <code>.listen()</code> doesn't get executed.</p>
  <p><a href="https://firebase.flutter.dev/docs/migration/" rel="noreferrer">Here</a> is a link to an article on Firebase Flutter that is a guide for using the new version of the package.
  Here is my code:<br></p>
  <pre><code>...
  FirebaseMessaging.onMessage.listen((event) {
   // do something
  });
  FirebaseMessaging.onMessageOpenedApp.listen((event) {
   // do something
  });
  FirebaseMessaging.onBackgroundMessage((message) {
   // do something
   return;
   }
  ...
  </code></pre>