[英]Is there a way to receive data notifications in flutter when the app is killed?
I am trying to implement custom ui for push notifications in android (title, body, image loaded from url),我正在尝试为 android 中的推送通知实现自定义 ui(标题、正文、从 url 加载的图像),
the firebase_messaging dart plugin has a limitation for receiving data notifications when the app is killed. firebase_messaging dart 插件在应用程序被终止时对接收数据通知有限制。
using data payload instead of notifications payload is the option to draw custom ui notifications in android natively.使用数据有效负载而不是通知有效负载是在 android 中本地绘制自定义 ui 通知的选项。
Is there a way to receive data notifications in flutter when the app is killed?当应用程序被杀死时,有没有办法在 flutter 中接收数据通知?
You can write a background message handler in headless function and use firebase local notification plugin to show the notification您可以在 headless 函数中编写后台消息处理程序,并使用 firebase 本地通知插件来显示通知
this tutorial will definitely help you本教程绝对能帮到你
https://medium.com/@sylvainduch/firebase-messaging-catch-them-all-3f9c594734d7 https://medium.com/@sylvainduch/firebase-messaging-catch-them-all-3f9c594734d7
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.