📜 ⬆️ ⬇️

Alpha version of SocketPush - universal notifications for all browsers + 3 million free notifications


We found that a number of browsers do not have an integrated GCM service in their arsenal at all. Among them, for example, Opera, Vivaldi, Firefox. Safari has APNS, but we will work through it later.

Also today there was a vivid example of the need for this function - one of the users complained that no pushes work at his work: neither the web, nor through the supplement. The thing is that all extra ports are blocked at his work. In our case, the socket works through proxying nginx on port 443 and is not blocked by filters.

We need a little load testing, and also check whether all notifications come to the right recipients. These notifications are checked by me in chrome and firefox. Check in edge, ie is necessary (though I doubt that will work) and of course safari.
')
First of all, this is a convenient method to turn on notifications "for a while", and then turn them off by closing the tab. Unlike other methods, this method does not work when the tab or browser window is closed. Concerning inclusion, and a little about architecture - in more detail under a cat.

How to turn on?


In the upper right corner, after logging in , there is a question icon. You need to click on it and select "Enable before closing the tab", then allow notifications in chrome.

How it works?


Based on the article - Making web sockets for PHP from scratch

I made a wizard that tracks all requests to the socket, and a worker who listens to the redis subscription to receive commands to send alerts, add or delete a user. And the master listens to the common socket with the worker, and the worker only writes to this socket when it is necessary to send an alert. In turn, the master also listens to the sockets of the connected users and the socket for the connection. This allows in 2 processes to check and sockets, new notifications and communicate between two processes without any locks.

In Unicast, there is no support for this function so far, it is done so that personal, important pushes do not fly away to where it is not necessary in case of alpha version failures.

Where will it be applied?




How to test?


Turn on notifications as mentioned in the first section. Then in your profile, try to ping SocketPush a couple of times. Then try administering through the test form below to make a test notification. Subscribe to channels, check how alerts will be sent from them.

Write down how it works in various browsers. You can in the comments, or in our community Google+

3 million notifications every month


We are a little confused, it turns out last time we reduced the number of alerts from 5k per day to 3k per day. Now we raise up to 100k per day.

Ps. In safari tested - it works.



But in Edge it seems to work and will not, I was told that he does not even request access to notifications, that is, it seems he does not support them at all.

That is, every month you can send 3 million notifications for free.

Source: https://habr.com/ru/post/269263/


All Articles