Web Alarms API
Web Alarms API
Written by Kay Ewbank   
Thursday, 14 February 2013

W3C has published the first working draft of the Web Alarms API Specification. The API gives developers access to device alarm settings for applications that need to notify the user.


Examples of applications suggested by W3C include alarm clocks, calendars or auto-updates. The system level API would be used to schedule a notification or to start an application at a specific time.

The Alarm API supports the following features:

  • Web applications can add multiple alarms and get a returned ID for each of them.

  • The returned ID is unique (within the application origin) and can be used to specify and remove the added alarm.

  • Web applications can pass a customized JSON object data to describe more details about each alarm setting.

  • Web applications can only access their own alarms.

  • When the alarm goes off, an alarm event will be fired.

  • All the alarms that have been added can be automatically restored after rebooting the system.

  • Alarm API actually does more than setTimeout because it can actively wake up the system from sleeping.

  • Whenever the system clock or timezone is adjusted at run-time, all the saved alarms will be rescheduled.

Using the API, you’d be able to add an alarm that respects the local time zone to a device using code such as

 var alarmId2; 
 var request = navigator.alarms.add(
   new Date("June 29, 2012 07:30:00"),
       { mydata: "foo" });

 request.onsuccess = function (e) {
                alarmId2 = e.target.result; };

 request.onerror = function (e) {
                alert(e.target.error.name); };


More Information

Web Alarms API Specification

Related Articles

Web Crypto APIs Work In Progress

W3C Draft For Device-Independent Input

W3C Publishes Push API Draft Specification


To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.


blog comments powered by Disqus



Fear And Loathing In the App Store 13 - Apple Rejects F.lux And It Isn't Even In The App Store!

I thought we had seen all the possibilities for troubles in the App Store, but this one reaches a new level of silliness. The app concerned wasn't even in the App Store, but Apple still managed to get [ ... ]

Computer Pioneer Gene Amdahl Dies

Gene Amdahl, the computer architect who designed the IBM System/360 and the first LSI-based mainframe, has died at the age of 92.

More News


Last Updated ( Thursday, 14 February 2013 )

RSS feed of news items only
I Programmer News
Copyright © 2015 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.