November 2011
Intermediate to advanced
384 pages
13h 23m
English
After permission has been granted, you can trigger a desktop notification pop-up message at any time in your web application. Naturally, the whole point in displaying a desktop notification is to get the user’s attention when your web application is running in the background. This implies some sort of Ajax-like activity that triggers the launch. The Gmail service is a good example of this implementation. Simply leave Gmail running in the background and as new mail arrives, a desktop notification message makes the announcement.
var notifyAPI = window.webkitNotifications; if ( typeof notifyAPI == 'object' && notifyAPI.checkPermission() == 0 ) { var notifyMessage = notifyAPI. createNotification(iconURL, title, ...
Read now
Unlock full access