firebase / firebase/firebase-android-sdk

Including imageUrl in the FCM notification payloads always uses BigPicture

Open
#7,517 1 comment 2 reactions 0 assignees View on GitHub
api: messaging type: feature request
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

Description

## Support templating for notifications with images

Currently, in background notifications (at least for Android), if we include the imageUrl, [it always sets the style to `BigPictureStyle`](https://github.com/firebase/firebase-android-sdk/blob/56284d8438313b06194b9ff8153061efd0cb5296/firebase-messaging/src/main/java/com/google/firebase/messaging/DisplayNotification.java#L147).

It works well when using `BigTextStyle`, but my notification handler won't fire if the app is killed.

We need a way to specify the Style in the fcm payload somehow, so that if it's present, we can use that instead of assuming the sender meant `BigPictureStyle`.

## How would you use it?

In our app, wherein we have to display notifications with user avatars (of the user whose activity has caused the notification to fire), and when expanding, it shows a huge profile picture of that user, which looks bad not just because we now suddenly have the activity user's face plastered on the screen, but also because that was not the point of the picture. If we can use `BigTextStyle`, it would look awesome as the profile picture would still be small and would stick to the right like we intend it to.

Even if we override that behavior with our own custom FirebaseMessagingService child class, it won't fire when the app is in a killed state, so we really need that fix here.

P.S. I'm (extremely) new to native app development, so if there's a way that I couldn't find, please point me to it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.