0

I want to implement real-time push notification in my web application for voice calls. I have analysed WebSockets, Long-polling, Firebase and Atmosphere. Both Firebase and Atmosphere are not reliable, for Atmosphere, sometimes push does not reach to the browser and for Firebase, when token expires, onTokenRefresh method is not called because of which no notification is received on the browser side.

Is there any other solution available which can give web push notification like google hangout or Facebook or WhatsApp call?

NPC
  • 841
  • 2
  • 10
  • 18
Rohit Shelhalkar
  • 756
  • 1
  • 9
  • 15

1 Answers1

1

I'd say that depends on your server side. If your server is capable of maintaining a TCP connection and is somehow stateful, WebSocket is the standard way to go as it is IETF RFC. However keep two things in mind:

  1. Not all clients support WebSocket, so it could come in handy to have a fall back, like long-polling ajax etc. There are numerous libraries built for that exact scenario, like socket.io, SignalR etc.
  2. There is no internet protocol that guarantees that your push-notification reaches the client, since the connection can always be closed by them or due to bad connectivity. My advice would be: Have clients send you a confirmation for each push-notification. If you do not get the confirmation then treat the message as not received and try again when the client connects the next time. (You'll need some sort of database for that)

Use a secure connection in any case. Whatever protocol you use it should facilitate TLS.

Community
  • 1
  • 1
Peter
  • 1,361
  • 15
  • 19