Open avoidchanges opened 5 years ago
componentDidMount() { FCM.requestPermissions({badge: true, sound: true, alert: true}).then(()=>console.log('granted')).catch(()=>console.log('notification permission rejected')); FCM.getInitialNotification().then(notif => { console.log("INITIAL NOTIFICATION", notif) }); this.notificationListner = FCM.on(FCMEvent.Notification, notif => { console.log("Notification", notif); if(notif.local_notification){ console.log('LOG GOLD'); return; } if(notif.opened_from_tray){ console.log('LOG SILVER'); return; } }); }
This is my code. It seems I'cant make this.notificationListner to work. Console.log not getting called. getinitialnotification works fine. Please help.
Are you calling this.notificationListner anywhere?
this.notificationListner
i got same problem, i got this function triggered when get notification + app killed, remoteMessage = null
This is my code. It seems I'cant make this.notificationListner to work. Console.log not getting called. getinitialnotification works fine. Please help.