图像不显示在通知 React Native Firebase 中
我在 rnfirebase v5.6.0 的通知中遇到图像问题。 我从消息中收到图像,并且图像链接正确,但无法在通知中显示图像。 它不会一直发生,它会在某些未知的情况下发生。 这是我的显示通知代码
const notification = new firebase.notifications.Notification({
sound: 'default',
show_in_foreground: true,
})
.setNotificationId(notificationId)
.setTitle(notificationData.title)
.setBody(notificationData.body)
.setData(notificationData.data)
.android.setColor('#ffffff')
.android.setAutoCancel(true)
.android.setChannelId('channelId')
.android.setSmallIcon('ic_stat_name')
.android.setPriority(firebase.notifications.Android.Priority.Max)
.android.setBigPicture(message._android._bigPicture.picture)
.android.setLargeIcon(message._android._largeIcon);
firebase.notifications().displayNotification(notification);
有关更多信息,我的 React Native 版本是 0.61.5,我的 React-Native-Firebase 版本是 5.6.0。
I have a problem with images in notification with rnfirebase v5.6.0.
I receive image from messaging and the image link correct but can't show the image in notification.
It does not happen at all the time, it happens in some unknown situations.
This is my display notification code
const notification = new firebase.notifications.Notification({
sound: 'default',
show_in_foreground: true,
})
.setNotificationId(notificationId)
.setTitle(notificationData.title)
.setBody(notificationData.body)
.setData(notificationData.data)
.android.setColor('#ffffff')
.android.setAutoCancel(true)
.android.setChannelId('channelId')
.android.setSmallIcon('ic_stat_name')
.android.setPriority(firebase.notifications.Android.Priority.Max)
.android.setBigPicture(message._android._bigPicture.picture)
.android.setLargeIcon(message._android._largeIcon);
firebase.notifications().displayNotification(notification);
For more information my react native version is 0.61.5 and my react-native-firebase version is 5.6.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将react-native-firebase包更新到6.0.0及以上版本,并使用notifee包进行通知
Update the react-native-firebase package to version 6.0.0 and above and use notifee package for notifications