News

Google Chrome now supports push notifications for Extensions


Google’s Chrome dev team announced that Chrome extensions can now make use of Google Cloud Messaging for Chrome for push notifications so that the extensions need not poll the respective servers again and again. GCM for Chrome works in same way as GCM for Android. GCM for Chrome can be used across all channels of Chrome. All you need to do as a developer is get a token/channel ID and pass the received token to your server. Attach the token to the GCM server side API whenever you are sending a message to your app extension. The image below gives a better picture on this process. Developers can find more detail on this server here and sample apps having GCM can be found here.

Extension users on the other hand should login to Chrome using their authentication id and password and stay logged in to the browser to make use of push notifications.

Procedure to send a message (for devs):

  1. Request a token (channel ID) via chrome.pushMessaging.getChannelId().
  2. Pass the returned token to your server.
  3. Whenever you need to send a message to your app or extension, post the message along with the token to the GCM server-side API.
  4. Message delivered in real time to Chrome and triggers event page wake up
  5. Message delivered to chrome.pushMessaging.onMessage listener.

Source

 

Amarendra

Co-Founder of GadgetDetail, gadget lover, addicted to American TV shows, fan of Ferrari and Federer, Bengalurian, FOOD LOVER, multiplex hater.

Related Articles

Subscribe
Notify of

0 Comments
Inline Feedbacks
View all comments
Back to top button
0
Would love your thoughts, please comment.x
()
x