颤音:FCM背景通知大图标
我正在使用firebase_messaging和flutter_local_notifications进行通知,并且在局部(前景)通知的情况下,我能够显示一个大图标,但是当应用程序为背景时,我似乎并没有找到一种显示同一大图标的方法。
I'm using firebase_messaging and flutter_local_notifications for notifications, and I was able to show a large icon in case of local(foreground) notifications, but I didn't seem to find a way to show the same large icon when the app is background.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
处理背景Noti并使用本地通知显示Noti。
firebasemessaging.onbackgroundMessage(_FireBasemessagingBackgroundHandler);
handle background noti and show noti using local notification.
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
使用
bladicon
的更好方法是在发送通知时使用Notification Poreload中的Image属性:A better way to use
largeIcon
is using the image property in notification payload when you are sending the notification:1-在背景中使用Flutter_local_notifications显示图像
2-在有效载荷中删除“通知”,然后将数据添加到
“数据:{
标题:“标题”,
身体:“描述”,
图像:“图像”,
}”
1- use flutter_local_notifications in backgroundMessageHandler to display the image
2- remove the "notification" in the payload and add your data in
"data:{
title: 'title',
body: 'description',
image: 'image',
}"
此代码可帮助您接收通知并在应用程序中使用:
如果您有任何困难,请查看本文: flutter推动通知介质。
谢谢。
This code help you to receive a Notification and to use in your app :
If you have any difficulty, please check this article : Flutter Push Notification Medium.
Thanks.