Is there any training on creating push notifications?

Want to learn how to create push without serwisow not distribute links to any niud training on this issue since the creation of workerb to the notification? Interisuet not a theory in the documentation from google and firefox, and what some practices.
July 2nd 19 at 17:51
4 answers
July 2nd 19 at 17:53
Solution
If you don't understand the theory, then in practice you have nothing worthwhile will come of it.
And quite a good theory here https://developer.mozilla.org/en-US/docs/Web/API/P...
And it contains a reference to a very real example https://github.com/chrisdavidmills/push-api-demo

How this thing is used in practice.

Once you have decided that you are going to send, you need to do a few things.
1. To ask the user for permission to send notifications. This is done through Notification.requestPermission. If we get confirmation, then go ahead, if not hammered on this business. Here you need to be very careful and do it gently.

2. To create a background processor that will accept push notifications from the server. This is done via a call to navigator.serviceWorker.register. For example https://github.com/chrisdavidmills/push-api-demo/b...
He subscribes to the channel. The channel is like a chat room.

For the channel, the server is responsible. The server listens to the port the browser connects to the server and stupidly waiting until the server has something to send. The server may periodically send a blank email message to which the client must respond to maintain the connection active. Therefore, the server can be a lot of open the administrator connection.

3. Write a notification server. Nginx has a nice module. He will serve clients.

I recommend to view https://www.youtube.com/watch?v=5A5Iw9z6z2s
Not that I would not know rather do not understand how to end practice - vergie.Jerde commented on July 2nd 19 at 17:56
a little painted. - raou commented on July 2nd 19 at 17:59
: and the appearance of the notification and the Notification API and the Push API is the same? - cassidy.Green commented on July 2nd 19 at 18:02
: This is a different API. Pushey not have their own notifications to display the notifications use Notifications API - Rita_Hilpe commented on July 2nd 19 at 18:05
> For the channel, the server is responsible. The server listens to the port the browser connects to the server and stupidly waiting until the server has something to send. The server may periodically send a blank email message to which the client must respond to maintain the connection active. Therefore, the server can be a lot of open the administrator connection.
That kind of nonsense? =) - Rita_Hilpe commented on July 2nd 19 at 18:08
: well I know that different. Just wanted to find out about the appearance. Thank you. - cassidy.Green commented on July 2nd 19 at 18:11
: appearance will depend on the realization. MacOS likely will be the same, because the same Firefox will use system call to display the notifications. In Windows will be confusion and vacillation, as is usually the case. - raou commented on July 2nd 19 at 18:14
July 2nd 19 at 17:55
Solution
July 2nd 19 at 17:57
Solution
July 2nd 19 at 17:59
If in the browser, you learn Websockets, HTML5 Server Side Events, or, finally, normal AJAX Long polling can do the same thing, last most simple, if AJAX was already working.
If not in the browser, TCP/IP, WebSocket or HTTP long polling the same.

Find more questions by tags JavaScript