As instructed in Firebase dev docs, I've implemented a Service that extends FirebaseMessagingService and overrides the onMessageReceived callback. I have put a Log message in the first line inside the onMessageReceived method.
App running in background I don't see the log in logcat but I see a Notification posted in the system try.
App in Foreground I neither see the log nor the notification in system tray
Any idea what's going on?
Manifest
<service
android:name=".fcm.MovieMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
Service Class
public class MovieMessagingService extends FirebaseMessagingService {
private static final String LOG_TAG = MovieMessagingService.class.getSimpleName();
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d(LOG_TAG, "From: " + remoteMessage.getFrom());
}
/**
* Create and show a simple notification containing the received FCM message.
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String messageBody) {
Log.d(LOG_TAG, "Presenting Notification with message body: " + messageBody);
//more code
}
}