user8435607
user8435607

Reputation:

How to send push notification with image in react-native android using rnfirebase

I am sending notification only and notification-data push notifications successfully in android using rnfirebase. How can i send data only push notification with image as I am following https://rnfirebase.io/docs/v5.x.x/notifications/receiving-notifications

Upvotes: 2

Views: 4469

Answers (1)

Donut
Donut

Reputation: 112915

If you are displaying your notifications with firebase.notifications().displayNotification, you can use Notification.BigPictureStyle in order to display an image in your notification by calling setBigPicture on notification.android.

Example:

const notification = new firebase.notifications.Notification()
    .setTitle(title)

notification.android.setBigPicture('url of your image')

firebase.notifications().displayNotification(notification)

Upvotes: 6

Related Questions