Web Push by Airkod

Development of a technology that increases sales by tens and sometimes hundreds of percent called "Web Push".

About the meaning

Web Push is a short text message that pops up on your phone or browser with an advertisement for goods or services from a seller. 

This technology allows users to subscribe to periodic app notifications. Most likely, you have repeatedly received similar notifications with information about the start of a promotional offer for a product, a discount on a service, or a notification about the premiere of a new picture in a cinema.

To start interacting with web guns, you, as a user, need to “Allow” sending notifications to your phone. Also, you can prohibit mailing by selecting “Deny” or simply minimize the “Close” window. Depending on what the user chooses, one of these statuses will come into the code and it will be automatically distributed how to interact with it further.

 If “Allow” is selected, then a token (identifier) ​​with a key binding is created, by which the server will subsequently contact the user and make a mailing. If the browser cannot identify the service worker due to any changes, it will send a request to reinstall the service worker, and the reinstallation operation will occur automatically.
If you have previously rejected the subscription to notifications, you can restore it through the browser settings, in the “Push notifications” column >> Specify the list of allowed sources.

The first service for sending such messages - Apple Push Notification Service (APNs) - appeared in June 2009.

In 2010, Google Cloud to Device Messaging was released.

From a technical point of view, web push notifications are divided into two parts:

1. Push API

2. Notification API

Push API is a technology that works on the Back End side in the “server >> service worker” link. A service worker is essentially a code that makes push notifications work. We will consider in detail about service workers as a separate mechanism in the following articles.

Thanks to the service workers, applications can work out a number of functions without connecting to the network.

Notification API is a technology that works on the Front End side in the “service worker >> front end” link. For the user, this is the very message about subscribing to web notifications or the notification itself.

In order to implement such functionality, the developer needs to check whether the browser supports interaction with service workers and their current version.

After this step, you need to register a service worker. Registration takes place by adding a service worker to the javascript code of the project, after which the browser reads it and it is identified and further activated.