APNS:屏幕闪烁但不显示文本

APNS: Screen blinks but no text is shown

问题

我从服务器发送的某些 APNS 推送通知包含 alertsound,但它们只会导致 iPhone 屏幕短暂闪烁,而不会文本显示在通知部分。

上下文

知道为什么有些 alert 文本没有出现在通知栏中吗?

有没有可能你发送的太多太快了?

来自Technical troubleshooting guide

Some Notifications Received, but Not All

If you are sending multiple notifications to the same device or computer within a short period of time, the push service will send only the last one.

Here's why. The device or computer acknowledges receipt of each notification. Until the push service receives that acknowledgment, it can only assume that the device or computer has gone off-line for some reason and stores the notification in the quality of service (QoS) queue for future redelivery. The round-trip network latency here is of course a major factor.

不久前我在两种情况下看到了类似的问题:

18798969 将徽章设置为 0 的通知永远不会出现! 状态:仍在营业

发送一条通知并将徽章设置为 5。然后发送另一条通知并将其设置为 0。从未看到该文本(屏幕短暂闪烁)

19238323 'content-available' 条通知未发送到我的应用 状态:18645681 的副本(打开)

如果通知包含 'content-available' 值,并且 WIFI 信号较弱,则不会显示或发送。靠近路由器,这样你就有了 5 bar 的信号,现在可以了。