How to selectively delete Firebase Android notifications (in system tray)

According to the documentation , Firebase for Android Notifications are delivered to the system tray when the app is in the background.

How do I get all notifications and selectively remove them based on some logic? (Of course I'll define the logic, but how do I get it and identify it?)

Is it correct to use NotificationManager to remove system tray notifications?

Any code example would be greatly appreciated. Thank!

+3


source to share


1 answer


we had the same problem and solved it without sending a notification body.

https://firebase.google.com/docs/cloud-messaging/android/receive



As mentioned in the documentation, you only get the message in the method public void onMessageReceived(RemoteMessage remoteMessage)

in FirebaseMessagingService

when there is no notification body. Otherwise, it ends up in the system tray and android processes it.

Unable to send notification without notification from the console. You must create your own backend.

0


source







All Articles