DEV Community

How to show desktop notifications using JavaScript

Atta on May 19, 2019

This post was originally published on attacomsian.com/blog. JavaScript Notifications API enables web pages to display messages to users on thei...
Collapse
 
anwar_nairi profile image
Anwar

I am very interested in adding native notification to my web app. For the moment I use in app notification, kinda looks olddie for me...

Do you know which strategy I could use server side? How a client can be aware of new notifications?

Collapse
 
attacomsian profile image
Atta

You need to implement web push notifications if you want to send notifications from the server-side. It is a bit complex usage of Notification API.

Last year, I did something like this. Here are the links to source code:

Collapse
 
nenadkaevik profile image
Nenad Kaevik

I will have to add a note here. Notifications work only on https protocol :)

Collapse
 
attacomsian profile image
Atta

Yes, you are right :) I updated the post.

Collapse
 
kienngo profile image
ken

Thanks for the post. Will definitely try this out.

Collapse
 
mativl profile image
Matias Vallarino

Thanks, this´s great

Collapse
 
anfossistudio profile image
AnfossiStudio

Thank you very much <3

Collapse
 
thomasbnt profile image
Thomas Bnt ☕

Thanks !

Collapse
 
bbarbour profile image
Brian Barbour

Atta, thanks for sharing this. I bookmarked this article because I have no doubt I'll need to do this in the future.