FCM onMessageReceived() is never called
<p>I am integrating FireBase Push Notification into my application.
Although I am receiving push notifications(when application is in background) but my onMessageReceived(RemoteMessage remoteMessage) is never called, independent of whether application is in foreground or backgroud. 
If its the issue with FCM or there is something that I am doing wrong.
I am using 'com.google.firebase:firebase-messaging:9.0.0' in my app build.gradle.
I have declared both the services in my application manifest </p>

<pre><code> &lt;service
    android:name="app.pnd.camscanner.MyFirebaseMessagingService"&gt;
    &lt;intent-filter&gt;
        &lt;action android:name="com.google.firebase.MESSAGING_EVENT"/&gt;
    &lt;/intent-filter&gt;
&lt;/service&gt;

&lt;service
    android:name="app.pnd.camscanner.MyFirebaseInstanceIDService"&gt;
    &lt;intent-filter&gt;
        &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT"/&gt;
    &lt;/intent-filter&gt;
&lt;/service&gt;
</code></pre>