title: Firebase onMessageReceived not called
body: <p>FCM service:</p>
  
  <pre><code>public class FCMService extends FirebaseMessagingService {
  
  
      @Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
  
  
          Log.i(Constants.TAG,"onMessageReceived");
  
          Log.i(Constants.TAG, "From: " + remoteMessage.getFrom());
  
          if (remoteMessage.getData().size() &gt; 0) {
              Log.d(Constants.TAG, "Message data payload: " + remoteMessage.getData());
          }
  
  
          if (remoteMessage.getNotification() != null) {
              Log.d(Constants.TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
          }
  
  
      }
  
  }
  </code></pre>
  
  <p>App Gradle:</p>
  
  <pre><code>  compile 'com.google.firebase:firebase-messaging:10.2.6'
  </code></pre>
  
  <p>Manifest:</p>
  
  <pre><code>   &lt;service android:name="communications.FCMService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
              &lt;/intent-filter&gt;
      &lt;/service&gt;
  </code></pre>
  
  <p>-I send message <a href="https://console.firebase.google.com" rel="noreferrer">from FCM console</a> and don´t arrives. FCM console show me OK when message is sent.</p>
  
  <p>-I send message from java server and message don´t arrives. Java server show me OK when message is sent.</p>
  
  <p>-To send messages I use generated token in Android device.</p>
  
  <p>-Before, I had a mistake to import the FCM library badly, that error is solved. When that past error occurred every time a message was sent, an exception occurred on Android. Now nothing is received.</p>
  
  <p>-I have on the Android device an Internet connection and I receive messages via GCM (not FCM) from another application that I implemented in the past.</p>
  
  <p>-App is in foreground.</p>
  
  <p>Some log with "fcm" filter. I get this log when I send message.</p>
  
  <pre><code>08-14 12:09:25.640 800-4739/? D/PowerManagerService: acquireWakeLockInternal: lock=862109980, flags=0x1, tag="wake:bidsy.app.bidsy/communications.FCMService", ws=null, uid=10354, pid=24073
  08-14 12:09:25.640 800-4739/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="wake:bidsy.app.bidsy/communications.FCMService", packageName=bidsy.app.bidsy, ownerUid=10354, ownerPid=24073, workSource=null
  08-14 12:09:25.683 24073-24073/bidsy.app.bidsy D/ActivityThread: SVC-Creating service: CreateServiceData{token=android.os.BinderProxy@1c269013 className=communications.FCMService packageName=bidsy.app.bidsy intent=null}
  08-14 12:09:25.683 24073-24073/bidsy.app.bidsy D/ActivityThread: SVC-CREATE_SERVICE handled : 0 / CreateServiceData{token=android.os.BinderProxy@1c269013 className=communications.FCMService packageName=bidsy.app.bidsy intent=null}
  08-14 12:09:25.685 24073-24073/bidsy.app.bidsy D/ActivityThread: SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@1c269013 startId=1 args=Intent { act=com.google.firebase.MESSAGING_EVENT pkg=bidsy.app.bidsy cmp=bidsy.app.bidsy/communications.FCMService (has extras) }}
  08-14 12:09:25.684 24073-24073/bidsy.app.bidsy D/ActivityThread: SVC-Calling onStartCommand: communications.FCMService@3e035250, flags=0, startId=1
  08-14 12:09:25.691 800-1592/? D/PowerManagerService: releaseWakeLockInternal: lock=862109980 [wake:bidsy.app.bidsy/communications.FCMService], flags=0x0, total_time=52ms
  08-14 12:09:25.691 800-1592/? D/PowerManagerNotifier: onWakeLockReleased: flags=1, tag="wake:bidsy.app.bidsy/communications.FCMService", packageName=bidsy.app.bidsy, ownerUid=10354, ownerPid=24073, workSource=null
  08-14 12:09:25.692 24073-24073/bidsy.app.bidsy D/ActivityThread: SVC-Destroying service: communications.FCMService@3e035250
  </code></pre>
  
  <p>It seems like the message arrives at the service but does not show it.</p>
  
  <p>Of course I do not use any filters in the log to check if the message gets to onMessageReceived</p>
  
  <p>I find similar question here not answered, has same log:</p>
  
  <p><a href="https://stackoverflow.com/questions/41938542/cant-receive-the-push-notification-message">Can&#39;t receive the push notification message</a></p>
  
  <p><strong>After looking at the whole log in detail I have seen that when I send a message the following Firebase error occurs</strong>: </p>
  
  <pre><code>D / FirebaseMessaging: Unknown intent action: com.google.firebase.MESSAGING_EVENT
  </code></pre>
  
  <p><strong>Solution to my problem is here</strong>:</p>
  
  <p><a href="https://stackoverflow.com/questions/44772951/i-faced-a-issue-while-using-the-older-version-of-fcm-i-e-10-2-6-unknown-intent-a">I faced a issue while using the older version of FCM i.e 10.2.6 Unknown intent action: com.google.firebase.MESSAGING_EVENT</a></p>