I have a problem with Firebase notifications.
When my app is completely closed and I send a notification, the app launcher
gets the notification Data and can handle the incoming notification. Everything works fine then. But when I have the application open in the background
(by exiting out via the home button) then neither my App launcher
nor my onMessageReceived()
method get called.
I can't find a reason why this would happen.
(onMessageReceived()
is called correctly when app is in foreground)
EDIT: At the moment my onMessageReceived only logs if it got a message
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d(TAG, "onMessageReceived: Message from: " + remoteMessage.getFrom());
}
SOLUTION:
I solved the problem by sending a data notification
and then manually checking in the onMessageReceived()
function if the app is in foreground and only displaying a notification then