gpt4 book ai didi

iphone - 接收 iPhone 关闭时奇怪的 Apple 推送通知行为

转载 作者:行者123 更新时间:2023-12-03 19:43:06 26 4
gpt4 key购买 nike

当接收方 iPhone 关闭时,我发现 Apple 推送通知服务器出现一些非常奇怪的行为。这是我的场景:

-Send push notification A to Apple. Within a few seconds a push notification popup gets displayed as expected on the iPhone.
-Send blank notification to Apple to cancel previous one (the previous notification is pointless after about 10 seconds, that's why I want to get rid of it). Nothing displayed on the iPhone.
-Turn OFF iPhone completely (not asleep, it is powered down).
-Send push notification B to Apple. Wait 10 seconds.
-Send blank notification to Apple to cancel previous one. Wait 10 seconds.
-Send push notification C to Apple. Wait 10 seconds.
-Send blank notification to Apple to cancel previous one. Wait 30 seconds.
-Turn ON iPhone.
-After about 60 seconds a push notification popup is displayed for notification B on the iPhone.
-Notification C never seems to arrive.

这很奇怪!通过阅读苹果文档,我期望只发送最新的推送通知。我希望能够发送我的空白通知,我当然没想到会发送最早的未发送推送通知!

苹果文档说:

Apple Push Notification Service includes a default Quality of Service (QoS) component that performs a store-and-forward function. If APNS attempts to deliver a notification but the device is offline, the QoS stores the notification. It retains only one notification per application on a device: the last notification received from a provider for that application. When the offline device later reconnects, the QoS forwards the stored notification to the device. The QoS retains a notification for a limited period before deleting it.

有人见过这种行为吗?我只是遇到了某种时间窗口错误吗?应该发生什么?

更新:
- 如果我关闭手机并等待 5 到 15 分钟再发送任何推送通知,则不会出现此问题。在这种情况下,当我打开手机时,我看不到任何通知弹出窗口,尽管我不确定这是否是苹果删除通知的结果,或者他们的“队列”正常工作(即保留最新的空白通知)第一个带有弹出窗口的)。
-我将通过将 APNsLogging.mobileconfig 放置到 iPhone 上来进一步调查,以查看它收到了哪些通知。
-关闭 wifi 似乎不会改变结果。
-我已针对这种情况向 Apple 提出了错误报告。

最佳答案

您可能需要在蜂窝网络和 WiFi 网络上检查此行为。当手机使用 WiFi 时,会出现很多奇怪的行为,尤其是在涉及多个 NAT 路由器的情况下,即在一家大公司中,有一个主路由器和每层 WiFi 路由器,或者在一个有多个路由器的家庭中扩大范围。但在手机上它非常稳定。

此外,10 秒的取消延迟可能会缩短它的时间。他们不保证及时交付,在排队推送请求后,我在生产服务器上出现了长达 3 分钟的延迟。您可能需要针对系统拥塞做好计划。

无论怎样,听起来它可能值得错误报告者报告。

关于iphone - 接收 iPhone 关闭时奇怪的 Apple 推送通知行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1638783/

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