
Events pass and lose their relevance. The letter you sent to the person informing you of the new promotion does not make sense after the end of the promotion. How to proceed? Push notifications can “die” when they are no longer necessary.
TTL - (Time To Live) lifetime. This is an important term on the Internet. Most often it applies to data packets and means the number of "hops" that the packet will "live"
')
As part of push notifications, TTL sets the notification lifetime in seconds. Moreover, if you set it to 0 (in PushAll -1), then either the notification will come immediately or never. In fact, this parameter sets how many seconds the notification will wait for the client while he joins the push server.
Recently we are often told: “First, explain what kind of service this is, and then write an article.”PushAll is an instant messaging platform.
If you look from the side of a regular user , this is “twitter”, where notifications arrive right away on the screen of your device, be it a smartphone, tablet or computer. In many ways, we went further and covered telegrams and email. That is, PushAll is such a thing that allows the user to control subscriptions to notifications from several hundred sites while simultaneously distributing messages to their devices.
When viewed from a developer or entrepreneur perspective: PushAll allows you to send alerts to browsers and mobile platforms without creating your own solutions. That is, there is no need to write applications, no need to write plugins and create a subscription system for users on the site or control the delivery - everything will be done for you.
If you take the ideological side of the question: PushAll follows the idea that users do not need applications - they need content. That is, in the ideal world of the founder of PushAll, the user buys a new smartphone, puts one single application and he receives the necessary alerts. All the user needs is available through the browser. A unified application creates a "bridge" for receiving and working with alerts.
For example, in the current implementation, I (personally the author of the article) almost completely stopped launching applications. Moreover, all the content comes to me in the form of notifications. I wake up and since the morning I have thematic articles on my tags from a heap of resources, while everything is filtered out - I get only a squeeze of 2-3 articles in total. and not all dozens of morning articles from all resources. If I'm busy. I can simply erase not very important notifications, and when I have free time I open them through history. This is really something like Twitter - just the idea is not to fill the entire information space with garbage, but rather to filter out the necessary information from a variety of resources.
Let us turn to the article itself - TTL, how it is useful and how it can be used.
The advantages of working with TTL in push notifications
Our users have often complained that they receive a lot of notifications if they have not logged on to the network for a long time. At the same time, these notifications can be “expired” by several days, and the notifications themselves can come, for example, from a streamer channel. Using TTL, we can set the lifetime for 2-3 hours, that is, about 10,000 seconds, for stream notifications. Then those who logged on to the network (turned on the computer, opened the browser, or joined wi-fi) after this period will not receive this notification.
This technique really saves both time and money. Only those notifications that are still relevant are delivered. This may be the above described stream notifications and stock notifications. You can even set the TTL to ordinary news posts, the fact is that the news may lose relevance over time, or most likely in 2-3 days I have already heard them somewhere. There is also a notification history that allows you to see everything in chronological order.
What if the user misses something important?

The user will always be able to see the notification in the history, and also, for example, the add-on for Google Chrome has a section “missed”, if you have not seen the notification anywhere (on any device) then it will be in this section. The same section, later, will be in the Android application and in the history web interface.
How to use TTL (lifetime) for my notifications?

You can set the default TTL in the settings section of your channel, or during manual distribution, set a specific TTL for the notification to be sent. Through the API, you can pass the ttl parameter. Be careful with using TTL = -1, yes, in essence, this means that it will be delivered either now or never, but if the clients have lost the connection at the moment, the notification will not reach them. Although, most likely this option is convenient for online contests.
Where does TTL work?
It fully works for Android and Chrome add-ons. During the week it will be added to SocketPush and WebPush. Also, if you have a big delay in your email (for example, a day), then TTL will also be taken into account for notifications, that is, you will not receive “expired” notifications by mail either. Unfortunately, nothing can be done with the telegram - PushAll simply sends a message to it and that's it, from now on it is considered to be delivered.
Original article in our blogMore articles on push notifications