Skip to content

Instantly share code, notes, and snippets.

@c4software
Created July 7, 2017 07:47
Show Gist options
  • Save c4software/08f19a977b2ddbbc76ac86760b83a456 to your computer and use it in GitHub Desktop.
Save c4software/08f19a977b2ddbbc76ac86760b83a456 to your computer and use it in GitHub Desktop.
document.getElementsById("monBoutton").onclick = function () {
Notification.requestPermission(function (p) {
var n = new Notification("Univ-Angers", {
icon: "http://www.univ-angers.fr/skins/UnivAngers/resources/img/logo-angers.png",
body: "Test de notification"
});
console.log(n);
});
};
@c4software
Copy link
Author

c4software commented Jul 7, 2017

Après une fois que l’utilisateur a accepté :

new Notification("Univ-Angers", {
  icon: "http://www.univ-angers.fr/skins/UnivAngers/resources/img/logo-angers.png",
  body: "Test de notification"
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment