Can you send OS level notification using JavaScript?

preview_player
Показать описание
Did you know that you can send OS level notification using JavaScript? The Web Notification API let's you do just that!

To send notifications, you have to follow two steps:

✨ Get permission from the user

🔸 If this is the first time this method is being called, the browser displays a prompt to the user.

🔸 If user has allowed showing notifications for your website, the promise resolves with the value 'granted'

🔸 If user has denied, then the promise resolves with value 'denied'

✨ Send the actual notification

🔸 Call new Notification(...) by passing the title along with an optional set of configurations such as the icon, body text, etc

Voila ✨ you have sent your first notification!

#javascript #html #developer #coding #css #programming
Рекомендации по теме
Комментарии
Автор

For more detail check video description

CodeMentor
Автор

alert("hello world"); is the same?

BartoszSobótkowski
join shbcf.ru