Push notifications for a web

1

I want to be able to send push notifications to a Facebook style website. That is, without the client (web) asking for notifications to be received by the server. I was thinking about making the communication with sockets, but I wonder how Facebook makes notifications even with the page closed (at least in Chrome).

    
asked by Quidi90 09.01.2017 в 08:46
source

1 answer

0

Push notifications are given thanks to a real-time database that sends a warning to the browser, in the case that the web page is closed, they use service workers (service workers) which they store in the cache, these workers are javascript files that are registered when the web is loaded for the first time, later they are activated when the real-time database sends a warning to the browser, one of the real-time databases is Firebase: link I recommend reading this article you can better understand how it works: link

    
answered by 26.10.2017 в 15:41