apns-expiration 字段的默认值是多少?

What is the default value of the apns-expiration field?

apns-expiration 字段控制 Apple 在放弃传递 apns 消息之前保留多长时间(例如,如果设备已关闭)。

根据他们的 docs,零值表示 "no retention":意味着如果消息不能立即传递,它会被丢弃。

但是如果 header 未指定 会怎样?换句话说,默认行为是什么?

我的信息不是基于文档,而是基于从数百万用户系统收集的统计数据。目前的策略是将推送消息保留很长时间(我不知道具体多长时间 - 在某些情况下我们已经看到 1M 秒的保留)。当然,由于没有记录在案,因此将来可能会发生变化。

请注意,此默认值类似于 Google 的策略(默认值为 2419200 秒),但记录了 Google 的策略。

https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1

“如果此值不为零,APNs 会存储通知并尝试至少发送一次,如果第一次无法发送通知,则根据需要重复尝试。”

从字面上看,这意味着没有值等于 0。