evollu / react-native-fcm

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

FCMTokenRefreshed with no listeners registered warning appears on launch of iOS app #913

Closed RajendraHp closed 6 years ago

RajendraHp commented 6 years ago

On the launch of the iOS app in debug mode, the below warning message appears: "Sending 'FCMTokenRefreshed' with no listeners registered". I am receiving push notificaitons with out any issue.

evollu commented 6 years ago

"Sending 'FCMTokenRefreshed' with no listeners registered". could happen if the event triggers before JS is bootstrapped, do you call "getFCMToken" when app starts and sync it to server?

yusmarcastro commented 6 years ago

Any update on this?? Yes @evollu componentDidMount I call 'getFCMToken' to sync with my server this have any relation with the warning?? Please any help

evollu commented 6 years ago

@yusmarcastro if you are calling getFCMToken, you can ignore the warning

lytieunuong1 commented 5 years ago

Add function to listen FCMTokenRefreshed event

FCM.on("FCMTokenRefreshed", token => {
        //update token to server
})