Provide a way to cancel or suppress notification display based on custom validation #531
Replies: 2 comments
-
|
Plugin.Firebase.CloudMessaging, itself, doesn't display push notifications at all--so it can't decide when to display them. The plugin is a wrapper around the native SDKs for FCM. That's it. Taking it a step further, FCM, itself, doesn't display push notifications either--so it can't decide when to display them. Push notifications are delivered via Google Play Services or APNs, and they are both intentionally designed to not permit what you're asking for. |
Beta Was this translation helpful? Give feedback.
-
|
You can easily do this - look at: #497 When Your app is running, in NotificationReceived you can adjust "silent_in_foreground" (add/delete/modify) dictionary entry; when Your app isn't running there is no other way, than display notification (by the system). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, Plugin.Firebase.CloudMessaging automatically displays push notifications once they’re received.
However, there’s no built-in way to conditionally suppress a notification — for example, when the app determines it should be handled silently or when certain runtime criteria aren’t met.
It would be great to have a mechanism to validate or cancel notification display before it’s shown, without replacing the entire local-notification builder logic.
NotificationReceived is fired after a notification has already been displayed
Beta Was this translation helpful? Give feedback.
All reactions