summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/common/extensions/api/gcm.json
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/common/extensions/api/gcm.json')
-rw-r--r--chromium/chrome/common/extensions/api/gcm.json38
1 files changed, 28 insertions, 10 deletions
diff --git a/chromium/chrome/common/extensions/api/gcm.json b/chromium/chrome/common/extensions/api/gcm.json
index cd814128ef6..9885a1d5c6b 100644
--- a/chromium/chrome/common/extensions/api/gcm.json
+++ b/chromium/chrome/common/extensions/api/gcm.json
@@ -5,7 +5,7 @@
[
{
"namespace": "gcm",
- "description": "Use <code>chrome.gcm</code> to enable apps and extensions to send and receive messages through <a href='http://developer.android.com/google/gcm/index.html'>Google Cloud Messaging for Android</a>.",
+ "description": "Use <code>chrome.gcm</code> to enable apps and extensions to send and receive messages through <a href='http://developer.android.com/google/gcm/'>Google Cloud Messaging</a>.",
"properties": {
"MAX_MESSAGE_SIZE": {
"value": 4096,
@@ -21,7 +21,7 @@
{
"name": "senderIds",
"type": "array",
- "items": {
+ "items": {
"type": "string",
"minLength": 1
},
@@ -32,9 +32,9 @@
{
"name": "callback",
"type": "function",
- "description": "Function called when registration completes. It should check $ref:runtime.lastError for error when <code>registrationId</code> is empty.",
+ "description": "Function called when registration completes. It should check $(ref:runtime.lastError) for error when <code>registrationId</code> is empty.",
"parameters": [
- {
+ {
"name": "registrationId",
"type": "string",
"description": "A registration ID assigned to the application by the GCM."
@@ -44,6 +44,19 @@
]
},
{
+ "name": "unregister",
+ "type": "function",
+ "description": "Unregisters the application from GCM.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function called after the unregistration completes. Unregistration was successful if $(ref:runtime.lastError) is not set.",
+ "parameters": []
+ }
+ ]
+ },
+ {
"name": "send",
"type": "function",
"description": "Sends a message according to its contents.",
@@ -61,14 +74,14 @@
"messageId": {
"type": "string",
"minLength": 1,
- "description": "The ID of the message. It must be unique for each message."
+ "description": "The ID of the message. It must be unique for each message in scope of the applications. See the <a href='cloudMessagingV2#send_messages'>Cloud Messaging documentation</a> for advice for picking and handling an ID."
},
"timeToLive": {
"type": "integer",
"minimum": 0,
"maximum": 2419200,
"optional": true,
- "description": "Time-to-live of the message in seconds. If it is not possible to send the message wihtin that time an error will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 2419200 seconds (4 weeks)."
+ "description": "Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 2419200 seconds (4 weeks)."
},
"data": {
"type": "object",
@@ -77,14 +90,14 @@
"type": "string",
"minLength": 1
},
- "description": "Message data to send to the server. <code>goog.</code> and <code>google</code> are disallowed as key prefixes. Sum of all key/value pairs should not exceed $ref:MAX_MESSAGE_SIZE."
+ "description": "Message data to send to the server. Case-insensitive <code>goog.</code> and <code>google</code>, as well as case-sensitive <code>collapse_key</code> are disallowed as key prefixes. Sum of all key/value pairs should not exceed $(ref:gcm.MAX_MESSAGE_SIZE)."
}
}
},
{
"name": "callback",
"type": "function",
- "description": "A function called after the message is successfully queued for sending. $ref:runtime.lastError should be checked, to ensure a message was sent without problems.",
+ "description": "A function called after the message is successfully queued for sending. $(ref:runtime.lastError) should be checked, to ensure a message was sent without problems.",
"parameters": [
{
"name": "messageId",
@@ -102,7 +115,7 @@
"type": "function",
"description": "Fired when a message is received through GCM.",
"parameters": [
- {
+ {
"name": "message",
"type": "object",
"description": "A message received from another party via GCM.",
@@ -114,6 +127,11 @@
"type": "string"
},
"description": "The message data."
+ },
+ "collapseKey": {
+ "type": "string",
+ "optional": true,
+ "desctription": "The collapse key of a message. See <a href='cloudMessagingV2#collapsible_messages'>Collapsible Messages</a> section of Cloud Messaging documentation for details."
}
}
}
@@ -122,7 +140,7 @@
{
"name": "onMessagesDeleted",
"type": "function",
- "description": "Fired when a GCM server had to delete messages to the application from its queue in order to manage its size. The app is expected to handle that case gracefully, e.g. by running a full sync with its server."
+ "description": "Fired when a GCM server had to delete messages sent by an app server to the application. See <a href='cloudMessagingV2#messages_deleted_event'>Messages deleted event</a> section of Cloud Messaging documentation for details on handling this event."
},
{
"name": "onSendError",