title: Firebase onMessageReceived not called when app in background
body: <p>I'm working with Firebase and testing sending notifications to my app from my server while the app is in the background. The notification is sent successfully, it even appears on the notification centre of the device, but when the notification appears or even if I click on it, the onMessageReceived method inside my FCMessagingService is never called. </p>
  
  <p>When I tested this while my app was in the foreground, the onMessageReceived method was called and everything worked fine. The problem occurs when the app is running in the background.</p>
  
  <p>Is this intended behaviour, or is there a way I can fix this?</p>
  
  <p>Here is my FBMessagingService:</p>
  
  <pre><code>import android.util.Log;
  
  import com.google.firebase.messaging.FirebaseMessagingService;
  import com.google.firebase.messaging.RemoteMessage;
  
  public class FBMessagingService extends FirebaseMessagingService {
  
      @Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
          Log.i("PVL", "MESSAGE RECEIVED!!");
          if (remoteMessage.getNotification().getBody() != null) {
              Log.i("PVL", "RECEIVED MESSAGE: " + remoteMessage.getNotification().getBody());
          } else {
              Log.i("PVL", "RECEIVED MESSAGE: " + remoteMessage.getData().get("message"));
          }
      }
  }
  </code></pre>