Sending `FCMNotificationReceived` with no listeners registered.
See original GitHub issueHi, i am using FCM with Firebase functions to send notifications based on some effects,
it works fine send notifications and i receive them but when i click on the notification i get nothing and in the logs i get this message:
Sending FCMNotificationReceived
with no listeners registered.
in my functions her is the payload sent:
const payload = {
notification: {
'title': formatedData.titre,
'body': formatedData.commande
}
};
const options = {
priority: "high",
content_available: true,
};
return admin.messaging()
.sendToDevice("user_token", payload, options);
})
and in my react i have this in componentDidMount:
componentDidMount() {
FCM.requestPermissions();
FCM.getFCMToken().then(token => {
console.log("TOKEN (getFCMToken)", token);
this.setState({token: token});
});
FCM.subscribeToTopic('mes-annonces');
FCM.getInitialNotification().then(notif => {
console.log("INITIAL NOTIFICATION", notif);
alert('got a notification '+notif);
});
this.notificationListener = FCM.on(FCMEvent.Notification, async (notif) => {
console.log('event notification'+notif);
alert('got notif' + notif);
if(notif.opened_from_tray) {
alert('clicked on notification');
console.log('got a opened_from notification');
}
if(notif.local_notification) {
console.log('got a local notification');
}
if (Platform.OS === 'ios') {
switch (notif._notificationType) {
case NotificationType.Remote:
notif.finish(RemoteNotificationResult.NewData); //other types available: RemoteNotificationResult.NewData, RemoteNotificationResult.ResultFailed
break;
case NotificationType.NotificationResponse:
notif.finish();
break;
case NotificationType.WillPresent:
console.log('in the method');
notif.finish(WillPresentNotificationResult.All); //other types available: WillPresentNotificationResult.None
break;
}
}
this.showLocalNotification(notif);
});
FCM.on(FCMEvent.RefreshToken, token => {
console.log(token);
})
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
can't receive notification in ios : sending FcmTokenRefreshed ...
i send notification with fire-base , in ios app i have this error : sending FcmTokenRefreshed with no listeners registered if app opened ......
Read more >evollu/react-native-fcm - Gitter
Hi all. I am getting an error: method does not override or implement from a supertype and it's in FIRMessagingModule.java. Thanks for the...
Read more >a resolved google play services library dependency depends on ...
As a work around you can send data message (no notification payload at all) and this repo will build a local notification for...
Read more >[Solved]-can't receive notification in ios - appsloveworld
Coding example for the question can't receive notification in ios : sending FcmTokenRefreshed with no listeners registered-React Native.
Read more >Cloud Messaging | React Native Firebase
If you're using an older version of React Native without auto-linking ... or even ignore it) and also how the library sends events...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @googl3r
I am also getting this issue and i have the same code which is working fine for Android but giving this error in iOS.
Please guide.
i have same issue and i am not even recieving any notification but “Sending
FCMNotificationReceived
with no listeners registered” every time i send message from servercan someone please tell whether this issue from APNs or Firebase wrong setting or firebase cocoapods i installed
if it from cocoapod install then i will remove cocoapod and install firebase sdk manualy