android - 在深度打盹模式测试中未收到 FCM 高优先级消息
问题描述
我开始使用以下命令在深度打盹模式下测试应用程序:
$ adb shell dumpsys battery unplug
$ adb shell dumpsys deviceidle force-idle
$ adb shell dumpsys deviceidle get deep
最后一个检查设备是否处于空闲状态的命令。
当高优先级推送发送到设备时,应用程序会显示全屏意图通知以显示呼叫屏幕。
最初收到推送并显示屏幕,但在 3-5 次推送后未收到。此外,当我看到日志时,它显示以高优先级接收推送,但降级为正常:
Priority: 2
Original Priority: 1
在onMessageReceived(remoteMessage: RemoteMessage)
使用方法中:
remoteMessage.priority
remoteMessage.originalPriority
这些是呼叫邀请高优先级推送,因此 ttl 为 0。
请帮助我了解以下内容:
- adb 命令是否
$ adb shell dumpsys deviceidle force-idle
不利于测试并使测试结果错误? - 全屏意图是否不能防止桶填充降低优先级,就像我们的例子一样?
- 有没有办法处理它,以便应用程序每次都收到高优先级推送,即使在打盹模式下也是如此。
解决方案
推荐阅读
- azure - CloudBlobClient 和 BlobClient 的区别
- ruby-on-rails - 每个 Rails 引擎的会话存储
- apache-kafka - Kafka 压缩在消费者端失败
- pine-script - Pine 编辑器中的编号栏
- graph - 卸载 TigerGraph 的开发者版或企业版的常见做法是什么?
- python-3.x - 有没有办法可以使用 groupby.sum 并保留其他列?
- javascript - 是否有用于查找元素悬停计数的 jQuery 函数?
- javascript - 如何计算 JavaScript 中关联数组的长度?
- javascript - 如何在 Angular 8 中模拟一个回调函数以使用 jasmine 测试一个 Promise
- python - 使用 sklearn ColumnTransformer 函数。参数有什么作用?