Lifespan - shaikhalvee/FCM GitHub Wiki
You can use the time_to_live
(0 to 2,419,200 seconds (28 days)) parameter to specify the maximum lifespan of a message.
Requests that don't contain this field default to the maximum period of four weeks.
Here are some possible uses for this feature:
- Video chat incoming calls
- Expiring invitation events
- Calendar events
If time_to_live = 0
FCM guarantees best effort for messages that must be delivered "now or never."
{
"collapse_key" : "demo",
"to" : "xyz",
"data" : {
"key1" : "value1",
"key2" : "value2"
},
"time_to_live" : 3
}