Google Adding Push Notification Support in Chrome
Push notification support has arrived for Web apps for Chrome and Chrome OS.
Chrome product manager Mark Scott said on Friday that the team has launched Google Cloud Messaging for Chrome and Chrome OS, a push notification system that allows Chrome Web apps and extension developers to wake up their apps remotely and/or send alerts to users. It follows the Android version which was launched back in 2012 during Google I/O.
This new Chrome push notification system is a step forward in helping browser-based Web apps catch up with native software that already sends notifications directly to the user. As an example, this new system could allow a calendar app to push updates to the user even when it's not open, or a stock app to alert the user of current prices in "near real time".
Prior to launching this service for Chrome, responding to something that occurs outside of Chrome -- such as a news alert, a message sent to a user or a stock hitting a price threshold – could be accomplished by repeatedly polling a server. However this process not only consumes bandwidth, but reduces battery life if the user is on a Chromebook or laptop.
However Google Cloud Messaging relies on an efficient push channel that’s only established for signed-in users. Messages are automatically delivered to all the devices where the user has signed in and installed the supporting app or extension.
Once the user installs the compatible Web app or extension "client", it requests the user's channel ID and sends the information to the developer's server. When the time comes to alert the user with a message, it's sent from the server to the push messaging service which pipes the message to all instances of Chrome where the user is signed in.
"When the app or extension starts, it needs to register a handler to receive the pushMessaging.onMessage event," Google states. "When the message arrives on the client, Chrome starts the app or extension, if it is not already running, and calls the registered handler."
News of the new push notification system arrives just before the launch of Google I/O 2013 which takes place next week. The new feature will undoubtedly make Chrome OS feel more like a native platform despite its web-based roots. A new wave of Chromebooks is expected to be revealed next week during the opening three-hour keynote along with a possible string of Android-based notebooks.