evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

get notification data when user click into notification => app opened ( when app killed) #1154

Open fukemy opened 1 year ago

fukemy commented 1 year ago

Hi. I tested with android when app totally closed. I got this function triggered when received notification:


messaging().onNotificationOpenedApp(remoteMessage => {
  console.log('Notification caused app to open from background state:', remoteMessage)
})

messaging()
  .getInitialNotification()
  .then(remoteMessage => {
    console.log('Notification caused app to open from quit state:', remoteMessage)
})

But when user click into notification, app opened without any callback, then i can not get message data. Can someone help?