React-native-firebase: Clear existing notifications

Created on 9 Apr 2018  路  8Comments  路  Source: invertase/react-native-firebase

Issue

No way to clear any existing notifications.

Environment

Both

  1. Application Target Platform:
    Windows 10

  2. Development Operating System:
    iOS and Android

  3. Build Tools:
    27.0.3

  4. React Native version:
    0.54.3

  5. RNFirebase Version:
    4.0.0

  6. Firebase Module:
    Firebase notifications

Most helpful comment

Assuming this is a delivered notification, you can use firebase.notifications().removeDeliveredNotification(notificationId) or firebase.notifications().removeAllDeliveredNotifications(). If it's a scheduled notification, you can use firebase.notifications().cancelNotification(notificationId) or firebase.notifications().cancelAllNotifications().

All this is documented at: https://rnfirebase.io/docs/v4.0.x/notifications/reference/Notifications

All 8 comments

Assuming this is a delivered notification, you can use firebase.notifications().removeDeliveredNotification(notificationId) or firebase.notifications().removeAllDeliveredNotifications(). If it's a scheduled notification, you can use firebase.notifications().cancelNotification(notificationId) or firebase.notifications().cancelAllNotifications().

All this is documented at: https://rnfirebase.io/docs/v4.0.x/notifications/reference/Notifications

@chrisbianca Thank you, I seem to have missed that

Assuming this is a delivered notification, you can use firebase.notifications().removeDeliveredNotification(notificationId) or firebase.notifications().removeAllDeliveredNotifications(). If it's a scheduled notification, you can use firebase.notifications().cancelNotification(notificationId) or firebase.notifications().cancelAllNotifications().

All this is documented at: https://rnfirebase.io/docs/v4.0.x/notifications/reference/Notifications

firebase.notifications().removeDeliveredNotification(notificationId) is not working for me on react-native: 0.57.7 and firebase 4.3.8

Same problen.

"react-native": "0.57.1",
"react-native-firebase": "^5.0.0-rc4",

Also seem to be having this issue.

react-native: 0.57.7
react-native-firebase: 5.2.2

I don't see any particular notes about this feature in the changelog since 5.2.2. Is this something known to be fixed?

Also seem to be having this issue.

react-native: 0.57.7
react-native-firebase: 5.2.2

I don't see any particular notes about this feature in the changelog since 5.2.2. Is this something known to be fixed?

Hi @agmcleod I was also facing the same issue I solved this issue by adding this line
firebase.notifications().cancelNotification(notifcationPayload.notification._notificationId).

react-native : 0.60.5
react-native-firebase: 5.5.6

Any way to clear remote notifications in react native firebase v6???

@aravi365 I was clear in my answer on #3563 I think.
Integrate a package that handles local device notification APIs

Was this page helpful?
0 / 5 - 0 ratings