Reputation: 8147
The apns-expiration
field governs how long Apple will hold on to an apns message before giving up on delivering it (for example, if the device is turned off).
According to their docs, a value of zero means "no retention": meaning that if the message can't be delivered immediately, its discarded.
But what happens if the header isn't specified? In other words, what is the default behavior?
Upvotes: 8
Views: 8037
Reputation: 11
From my testing, not including the apns-expiration header, is the same as including it and setting it to 0. The notification is delivered once, if the device is offline, when its sent, the device will not get the message.
Upvotes: 0
Reputation: 362
According to the new Apple Docs, for no specified expiration date the notification is stored and retried for upto 30
days.
Upvotes: 1
Reputation: 2426
"If this value is nonzero, APNs stores the notification and tries to deliver it at least once, repeating the attempt as needed if it is unable to deliver the notification the first time."
Literally this means that the absence of the value equals to 0.
Upvotes: -1
Reputation: 8147
My information isn't based on documentation but rather on stats gathered from a multi-million users system. The policy at this time is to retain push messages for a long time (exactly how long I dont know - we've seen 1M seconds retention in some cases). Of course, as this isn't documented it could change in the future.
Note that this default value is similar to Google's policy (where the default is 2419200 seconds), with the exception that Google's policy is documented.
Upvotes: 3