You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is responsible for the "automagical" behavior of Android Firebase Cloud Messaging, wherein the SDK will automatically display an Android notification if a message is received while the app is in the background.
This automatic behavior is a point of contention in the developer community since there is no current way to customize or opt-out of the display notification, but as long as the SDK is opinionated about doing this, I would like a way to mimic the SDK's behavior while the app is foregrounded.
So I would appreciate it if a public variant of DisplayNotification could be exposed by the SDK, ideally taking a RemoteMessage instance in a constructor, that would allow me to generate and display an Android Notification in the same style as created by the SDK.
This would allow consistent presentation by an app regardless of whether the message is received in the foreground or background.
How would you use it?
Today, if I specify "image" in my FCM payload, the SDK will automatically download and display the image in a Notification using BigPictureStyle, which is convenient - but it only does this when the app is backgrounded.
When the app is foregrounded I have to recreate this Notification myself, manually, and for consistency I find myself basically copying the same styling the SDK uses. It'd be great if the SDK just exposed its helpers to me so I could literally display the same Notification that it automatically creates. This also applies to the logic the SDK uses for icons, strings, etc.
The text was updated successfully, but these errors were encountered:
To avoid duplicates of feature requests, I'll be closing this now. That being said, what we can do here is that, I added a comment to issue 1663, that way this can be visible to people checking the request.
Also can you give the issue 1663 a thumbs up? This is a huge help to our engineers, since this is the way we track requests of our developers to see what is highly suggested and then we can prioritize accordingly. Thanks again!
What feature would you like to see?
This class, DisplayNotification:
firebase-android-sdk/firebase-messaging/src/main/java/com/google/firebase/messaging/DisplayNotification.java
Line 45 in 6ee7bdf
is responsible for the "automagical" behavior of Android Firebase Cloud Messaging, wherein the SDK will automatically display an Android notification if a message is received while the app is in the background.
This automatic behavior is a point of contention in the developer community since there is no current way to customize or opt-out of the display notification, but as long as the SDK is opinionated about doing this, I would like a way to mimic the SDK's behavior while the app is foregrounded.
So I would appreciate it if a public variant of
DisplayNotification
could be exposed by the SDK, ideally taking aRemoteMessage
instance in a constructor, that would allow me to generate and display an Android Notification in the same style as created by the SDK.This would allow consistent presentation by an app regardless of whether the message is received in the foreground or background.
How would you use it?
Today, if I specify "image" in my FCM payload, the SDK will automatically download and display the image in a Notification using
BigPictureStyle
, which is convenient - but it only does this when the app is backgrounded.When the app is foregrounded I have to recreate this Notification myself, manually, and for consistency I find myself basically copying the same styling the SDK uses. It'd be great if the SDK just exposed its helpers to me so I could literally display the same Notification that it automatically creates. This also applies to the logic the SDK uses for icons, strings, etc.
The text was updated successfully, but these errors were encountered: