| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [ | 5 [ |
| 6 { | 6 { |
| 7 "namespace": "gcm", | 7 "namespace": "gcm", |
| 8 "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>.", | 8 "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>.", |
| 9 "properties": { | 9 "properties": { |
| 10 "MAX_MESSAGE_SIZE": { | 10 "MAX_MESSAGE_SIZE": { |
| 11 "value": 4096, | 11 "value": 4096, |
| 12 "description": "The maximum size (in bytes) of all key/value pairs in a
message." | 12 "description": "The maximum size (in bytes) of all key/value pairs in a
message." |
| 13 } | 13 } |
| 14 }, | 14 }, |
| 15 "functions": [ | 15 "functions": [ |
| 16 { | 16 { |
| 17 "name": "register", | 17 "name": "register", |
| 18 "type": "function", | 18 "type": "function", |
| 19 "description": "Registers the application with GCM. The registration ID
will be returned by the <code>callback</code>. If <code>register</code> is calle
d again with the same list of <code>senderIds</code>, the same registration ID w
ill be returned.", | 19 "description": "Registers the application with GCM. The registration ID
will be returned by the <code>callback</code>.", |
| 20 "parameters": [ | 20 "parameters": [ |
| 21 { | 21 { |
| 22 "name": "senderIds", | 22 "name": "senderId", |
| 23 "type": "array", | 23 "type": "string", |
| 24 "items": { | 24 "minLength": 1, |
| 25 "type": "string", | 25 "description": "A server ID of a sender that will be allowed to send
messages to the application." |
| 26 "minLength": 1 | |
| 27 }, | |
| 28 "minItems": 1, | |
| 29 "maxItems": 100, | |
| 30 "description": "A list of server IDs that are allowed to send messag
es to the application. It should contain at least one and no more than 100 sende
r IDs." | |
| 31 }, | 26 }, |
| 32 { | 27 { |
| 33 "name": "callback", | 28 "name": "callback", |
| 34 "type": "function", | 29 "type": "function", |
| 35 "description": "Function called when registration completes. It shou
ld check $(ref:runtime.lastError) for error when <code>registrationId</code> is
empty.", | 30 "description": "Function called when registration completes. It shou
ld check $(ref:runtime.lastError) for error when <code>registrationId</code> is
empty. If <code>register</code> is called again with the same <code>senderId</co
de>, the same registration ID will be returned.", |
| 36 "parameters": [ | 31 "parameters": [ |
| 37 { | 32 { |
| 38 "name": "registrationId", | 33 "name": "registrationId", |
| 39 "type": "string", | 34 "type": "string", |
| 40 "description": "A registration ID assigned to the application by
the GCM." | 35 "description": "A registration ID assigned to the application by
the GCM." |
| 41 } | 36 } |
| 42 ] | 37 ] |
| 43 } | 38 } |
| 44 ] | 39 ] |
| 45 }, | 40 }, |
| 46 { | 41 { |
| 47 "name": "send", | 42 "name": "send", |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 "description": "Additional details related to the error, when av
ailable." | 152 "description": "Additional details related to the error, when av
ailable." |
| 158 } | 153 } |
| 159 }, | 154 }, |
| 160 "description": "An error that occured while trying to send the messa
ge either in Chrome or on the GCM server. Application can retry sending the mess
age with a reasonable backoff and possibly longer time-to-live." | 155 "description": "An error that occured while trying to send the messa
ge either in Chrome or on the GCM server. Application can retry sending the mess
age with a reasonable backoff and possibly longer time-to-live." |
| 161 } | 156 } |
| 162 ] | 157 ] |
| 163 } | 158 } |
| 164 ] | 159 ] |
| 165 } | 160 } |
| 166 ] | 161 ] |
| OLD | NEW |