JSFiddle - React, Tailwind, and code Playground
by Md. Atiquzzaman Soikat
JavaScript
Notification.requestPermission().then(function(result) {
if (result === 'denied') {
console.log('Permission wasn\'t granted. Allow a retry.');
return;
}
if (result === 'default') {
console.log('The permission request was dismissed.');
return;
}
// Do something with the granted permission.
});
if(Notification.permission === 'granted'){
console.log('notification allowed');
}else{
console.log('not allwed');
}