Skip to content

Instantly share code, notes, and snippets.

@vldvel
Last active April 14, 2018 02:21
Show Gist options
  • Save vldvel/83ab88503d4fc42a85a51675577fb9fb to your computer and use it in GitHub Desktop.
Save vldvel/83ab88503d4fc42a85a51675577fb9fb to your computer and use it in GitHub Desktop.
Notification Request API
Notification.requestPermission((permission) => {
switch (permission) {
case 'granted': {
console.log('Now we can send notifications!');
break;
}
case 'denied': {
console.log('User close the request pop-up!')
}
case 'default': {
console.log('We can\'t send any notifications in both denied and default cases');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment