I am trying to use local notification on Phonegap. I use phonegap-plugin-local-notification 1.0.1 "phonegap-plugin-local-notification" and following code to test it (on device ready state):
if ("Notification" in window) {
Notification.requestPermission(function (permission) {
// If the user accepts, let's create a notification
if (permission === 'granted') {
var notification = new Notification("My title", {
tag: 'message1',
body: "My body"
});
notification.onshow = function() { console.log('show'); };
notification.onclose = function() { console.log('close'); };
notification.onclick = function() { console.log('click'); };
}
});
}
What I got is Notification is NOT in window. Does anybody know how to use this plugin or am I supposed to add anything to config.xml.
Or is there any other solution to send local notification