问题
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
回答1:
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)
来源:https://stackoverflow.com/questions/52533068/how-to-send-push-notification-with-image-in-react-native-android-using-rnfirebas