简体   繁体   English

当应用程序被杀死时,有没有办法在 flutter 中接收数据通知?

[英]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.

相关问题 为什么我的 flutter 应用在 iOS 上运行时没有使用 Firebase 云消息接收通知? - Why my flutter app doesn't receive notifications using Firebase Cloud Messaging when running on iOS? 应用程序被终止时,设备未收到推送通知 - push notification not received to devices when app is killed 应用程序被杀死时 FCM 通知不会触发 - FCM Notification not firing when app is killed 如何从 Flutter 应用程序发送推送通知 - how to Send push notifications from Flutter app 如何使推送通知针对 flutter 应用程序? - How to make push notifications target a flutter app? React-Native - 当我关闭像信使这样的应用程序时,我怎么可能仍然收到来自其他人的来电通知 - React-Native - How is it possible that when I close an app like messenger I can still receive incoming call notifications from others Flutter,错误,在应用程序中添加数据时,firebase - Flutter, error, when add data in app , firebase 当我的应用程序被杀死时如何更新字段(Firebase) - How to update a field when my app is killed(Firebase) 本机反应-应用程序被杀死/未启动时未收到通知 - react native - not receiving notification when app is killed/not started flutter 应用程序中将始终出现通知权限弹出窗口 - Notifications permission pop-up will always appear in flutter app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM