When application in foreground onMessageReceived return the data but when application in background onMessageReceived don't return anything. FCM will generate auto notification while application in background or kill mode I want to stop auto generated notification.
This is my sample code:
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.e(TAG, "onMessageReceived: " + remoteMessage);
Log.e(TAG, "onMessageReceived: " + remoteMessage.getFrom());
Log.e(TAG, "onMessageReceived Message Body: " + remoteMessage.getNotification().getBody());
handleNow(remoteMessage);
}