gpt4 book ai didi

android - 触发几个高优先级通知后 Firebase 推送通知延迟

转载 作者:行者123 更新时间:2023-12-03 17:31:19 27 4
gpt4 key购买 nike

我使用 Firebase 高优先级推送通知来触发 Android 设备中的紧急警报。对于推送的前几次尝试,推送通知立即到达并且效果很好。但是当我在一定时间后继续触发推送通知时,延迟会不断增加。
我希望它立即触发,因为它是 panic 情况。
我也关注了the documentation内容如下:

High priority: FCM attempts to deliver high priority messages immediately, allowing the FCM service to wake a sleeping device when necessary and to run some limited processing (including very limited network access). High priority messages generally should result in user interaction with your app or its notifications. If FCM detects a pattern in which they don't, your messages may be de-prioritized. Android P introduced app standby buckets which limit the number of FCM high priority messages you can send to your app that don't result in the user using your app or viewing a notification. If, in response to a high priority message, a notification is displayed in a way that is visible to the user, then your app standby bucket quota will not be consumed by that message.

Because a small portion of the Android mobile population are on high latency networks, avoid opening a connection to your servers before displaying a notification. Calling back to the server before the end of the allowed processing time may be risky for users on high latency networks. Instead, include the notification content in the FCM message and display it immediately. If you need to sync for additional in-app content on Android, you can schedule an FJD job or a JobIntentService to handle that in the background.


如何确保尽快触发高优先级消息?在所有情况下都可能在一分钟内。

最佳答案

FCM 尝试立即传递高优先级消息,允许 FCM 服务在必要时唤醒 sleep 设备并运行一些有限的处理(包括非常有限的网络访问)。高优先级消息通常会导致用户与您的应用或其通知进行交互。如果 FCM 检测到一种模式(例如测试模式),那么您的消息可能会被取消优先级。 Android P 引入了应用备用存储桶,它限制了您可以发送到应用的 FCM 高优先级消息的数量,这些消息不会导致用户使用您的应用或查看通知。如果在响应高优先级消息时以用户可见的方式显示通知,则该消息不会消耗您的应用备用存储桶配额。

关于android - 触发几个高优先级通知后 Firebase 推送通知延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53646761/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com