title: How to handle notifications with FCM when app is in either foreground or background
body: <p>I used firebase to build My project.<br>
  It will also use the FCM (firebase cloud message).<br>
  But there is a problem.<br> I can't handle the FCM (create my custom notificaion) when app is in background.<br> <br>
  <a href="https://firebase.google.com/docs/cloud-messaging/android/receive" rel="noreferrer">The official site tutorial</a> said that <br>
  case 1: App foreground -> override the "onMessageReceived()" to create your custom notification. <br>
  case 2: App background -> System will create the notification directly. We needn't and can't do anything. Because it doesn't trigger the "onMessageReceived()" in this case.<br></p>
  
  <p>However if I can do nothing when app is background, I can't create my custom notification. (e.g. After Users click the notification and it will pop up a window to show detail information.)</p>
  
  <p>So how do I handle notifications with FCM when app is in background?</p>