forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstance_id.json
146 lines (145 loc) · 5.42 KB
/
instance_id.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "instanceID",
"description": "Use <code>chrome.instanceID</code> to access the Instance ID service.",
"functions": [
{
"name": "getID",
"type": "function",
"description": "Retrieves an identifier for the app instance. The instance ID will be returned by the <code>callback</code>. The same ID will be returned as long as the application identity has not been revoked or expired.",
"parameters": [
{
"name": "callback",
"type": "function",
"description": "Function called when the retrieval completes. It should check $(ref:runtime.lastError) for error when instanceID is empty.",
"parameters": [
{
"name": "instanceID",
"type": "string",
"description": "An Instance ID assigned to the app instance."
}
]
}
]
},
{
"name": "getCreationTime",
"type": "function",
"description": "Retrieves the time when the InstanceID has been generated. The creation time will be returned by the <code>callback</code>.",
"parameters": [
{
"name": "callback",
"type": "function",
"description": "Function called when the retrieval completes. It should check $(ref:runtime.lastError) for error when creationTime is zero.",
"parameters": [
{
"name": "creationTime",
"type": "number",
"description": "The time when the Instance ID has been generated, represented in milliseconds since the epoch."
}
]
}
]
},
{
"name": "getToken",
"type": "function",
"description": "Return a token that allows the authorized entity to access the service defined by scope.",
"parameters": [
{
"name": "getTokenParams",
"type": "object",
"description": "Parameters for getToken.",
"properties": {
"authorizedEntity": {
"type": "string",
"minLength": 1,
"description": "Identifies the entity that is authorized to access resources associated with this Instance ID. It can be a project ID from <a href='https://code.google.com/apis/console'>Google developer console</a>."
},
"scope": {
"type": "string",
"minLength": 1,
"description": "Identifies authorized actions that the authorized entity can take. E.g. for sending GCM messages, <code>GCM</code> scope should be used."
},
"options": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "string",
"minLength": 1
},
"optional": true,
"description": "Allows including a small number of string key/value pairs that will be associated with the token and may be used in processing the request."
}
}
},
{
"name": "callback",
"type": "function",
"description": "Function called when the retrieval completes. It should check $(ref:runtime.lastError) for error when token is empty.",
"parameters": [
{
"name": "token",
"type": "string",
"description": "A token assigned by the requested service."
}
]
}
]
},
{
"name": "deleteToken",
"type": "function",
"description": "Revokes a granted token.",
"parameters": [
{
"name": "deleteTokenParams",
"type": "object",
"description": "Parameters for deleteToken.",
"properties": {
"authorizedEntity": {
"type": "string",
"minLength": 1,
"description": "The authorized entity that is used to obtain the token."
},
"scope": {
"type": "string",
"minLength": 1,
"description": "The scope that is used to obtain the token."
}
}
},
{
"name": "callback",
"type": "function",
"description": "Function called when the token deletion completes. The token was revoked successfully if $(ref:runtime.lastError) is not set.",
"parameters": []
}
]
},
{
"name": "deleteID",
"type": "function",
"description": "Resets the app instance identifier and revokes all tokens associated with it.",
"parameters": [
{
"name": "callback",
"type": "function",
"description": "Function called when the deletion completes. The instance identifier was revoked successfully if $(ref:runtime.lastError) is not set.",
"parameters": []
}
]
}
],
"events": [
{
"name": "onTokenRefresh",
"type": "function",
"description": "Fired when all the granted tokens need to be refreshed."
}
]
}
]