S
S
shell_execute2016-02-05 08:33:57
PHP
shell_execute, 2016-02-05 08:33:57

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

4 answer(s)
U
uvelichitel, 2016-02-05
@shell_execute

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)

O
Oleg Karnaukhov, 2016-02-05
@BupycNet

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

D
Dima Pautov, 2016-02-05
@bootd

What do you need for push notifications?

S
Supme, 2016-02-11
@Supme

I also wrote a chat in Go, with launch and authorization in puff, and when everything was already done, I found https://github.com/Imgur/incus

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question