Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the BSD License.
?2013 Google
このページは大阪弁化フィルタによって翻訳生成されたんですわ。 |
Description: |
Use chrome.pushMessaging to enable apps and extensions to receive message data sent through Google Cloud Messaging.
|
Availability: |
Stable since Chrome 24.
|
Permissions: |
"pushMessaging"
|
Learn More: |
Google Cloud Messaging for Chrome
API Reference for GCM service |
The Push Messaging server responds with HTTP status code 500
(internal server error) if the app that calls the pushMessaging API
is not found in the Chrome Web Store. This ownership check
is designed to prevent people from sending messages to your app
without your permission. Commonly this error occurs during
development if you run a version of your app without the correct
key
attribute in its manifest file.
To fix this problem, simply install your app from
the Chrome Web Store and copy the key
field from manifest.json in the installed app to manifest.json in
the version of the app that you are developing
(see Testing in the cloud for
detailed instructions). Note that you need to remove the key
field from manifest.json before you upload the app to the Chrome Web Store again.
Retrieves the channel ID associated with this app or extension. Typically an app or extension will want to send this value to its application server so the server can use it to trigger push messages back to the app or extension. If the interactive flag is set, we will ask the user to log in when they are not already logged in.
The callback parameter should specify a function that looks like this:
function(object channelId) {...};
Fired when a push message has been received.
The callback parameter should specify a function that looks like this:
function(object message) {...};