gpt4 book ai didi

ios - 为什么 APNS 只传送最后排队的通知而不是所有排队的通知?

转载 作者:搜寻专家 更新时间:2023-11-01 06:52:14 24 4
gpt4 key购买 nike

问题陈述:我正在使用 voip 通知来显示本地通知。我正在尝试从 Apns 向离线设备发送通知。因此,它将所有未决通知排队。但是,它只会在设备变为在线。

最佳答案

根据苹果文档 Link

服务质量、存储转发和合并通知

Apple Push Notification service includes a Quality of Service (QoS) component that performs a store-and-forward function. If APNs attempts to deliver a notification and the destination device is offline, APNs stores the notification for a limited period of time and delivers it when the device becomes available again. This component stores only the most recent notification per device and per app. If a device is offline, sending a notification request targeting that device causes the previous request to be discarded. If a device remains offline for a long time, all its stored notifications in APNs are discarded.

To allow the coalescing of similar notifications, you can include a collapse identifier within a notification request. Normally, when a device is online, each notification request that you send to APNs results in a notification delivered to the device. However, when the apns-collapse-id key is present in your HTTP/2 request header, APNs coalesces requests whose value for that key is the same. For example, a news service that sends the same headline twice could use the same collapse identifier value for both requests. APNs would then coalesce the two requests into a single notification for delivery to the device.

关于ios - 为什么 APNS 只传送最后排队的通知而不是所有排队的通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56426542/

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