Yes, you can set an expiration time when publishing a push notification via APNS. Timeouts are measured in seconds (default is 3600, or 1 hour) and are set via the top level key of pn_ttl
. For example, to set the timeout to 60 seconds (1 minute):
{ "pn_apns": { "aps" : { "alert" : "Portugal vs. Denmark" "body":"Denmark - gooooooaaalllll!" } }, "pn_gcm" : { "notification": { "title":"Portugal vs. Denmark", "body":"Denmark - gooooooaaalllll!" } }, "pn_ttl": 60 }
Note that Apple will only queue a single message per device/app. For example, if you send 10 push notifications to a device that's powered off, then all notifications besides the last one are discarded, regardless of TTL.
(If a negative integer is entered for TTL value, the value is ignored and defaults to retention policy in Storage settings.)