Item logo image for Push Messaging Sample

Push Messaging Sample

Developer Tools7 users
Item media 1 screenshot

Overview

A sample to demonstrate how to use Chrome Push Messaging.

Push Sample App Sample that shows how to use the [Push Messaging API](http://developer.chrome.com/apps/pushMessaging.html) in an app. How to install on your local machine: You can either install this from the Chrome Web Store at https://chrome.google.com/webstore/detail/push-messaging-sample-cli/bafimiidcfafikaonocgmmcpbbhfjjik or put this into a directory on your machine, and go to chrome://extensions, click on the "Load unpacked extension..." button, and choose the directory where you downloaded this sample. That will install the sample app, you can launch it from the new tab page. Choose the apps view at the bottom if it is not already selected, and click on the Push Messaging Sample app. It will launch an app which registers for and receives push messages. Now you can use this to test recieving messages from the push messaging server you write. You can also test it with a curl script which sends push messages. Most of the relevant code for this sample is in background.js. We've commented it heavily, to explain what is going on and what you need to do to write your client code. Here is a sample curl script to send a push message - you will need to replace the Access token with the one you get by following the instructions, and replace the channel ID with the channelID shown in the UI once you launch the sample app. curl https://accounts.google.com/o/oauth2/token \ -H "Authorization: Bearer <insert accessToken>" \ -H "Content-Type: application/json" \ -d "{'channelId': '<insert channelId>', 'subchannelId': '0', 'payload': 'Hello'}" See the source code at https://github.com/GoogleChrome/chrome-app-samples/tree/master/push-sample-app This version was built from git commit 1202f5a https://github.com/GoogleChrome/chrome-app-samples/tree/1202f5a/push-sample-app

0 out of 5No ratings

Google doesn't verify reviews. Learn more about results and reviews.

Details

  • Version
    1.4.2
  • Updated
    September 2, 2014
  • Offered by
    Chrome App Samples
  • Size
    60.89KiB
  • Languages
    English (United States)
  • Non-trader
    This developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.

Privacy

The developer has not provided any information about the collection or usage of your data.

Support

For help with questions, suggestions, or problems, visit the developer's support site

Google apps