Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to get data from notification, without clicking on notifications (firebase cloud messagin and react native)

$
0
0

Right now I can handle messages when the app is open, minimized, or closed, but when I click on the notification. How to process a message if a user logs into the application without 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')            }        });}, []);

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>