Currently, I am able to handle messages whether the app is open, minimized, or closed. However, how can I process a message if a user logs into the application without receiving a notification?
useEffect(() => {
messaging().setBackgroundMessageHandler(async remoteMessage => {
handlerMessage(remoteMessage)
setInitialRoute('Messenger')
});
messaging().onMessage(async remoteMessage => {
handlerMessage(remoteMessage);
});
messaging()
.getInitialNotification()
.then(remoteMessage => {
if (remoteMessage) {
handlerMessage(remoteMessage);
setInitialRoute('Messenger')
}
});
}, []);