How Can I Set The Time-To-Live (TTL) For a Push Notification?
PreviousPublishingNextWhy Don't Fcm Notifications Trigger ‘onMessageReceived’ When In The Background State?
Last updated
The process to add a TTL to a push notification depends on the target platform. You can see a guide for each platform below.
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!"
}
}
}
}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 documentation
"fcm": {
"time_to_live": 10000, # Number of seconds
"notification": {
"body": "Hello World!"
}
}See our documentation guide for an example of how to configure this for Web.
Still have questions? Please reach out to our Support team by visiting this page.
Last updated