JSFiddle - React, Tailwind, and code Playground
by padma rubhan
HTML
<button id="window_notif" type="button">notificar</button>
JavaScript
var notificacoes = function(title, options) {
if (window.Notification.permission != 'granted') {
return window.Notification.requestPermission(function() {
return notificacoes(title, options);
});
}
var notificacao = new Notification(title, options);
};
document.getElementById('window_notif').addEventListener('click', function() {
var notificar = notificacoes('Gfee Notification', {
body: 'you have one update on gfee',
icon: 'http://gfee.co/hmgroup/assets/img/dlogo.jpg',
});
});