How Can I Set The Time-To-Live (TTL) For a Push Notification?

The process to add a TTL to a push notification depends on the target platform. You can see a guide for each platform below.

APNS (iOS)

The `expiration` value can be set at part of the APNS payload as below. The value should be an EPOCH timestamp in the future.

{
  "apns": {
    "expiration": 1640995200,
    "aps": {
      "alert": {
        "body": "Hello World!"
      }
    }
  }
}

FCM (Android)

The `time_to_live` value can be set to the number of seconds FCM should hold the notification if the device is unreachable. The maximum and default value is 4 weeks. Read more about this in the Firebase documentationarrow-up-right

  "fcm": {
    "time_to_live": 10000, # Number of seconds
    "notification": {
      "body": "Hello World!"
    }
  }

Web Push

See our documentationarrow-up-right guide for an example of how to configure this for Web.

circle-info

Still have questions? Please reach out to our Support team by visiting this pagearrow-up-right.

Last updated