Firebase侦听器无法删除

时间:2018-09-05 04:13:42

标签: reactjs firebase react-native react-native-firebase

this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
if (notificationOpen) {
    const notification: Notification = notificationOpen.notification;
    if(notification.data.type){
        firebase.notifications().removeAllDeliveredNotifications()
    }
}
});
console.log('notificationOpenedListener', this.notificationOpenedListener());

this.notificationOpenedListener()->>这是未定义的

有人知道为什么它没有定义吗?

按照以下示例: https://rnfirebase.io/docs/v4.3.x/notifications/receiving-notifications#4)-Listen-for-a-Notification-being-opened

0 个答案:

没有答案