gpt4 book ai didi

java - 设备重启后不显示 Android onesignal 推送通知

转载 作者:行者123 更新时间:2023-12-04 17:10:40 24 4
gpt4 key购买 nike

问题
在我的 webview 应用程序中,我使用 onesignal 从我的服务器发送用户推送通知。设备不仅会在应用程序运行时收到通知,还会在应用程序完全关闭时收到通知。但是,如果我关闭然后再打开手机,则不会收到通知。只有在启动应用程序后,我才会收到这些消息。

想法
我的想法是在启动时启动我的应用程序并立即关闭它,因此用户甚至不会注意到它。但是,我认为这不是一个很好的解决方案。

开发人员通常如何解决这个问题?

最佳答案

首先,您必须在重启后至少等待 24 小时,以确保通知是否送达 (per documentation)

sample

要缩短等待时间,您应该将通知优先级设置为high priority 10

High Priority: These notifications are delivered immediately, though fall subject to the standby bucket policy on the device.

Set a high priority 10 if you need it to go through any doze mode /other power saving modes. But only use priority 10 when you reallyneed to as there is a daily limit where it might fallback to normalpriority.

关于java - 设备重启后不显示 Android onesignal 推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69512947/

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