Last active
April 14, 2018 02:21
-
-
Save vldvel/83ab88503d4fc42a85a51675577fb9fb to your computer and use it in GitHub Desktop.
Notification Request API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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