Answer the question
In order to leave comments, you need to log in
How to properly organize push notifications on the site?
Good day, I want to organize a kind of live on the site. We are all used to seeing push notifications on social networks, for example, when someone writes to us.
The backend is written in PHP. Now I'm thinking what is the best way to write a push server - Go or NodeJS. I decided to connect the whole thing with the backend in PHP using RabbitMQ. Both Go and Node have ready-made modules that allow you to work with websocket and RabbitMQ. Am I right or should I change something? And maybe there is some kind of ready-made stack for this?
Answer the question
In order to leave comments, you need to log in
I wrote a live chat on websocket on Go on order (even somewhere I have it lying around on github). Everything worked, it was not difficult.
But, Go websocket implements the protocol of the latest RFC, while the old Opera and IE do not. In the corporate sector, in particular in state institutions, only old browsers are worth it. The customer said - add a padding to all proprietary implementations of the protocol or fallback to long_polling. I answered - too lazy, I'll write "Update your browser." The customer did not accept.
If you want to please everyone, use a library with a fallback to ajax_long_polling like socketIO (Drivers are written for Go), but the code loses its elegance and it becomes not a fan to write.
Push services apple and google work fine for mobile platforms (drivers are also written)
It’s better to make notifications when the tab is closed https://pushall.ru/blog/whatispushnotifications
By the way, it’s quite possible to do it, for example, in Chrome and Firefox in general through service workers with the Push API. Those. if the tab is open push can also update the data on the page. if closed, a notification will be sent to the screen
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question