Include js file in you project:
<script type="text/javascript" src="web-messenger.js"></script>
var webMessenger = new WebMessenger();
webMessenger.send('Message title', {body: "New item was added.", icon: "icon.jpg"});
var webMessenger = new WebMessenger();
webMessenger.on("click", function () {
/* Do something. */
}).on("close", function () {
/* Do something. */
});
webMessenger.send('Message title', {body: "New item was added.", icon: "icon.jpg"});
var webMessenger = new WebMessenger();
webMessenger.off("click"})
.off("close");
webMessenger.send('Message title', {body: "New item was added.", icon: "icon.jpg"});
var webMessenger = new WebMessenger();
/* If callback return true message will be send. */
webMessenger.queue('title', { body: "body for MESSAGE 1", icon: "icon.jpg" }, function () {
return false;
})
.queue('title', { body: "body for MESSAGE 2", icon: "icon.jpg" }, function () {
return true;
});
/* Message callback has higher priority. */
webMessenger.processQueue(function () {
return true;
});