[英]How do I send a high priority inbox style notification on Android using FCM?
I want to send a high priority notification to Android devices using FCM and have it displayed in the system tray as an Inbox style notification.我想使用 FCM 向 Android 设备发送高优先级通知,并将其作为收件箱样式通知显示在系统托盘中。
FCM does not allow you to configure the Android notification style server side, so I must send the send the android system notification client side, to use NotificationManager API to send an inbox style notification. FCM 不允许您配置 Android 通知样式服务器端,因此我必须发送 android 系统通知客户端,以使用 NotificationManager API 发送收件箱样式通知。
The only way to do this without an automatic default style notification is to use FCM data messages.在没有自动默认样式通知的情况下执行此操作的唯一方法是使用 FCM 数据消息。 But the Firebase Flutter docs (I am trying to implement a solution for this on Android Native and Flutter, but a Android Native solution will suffice) indicate that data messages are low priority...
但是 Firebase Flutter 文档(我正在尝试在 Android Native 和 Flutter 上为此实施解决方案,但 Android Native 解决方案就足够了)表明数据消息的优先级较低......
From the flutterfire docs :来自flutterfire 文档:
As mentioned above, data only messages are classed as "low priority".
如上所述,仅数据消息被归类为“低优先级”。 Devices can throttle and ignore these messages if your application is in the background, terminated, or a variety of other conditions such as low battery or currently high CPU usage.
如果您的应用程序处于后台、终止或各种其他情况(例如电池电量不足或当前 CPU 使用率较高),设备可以限制并忽略这些消息。
You should not rely on data only messages to be delivered.
您不应依赖于仅传递数据的消息。 They should only be used to support your application's non-critical functionality, eg pre-fetching data so the next time the user opens your app the data is ready to be displayed and if the message never gets delivered then your app still functions and fetches data on open.
它们应该只用于支持您的应用程序的非关键功能,例如预取数据,以便用户下次打开您的应用程序时,数据已准备好显示,如果消息从未传递,您的应用程序仍然可以运行并获取数据在打开。
So it seems, based on the premises presented here, that it is impossible to send a high priority inbox style notification on Android. Is this correct?因此,根据此处提供的前提,似乎不可能在 Android 上发送高优先级收件箱样式通知。这是正确的吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.