blob: d6a1692b9ec4a17111bda84c33b2d569f552e149 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="fcm_v1.html">Firebase Cloud Messaging API</a> . <a href="fcm_v1.projects.html">projects</a> . <a href="fcm_v1.projects.messages.html">messages</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#send">send(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Send a message to specified target (a registration token, topic</p>
80<h3>Method Details</h3>
81<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070082 <code class="details" id="send">send(parent, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083 <pre>Send a message to specified target (a registration token, topic
84or condition).
85
86Args:
87 parent: string, Required. It contains the Firebase project id (i.e. the unique identifier
88for your Firebase project), in the format of `projects/{project_id}`.
89For legacy support, the numeric project number with no padding is also
90supported in the format of `projects/{project_number}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -070091 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092 The object takes the form of:
93
94{ # Request to send a message to specified target.
95 "message": { # Message to send by Firebase Cloud Messaging Service. # Required. Message to send.
96 "name": "A String", # Output Only. The identifier of the message sent, in the format of
97 # `projects/*/messages/{message_id}`.
98 "fcmOptions": { # Platform independent options for features provided by the FCM SDKs. # Input only. Template for FCM SDK feature options to use across all
99 # platforms.
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 "analyticsLabel": "A String", # Label associated with the message's analytics data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101 },
102 "notification": { # Basic notification template to use across all platforms. # Input only. Basic notification template to use across all platforms.
103 "body": "A String", # The notification's body text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700104 "image": "A String", # Contains the URL of an image that is going to be downloaded on the device
105 # and displayed in a notification.
106 # JPEG, PNG, BMP have full support across platforms. Animated GIF and video
107 # only work on iOS. WebP and HEIF have varying levels of support across
108 # platforms and platform versions.
109 # Android has 1MB image size limit.
110 # Quota usage and implications/costs for hosting image on Firebase Storage:
111 # https://firebase.google.com/pricing
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 "title": "A String", # The notification's title.
113 },
114 "token": "A String", # Registration token to send a message to.
115 "webpush": { # [Webpush protocol](https://tools.ietf.org/html/rfc8030) options. # Input only. [Webpush protocol](https://tools.ietf.org/html/rfc8030)
116 # options.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117 "notification": { # Web Notification options as a JSON object. Supports Notification instance
118 # properties as defined in [Web Notification
119 # API](https://developer.mozilla.org/en-US/docs/Web/API/Notification). If
120 # present, "title" and "body" fields override
121 # [google.firebase.fcm.v1.Notification.title] and
122 # [google.firebase.fcm.v1.Notification.body].
123 "a_key": "", # Properties of the object.
124 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700125 "data": { # Arbitrary key/value payload. If present, it will override
126 # google.firebase.fcm.v1.Message.data.
127 "a_key": "A String",
128 },
129 "fcmOptions": { # Options for features provided by the FCM SDK for Web. # Options for features provided by the FCM SDK for Web.
130 "analyticsLabel": "A String", # Label associated with the message's analytics data.
131 "link": "A String", # The link to open when the user clicks on the notification.
132 # For all URL values, HTTPS is required.
133 },
134 "headers": { # HTTP headers defined in webpush protocol. Refer to
135 # [Webpush protocol](https://tools.ietf.org/html/rfc8030#section-5) for
136 # supported headers, e.g. "TTL": "15".
137 "a_key": "A String",
138 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700139 },
140 "topic": "A String", # Topic name to send a message to, e.g. "weather".
141 # Note: "/topics/" prefix should not be provided.
142 "apns": { # [Apple Push Notification Service](https://goo.gl/MXRTPa) specific options. # Input only. [Apple Push Notification Service](https://goo.gl/MXRTPa)
143 # specific options.
144 "headers": { # HTTP request headers defined in Apple Push Notification Service. Refer to
Dan O'Mearadd494642020-05-01 07:42:23 -0700145 # [APNs request
146 # headers](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns)
147 # for supported headers, e.g. "apns-priority": "10".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 "a_key": "A String",
149 },
150 "payload": { # APNs payload as a JSON object, including both `aps` dictionary and custom
Dan O'Mearadd494642020-05-01 07:42:23 -0700151 # payload. See [Payload Key
152 # Reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700153 # If present, it overrides google.firebase.fcm.v1.Notification.title
154 # and google.firebase.fcm.v1.Notification.body.
155 "a_key": "", # Properties of the object.
156 },
157 "fcmOptions": { # Options for features provided by the FCM SDK for iOS. # Options for features provided by the FCM SDK for iOS.
Dan O'Mearadd494642020-05-01 07:42:23 -0700158 "image": "A String", # Contains the URL of an image that is going to be displayed in a
159 # notification. If present, it will override
160 # google.firebase.fcm.v1.Notification.image.
161 "analyticsLabel": "A String", # Label associated with the message's analytics data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700162 },
163 },
164 "android": { # Android specific options for messages sent through # Input only. Android specific options for messages sent through
165 # [FCM connection server](https://goo.gl/4GLdUl).
166 # [FCM connection server](https://goo.gl/4GLdUl).
167 "fcmOptions": { # Options for features provided by the FCM SDK for Android. # Options for features provided by the FCM SDK for Android.
Dan O'Mearadd494642020-05-01 07:42:23 -0700168 "analyticsLabel": "A String", # Label associated with the message's analytics data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700169 },
170 "notification": { # Notification to send to android devices. # Notification to send to android devices.
Dan O'Mearadd494642020-05-01 07:42:23 -0700171 "defaultVibrateTimings": True or False, # If set to true, use the Android framework's default vibrate pattern for the
172 # notification. Default values are specified in
173 # [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
174 # If `default_vibrate_timings` is set to true and `vibrate_timings` is also
175 # set, the default value is used instead of the user-specified
176 # `vibrate_timings`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700177 "bodyLocKey": "A String", # The key to the body string in the app's string resources to use to localize
178 # the body text to the user's current localization.
179 # See [String Resources](https://goo.gl/NdFZGI) for more information.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700180 "color": "A String", # The notification's icon color, expressed in #rrggbb format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700181 "image": "A String", # Contains the URL of an image that is going to be displayed in a
182 # notification. If present, it will override
183 # google.firebase.fcm.v1.Notification.image.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700184 "channelId": "A String", # The [notification's channel
185 # id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels)
186 # (new in Android O). The app must create a channel with this channel ID
187 # before any notification with this channel ID is received. If you don't send
188 # this channel ID in the request, or if the channel ID provided has not yet
189 # been created by the app, FCM uses the channel ID specified in the app
190 # manifest.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 "titleLocKey": "A String", # The key to the title string in the app's string resources to use to
192 # localize the title text to the user's current localization.
193 # See [String Resources](https://goo.gl/NdFZGI) for more information.
Dan O'Mearadd494642020-05-01 07:42:23 -0700194 "sticky": True or False, # When set to false or unset, the notification is automatically
195 # dismissed when the user clicks it in the panel. When set to true, the
196 # notification persists even when the user clicks it.
197 "tag": "A String", # Identifier used to replace existing notifications in the notification
198 # drawer.
199 # If not specified, each request creates a new notification.
200 # If specified and a notification with the same tag is already being shown,
201 # the new notification replaces the existing one in the notification drawer.
202 "defaultSound": True or False, # If set to true, use the Android framework's default sound for the
203 # notification. Default values are specified in
204 # [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
205 "defaultLightSettings": True or False, # If set to true, use the Android framework's default LED light settings for
206 # the notification. Default values are specified in
207 # [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
208 # If `default_light_settings` is set to true and `light_settings` is also
209 # set, the user-specified `light_settings` is used instead of the
210 # default value.
211 "eventTime": "A String", # Set the time that the event in the notification occurred. Notifications in
212 # the panel are sorted by this time. A point in time is represented using
213 # [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp).
214 "lightSettings": { # Settings to control notification LED. # Settings to control the notification's LED blinking rate and color if LED
215 # is available on the device. The total blinking time is controlled by the
216 # OS.
217 "color": { # Represents a color in the RGBA color space. This representation is designed # Required. Set `color` of the LED with
218 # [google.type.Color](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto).
219 # for simplicity of conversion to/from color representations in various
220 # languages over compactness; for example, the fields of this representation
221 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
222 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
223 # method in iOS; and, with just a little work, it can be easily formatted into
224 # a CSS "rgba()" string in JavaScript, as well.
225 #
226 # Note: this proto does not carry information about the absolute color space
227 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
228 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
229 # space.
230 #
231 # Example (Java):
232 #
233 # import com.google.type.Color;
234 #
235 # // ...
236 # public static java.awt.Color fromProto(Color protocolor) {
237 # float alpha = protocolor.hasAlpha()
238 # ? protocolor.getAlpha().getValue()
239 # : 1.0;
240 #
241 # return new java.awt.Color(
242 # protocolor.getRed(),
243 # protocolor.getGreen(),
244 # protocolor.getBlue(),
245 # alpha);
246 # }
247 #
248 # public static Color toProto(java.awt.Color color) {
249 # float red = (float) color.getRed();
250 # float green = (float) color.getGreen();
251 # float blue = (float) color.getBlue();
252 # float denominator = 255.0;
253 # Color.Builder resultBuilder =
254 # Color
255 # .newBuilder()
256 # .setRed(red / denominator)
257 # .setGreen(green / denominator)
258 # .setBlue(blue / denominator);
259 # int alpha = color.getAlpha();
260 # if (alpha != 255) {
261 # result.setAlpha(
262 # FloatValue
263 # .newBuilder()
264 # .setValue(((float) alpha) / denominator)
265 # .build());
266 # }
267 # return resultBuilder.build();
268 # }
269 # // ...
270 #
271 # Example (iOS / Obj-C):
272 #
273 # // ...
274 # static UIColor* fromProto(Color* protocolor) {
275 # float red = [protocolor red];
276 # float green = [protocolor green];
277 # float blue = [protocolor blue];
278 # FloatValue* alpha_wrapper = [protocolor alpha];
279 # float alpha = 1.0;
280 # if (alpha_wrapper != nil) {
281 # alpha = [alpha_wrapper value];
282 # }
283 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
284 # }
285 #
286 # static Color* toProto(UIColor* color) {
287 # CGFloat red, green, blue, alpha;
288 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
289 # return nil;
290 # }
291 # Color* result = [[Color alloc] init];
292 # [result setRed:red];
293 # [result setGreen:green];
294 # [result setBlue:blue];
295 # if (alpha &lt;= 0.9999) {
296 # [result setAlpha:floatWrapperWithValue(alpha)];
297 # }
298 # [result autorelease];
299 # return result;
300 # }
301 # // ...
302 #
303 # Example (JavaScript):
304 #
305 # // ...
306 #
307 # var protoToCssColor = function(rgb_color) {
308 # var redFrac = rgb_color.red || 0.0;
309 # var greenFrac = rgb_color.green || 0.0;
310 # var blueFrac = rgb_color.blue || 0.0;
311 # var red = Math.floor(redFrac * 255);
312 # var green = Math.floor(greenFrac * 255);
313 # var blue = Math.floor(blueFrac * 255);
314 #
315 # if (!('alpha' in rgb_color)) {
316 # return rgbToCssColor_(red, green, blue);
317 # }
318 #
319 # var alphaFrac = rgb_color.alpha.value || 0.0;
320 # var rgbParams = [red, green, blue].join(',');
321 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
322 # };
323 #
324 # var rgbToCssColor_ = function(red, green, blue) {
325 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
326 # var hexString = rgbNumber.toString(16);
327 # var missingZeros = 6 - hexString.length;
328 # var resultBuilder = ['#'];
329 # for (var i = 0; i &lt; missingZeros; i++) {
330 # resultBuilder.push('0');
331 # }
332 # resultBuilder.push(hexString);
333 # return resultBuilder.join('');
334 # };
335 #
336 # // ...
337 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
338 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
339 # the final pixel color is defined by the equation:
340 #
341 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
342 #
343 # This means that a value of 1.0 corresponds to a solid color, whereas
344 # a value of 0.0 corresponds to a completely transparent color. This
345 # uses a wrapper message rather than a simple float scalar so that it is
346 # possible to distinguish between a default value and the value being unset.
347 # If omitted, this color object is to be rendered as a solid color
348 # (as if the alpha value had been explicitly given with a value of 1.0).
349 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
350 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
351 },
352 "lightOnDuration": "A String", # Required. Along with `light_off_duration`, define the blink rate of LED
353 # flashes. Resolution defined by
354 # [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
355 "lightOffDuration": "A String", # Required. Along with `light_on_duration `, define the blink rate of LED
356 # flashes. Resolution defined by
357 # [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
358 },
359 "title": "A String", # The notification's title. If present, it will override
360 # google.firebase.fcm.v1.Notification.title.
361 "notificationCount": 42, # Sets the number of items this notification represents. May be displayed as
362 # a badge count for launchers that support badging.See [Notification
363 # Badge](https://developer.android.com/training/notify-user/badges).
364 # For example, this might be useful if you're using just one notification to
365 # represent multiple new messages but you want the count here to represent
366 # the number of total new messages.
367 # If zero or unspecified, systems that support badging use the default, which
368 # is to increment a number displayed on the long-press menu each time a new
369 # notification arrives.
370 "body": "A String", # The notification's body text. If present, it will override
371 # google.firebase.fcm.v1.Notification.body.
372 "bodyLocArgs": [ # Variable string values to be used in place of the format specifiers in
373 # body_loc_key to use to localize the body text to the user's current
374 # localization.
375 # See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
376 "A String",
377 ],
378 "localOnly": True or False, # Set whether or not this notification is relevant only to the current
379 # device. Some notifications can be bridged to other devices for remote
380 # display, such as a Wear OS watch. This hint can be set to recommend this
381 # notification not be bridged. See [Wear OS
382 # guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging)
383 "visibility": "A String", # Set the
384 # [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility)
385 # of the notification.
386 "ticker": "A String", # Sets the "ticker" text, which is sent to accessibility services.
387 # Prior to API level 21 (`Lollipop`), sets the text that is displayed in the
388 # status bar when the notification first arrives.
389 "icon": "A String", # The notification's icon.
390 # Sets the notification icon to myicon for drawable resource myicon.
391 # If you don't send this key in the request, FCM displays the launcher icon
392 # specified in your app manifest.
393 "sound": "A String", # The sound to play when the device receives the notification.
394 # Supports "default" or the filename of a sound resource bundled in the app.
395 # Sound files must reside in /res/raw/.
396 "clickAction": "A String", # The action associated with a user click on the notification.
397 # If specified, an activity with a matching intent filter is launched when
398 # a user clicks on the notification.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 "titleLocArgs": [ # Variable string values to be used in place of the format specifiers in
400 # title_loc_key to use to localize the title text to the user's current
401 # localization.
402 # See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
403 "A String",
404 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700405 "vibrateTimings": [ # Set the vibration pattern to use. Pass in an array of
406 # [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
407 # to turn on or off the vibrator. The first value indicates the `Duration` to
408 # wait before turning the vibrator on. The next value indicates the
409 # `Duration` to keep the vibrator on. Subsequent values alternate between
410 # `Duration` to turn the vibrator off and to turn the vibrator on.
411 # If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`,
412 # the default value is used instead of the user-specified `vibrate_timings`.
413 "A String",
414 ],
415 "notificationPriority": "A String", # Set the relative priority for this notification. Priority is an indication
416 # of how much of the user's attention should be consumed by this
417 # notification. Low-priority notifications may be hidden from the user in
418 # certain situations, while the user might be interrupted for a
419 # higher-priority notification. The effect of setting the same priorities may
420 # differ slightly on different platforms. Note this priority differs from
421 # `AndroidMessagePriority`. This priority is processed by the client after
422 # the message has been delivered, whereas
423 # [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority)
424 # is an FCM concept that controls when the message is delivered.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700425 },
426 "priority": "A String", # Message priority. Can take "normal" and "high" values.
427 # For more information, see [Setting the priority of a
428 # message](https://goo.gl/GjONJv).
429 "collapseKey": "A String", # An identifier of a group of messages that can be collapsed, so that only
430 # the last message gets sent when delivery can be resumed. A maximum of 4
431 # different collapse keys is allowed at any given time.
Dan O'Mearadd494642020-05-01 07:42:23 -0700432 "directBootOk": True or False, # If set to true, messages will be allowed to be delivered to the app while
433 # the device is in direct boot mode. See [Support Direct Boot
434 # mode](https://developer.android.com/training/articles/direct-boot).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700435 "ttl": "A String", # How long (in seconds) the message should be kept in FCM storage if the
436 # device is offline. The maximum time to live supported is 4 weeks, and the
437 # default value is 4 weeks if not set. Set it to 0 if want to send the
438 # message immediately.
439 # In JSON format, the Duration type is encoded as a string rather than an
440 # object, where the string ends in the suffix "s" (indicating seconds) and
441 # is preceded by the number of seconds, with nanoseconds expressed as
442 # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
443 # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
444 # be expressed in JSON format as "3.000000001s". The ttl will be rounded down
445 # to the nearest second.
446 "restrictedPackageName": "A String", # Package name of the application where the registration token must match in
447 # order to receive the message.
448 "data": { # Arbitrary key/value payload. If present, it will override
449 # google.firebase.fcm.v1.Message.data.
450 "a_key": "A String",
451 },
452 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700453 "data": { # Input only. Arbitrary key/value payload. The key should not be a reserved
454 # word ("from", "message_type", or any word starting with "google" or "gcm").
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455 "a_key": "A String",
456 },
457 "condition": "A String", # Condition to send a message to,
Dan O'Mearadd494642020-05-01 07:42:23 -0700458 # e.g. "'foo' in topics &amp;&amp; 'bar' in topics".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700459 },
460 "validateOnly": True or False, # Flag for testing the request without actually delivering the message.
461 }
462
463 x__xgafv: string, V1 error format.
464 Allowed values
465 1 - v1 error format
466 2 - v2 error format
467
468Returns:
469 An object of the form:
470
471 { # Message to send by Firebase Cloud Messaging Service.
472 "name": "A String", # Output Only. The identifier of the message sent, in the format of
473 # `projects/*/messages/{message_id}`.
474 "fcmOptions": { # Platform independent options for features provided by the FCM SDKs. # Input only. Template for FCM SDK feature options to use across all
475 # platforms.
Dan O'Mearadd494642020-05-01 07:42:23 -0700476 "analyticsLabel": "A String", # Label associated with the message's analytics data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700477 },
478 "notification": { # Basic notification template to use across all platforms. # Input only. Basic notification template to use across all platforms.
479 "body": "A String", # The notification's body text.
Dan O'Mearadd494642020-05-01 07:42:23 -0700480 "image": "A String", # Contains the URL of an image that is going to be downloaded on the device
481 # and displayed in a notification.
482 # JPEG, PNG, BMP have full support across platforms. Animated GIF and video
483 # only work on iOS. WebP and HEIF have varying levels of support across
484 # platforms and platform versions.
485 # Android has 1MB image size limit.
486 # Quota usage and implications/costs for hosting image on Firebase Storage:
487 # https://firebase.google.com/pricing
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700488 "title": "A String", # The notification's title.
489 },
490 "token": "A String", # Registration token to send a message to.
491 "webpush": { # [Webpush protocol](https://tools.ietf.org/html/rfc8030) options. # Input only. [Webpush protocol](https://tools.ietf.org/html/rfc8030)
492 # options.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700493 "notification": { # Web Notification options as a JSON object. Supports Notification instance
494 # properties as defined in [Web Notification
495 # API](https://developer.mozilla.org/en-US/docs/Web/API/Notification). If
496 # present, "title" and "body" fields override
497 # [google.firebase.fcm.v1.Notification.title] and
498 # [google.firebase.fcm.v1.Notification.body].
499 "a_key": "", # Properties of the object.
500 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700501 "data": { # Arbitrary key/value payload. If present, it will override
502 # google.firebase.fcm.v1.Message.data.
503 "a_key": "A String",
504 },
505 "fcmOptions": { # Options for features provided by the FCM SDK for Web. # Options for features provided by the FCM SDK for Web.
506 "analyticsLabel": "A String", # Label associated with the message's analytics data.
507 "link": "A String", # The link to open when the user clicks on the notification.
508 # For all URL values, HTTPS is required.
509 },
510 "headers": { # HTTP headers defined in webpush protocol. Refer to
511 # [Webpush protocol](https://tools.ietf.org/html/rfc8030#section-5) for
512 # supported headers, e.g. "TTL": "15".
513 "a_key": "A String",
514 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700515 },
516 "topic": "A String", # Topic name to send a message to, e.g. "weather".
517 # Note: "/topics/" prefix should not be provided.
518 "apns": { # [Apple Push Notification Service](https://goo.gl/MXRTPa) specific options. # Input only. [Apple Push Notification Service](https://goo.gl/MXRTPa)
519 # specific options.
520 "headers": { # HTTP request headers defined in Apple Push Notification Service. Refer to
Dan O'Mearadd494642020-05-01 07:42:23 -0700521 # [APNs request
522 # headers](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns)
523 # for supported headers, e.g. "apns-priority": "10".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700524 "a_key": "A String",
525 },
526 "payload": { # APNs payload as a JSON object, including both `aps` dictionary and custom
Dan O'Mearadd494642020-05-01 07:42:23 -0700527 # payload. See [Payload Key
528 # Reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700529 # If present, it overrides google.firebase.fcm.v1.Notification.title
530 # and google.firebase.fcm.v1.Notification.body.
531 "a_key": "", # Properties of the object.
532 },
533 "fcmOptions": { # Options for features provided by the FCM SDK for iOS. # Options for features provided by the FCM SDK for iOS.
Dan O'Mearadd494642020-05-01 07:42:23 -0700534 "image": "A String", # Contains the URL of an image that is going to be displayed in a
535 # notification. If present, it will override
536 # google.firebase.fcm.v1.Notification.image.
537 "analyticsLabel": "A String", # Label associated with the message's analytics data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700538 },
539 },
540 "android": { # Android specific options for messages sent through # Input only. Android specific options for messages sent through
541 # [FCM connection server](https://goo.gl/4GLdUl).
542 # [FCM connection server](https://goo.gl/4GLdUl).
543 "fcmOptions": { # Options for features provided by the FCM SDK for Android. # Options for features provided by the FCM SDK for Android.
Dan O'Mearadd494642020-05-01 07:42:23 -0700544 "analyticsLabel": "A String", # Label associated with the message's analytics data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700545 },
546 "notification": { # Notification to send to android devices. # Notification to send to android devices.
Dan O'Mearadd494642020-05-01 07:42:23 -0700547 "defaultVibrateTimings": True or False, # If set to true, use the Android framework's default vibrate pattern for the
548 # notification. Default values are specified in
549 # [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
550 # If `default_vibrate_timings` is set to true and `vibrate_timings` is also
551 # set, the default value is used instead of the user-specified
552 # `vibrate_timings`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700553 "bodyLocKey": "A String", # The key to the body string in the app's string resources to use to localize
554 # the body text to the user's current localization.
555 # See [String Resources](https://goo.gl/NdFZGI) for more information.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700556 "color": "A String", # The notification's icon color, expressed in #rrggbb format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700557 "image": "A String", # Contains the URL of an image that is going to be displayed in a
558 # notification. If present, it will override
559 # google.firebase.fcm.v1.Notification.image.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700560 "channelId": "A String", # The [notification's channel
561 # id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels)
562 # (new in Android O). The app must create a channel with this channel ID
563 # before any notification with this channel ID is received. If you don't send
564 # this channel ID in the request, or if the channel ID provided has not yet
565 # been created by the app, FCM uses the channel ID specified in the app
566 # manifest.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700567 "titleLocKey": "A String", # The key to the title string in the app's string resources to use to
568 # localize the title text to the user's current localization.
569 # See [String Resources](https://goo.gl/NdFZGI) for more information.
Dan O'Mearadd494642020-05-01 07:42:23 -0700570 "sticky": True or False, # When set to false or unset, the notification is automatically
571 # dismissed when the user clicks it in the panel. When set to true, the
572 # notification persists even when the user clicks it.
573 "tag": "A String", # Identifier used to replace existing notifications in the notification
574 # drawer.
575 # If not specified, each request creates a new notification.
576 # If specified and a notification with the same tag is already being shown,
577 # the new notification replaces the existing one in the notification drawer.
578 "defaultSound": True or False, # If set to true, use the Android framework's default sound for the
579 # notification. Default values are specified in
580 # [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
581 "defaultLightSettings": True or False, # If set to true, use the Android framework's default LED light settings for
582 # the notification. Default values are specified in
583 # [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
584 # If `default_light_settings` is set to true and `light_settings` is also
585 # set, the user-specified `light_settings` is used instead of the
586 # default value.
587 "eventTime": "A String", # Set the time that the event in the notification occurred. Notifications in
588 # the panel are sorted by this time. A point in time is represented using
589 # [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp).
590 "lightSettings": { # Settings to control notification LED. # Settings to control the notification's LED blinking rate and color if LED
591 # is available on the device. The total blinking time is controlled by the
592 # OS.
593 "color": { # Represents a color in the RGBA color space. This representation is designed # Required. Set `color` of the LED with
594 # [google.type.Color](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto).
595 # for simplicity of conversion to/from color representations in various
596 # languages over compactness; for example, the fields of this representation
597 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
598 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
599 # method in iOS; and, with just a little work, it can be easily formatted into
600 # a CSS "rgba()" string in JavaScript, as well.
601 #
602 # Note: this proto does not carry information about the absolute color space
603 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
604 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
605 # space.
606 #
607 # Example (Java):
608 #
609 # import com.google.type.Color;
610 #
611 # // ...
612 # public static java.awt.Color fromProto(Color protocolor) {
613 # float alpha = protocolor.hasAlpha()
614 # ? protocolor.getAlpha().getValue()
615 # : 1.0;
616 #
617 # return new java.awt.Color(
618 # protocolor.getRed(),
619 # protocolor.getGreen(),
620 # protocolor.getBlue(),
621 # alpha);
622 # }
623 #
624 # public static Color toProto(java.awt.Color color) {
625 # float red = (float) color.getRed();
626 # float green = (float) color.getGreen();
627 # float blue = (float) color.getBlue();
628 # float denominator = 255.0;
629 # Color.Builder resultBuilder =
630 # Color
631 # .newBuilder()
632 # .setRed(red / denominator)
633 # .setGreen(green / denominator)
634 # .setBlue(blue / denominator);
635 # int alpha = color.getAlpha();
636 # if (alpha != 255) {
637 # result.setAlpha(
638 # FloatValue
639 # .newBuilder()
640 # .setValue(((float) alpha) / denominator)
641 # .build());
642 # }
643 # return resultBuilder.build();
644 # }
645 # // ...
646 #
647 # Example (iOS / Obj-C):
648 #
649 # // ...
650 # static UIColor* fromProto(Color* protocolor) {
651 # float red = [protocolor red];
652 # float green = [protocolor green];
653 # float blue = [protocolor blue];
654 # FloatValue* alpha_wrapper = [protocolor alpha];
655 # float alpha = 1.0;
656 # if (alpha_wrapper != nil) {
657 # alpha = [alpha_wrapper value];
658 # }
659 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
660 # }
661 #
662 # static Color* toProto(UIColor* color) {
663 # CGFloat red, green, blue, alpha;
664 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
665 # return nil;
666 # }
667 # Color* result = [[Color alloc] init];
668 # [result setRed:red];
669 # [result setGreen:green];
670 # [result setBlue:blue];
671 # if (alpha &lt;= 0.9999) {
672 # [result setAlpha:floatWrapperWithValue(alpha)];
673 # }
674 # [result autorelease];
675 # return result;
676 # }
677 # // ...
678 #
679 # Example (JavaScript):
680 #
681 # // ...
682 #
683 # var protoToCssColor = function(rgb_color) {
684 # var redFrac = rgb_color.red || 0.0;
685 # var greenFrac = rgb_color.green || 0.0;
686 # var blueFrac = rgb_color.blue || 0.0;
687 # var red = Math.floor(redFrac * 255);
688 # var green = Math.floor(greenFrac * 255);
689 # var blue = Math.floor(blueFrac * 255);
690 #
691 # if (!('alpha' in rgb_color)) {
692 # return rgbToCssColor_(red, green, blue);
693 # }
694 #
695 # var alphaFrac = rgb_color.alpha.value || 0.0;
696 # var rgbParams = [red, green, blue].join(',');
697 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
698 # };
699 #
700 # var rgbToCssColor_ = function(red, green, blue) {
701 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
702 # var hexString = rgbNumber.toString(16);
703 # var missingZeros = 6 - hexString.length;
704 # var resultBuilder = ['#'];
705 # for (var i = 0; i &lt; missingZeros; i++) {
706 # resultBuilder.push('0');
707 # }
708 # resultBuilder.push(hexString);
709 # return resultBuilder.join('');
710 # };
711 #
712 # // ...
713 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
714 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
715 # the final pixel color is defined by the equation:
716 #
717 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
718 #
719 # This means that a value of 1.0 corresponds to a solid color, whereas
720 # a value of 0.0 corresponds to a completely transparent color. This
721 # uses a wrapper message rather than a simple float scalar so that it is
722 # possible to distinguish between a default value and the value being unset.
723 # If omitted, this color object is to be rendered as a solid color
724 # (as if the alpha value had been explicitly given with a value of 1.0).
725 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
726 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
727 },
728 "lightOnDuration": "A String", # Required. Along with `light_off_duration`, define the blink rate of LED
729 # flashes. Resolution defined by
730 # [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
731 "lightOffDuration": "A String", # Required. Along with `light_on_duration `, define the blink rate of LED
732 # flashes. Resolution defined by
733 # [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
734 },
735 "title": "A String", # The notification's title. If present, it will override
736 # google.firebase.fcm.v1.Notification.title.
737 "notificationCount": 42, # Sets the number of items this notification represents. May be displayed as
738 # a badge count for launchers that support badging.See [Notification
739 # Badge](https://developer.android.com/training/notify-user/badges).
740 # For example, this might be useful if you're using just one notification to
741 # represent multiple new messages but you want the count here to represent
742 # the number of total new messages.
743 # If zero or unspecified, systems that support badging use the default, which
744 # is to increment a number displayed on the long-press menu each time a new
745 # notification arrives.
746 "body": "A String", # The notification's body text. If present, it will override
747 # google.firebase.fcm.v1.Notification.body.
748 "bodyLocArgs": [ # Variable string values to be used in place of the format specifiers in
749 # body_loc_key to use to localize the body text to the user's current
750 # localization.
751 # See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
752 "A String",
753 ],
754 "localOnly": True or False, # Set whether or not this notification is relevant only to the current
755 # device. Some notifications can be bridged to other devices for remote
756 # display, such as a Wear OS watch. This hint can be set to recommend this
757 # notification not be bridged. See [Wear OS
758 # guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging)
759 "visibility": "A String", # Set the
760 # [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility)
761 # of the notification.
762 "ticker": "A String", # Sets the "ticker" text, which is sent to accessibility services.
763 # Prior to API level 21 (`Lollipop`), sets the text that is displayed in the
764 # status bar when the notification first arrives.
765 "icon": "A String", # The notification's icon.
766 # Sets the notification icon to myicon for drawable resource myicon.
767 # If you don't send this key in the request, FCM displays the launcher icon
768 # specified in your app manifest.
769 "sound": "A String", # The sound to play when the device receives the notification.
770 # Supports "default" or the filename of a sound resource bundled in the app.
771 # Sound files must reside in /res/raw/.
772 "clickAction": "A String", # The action associated with a user click on the notification.
773 # If specified, an activity with a matching intent filter is launched when
774 # a user clicks on the notification.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700775 "titleLocArgs": [ # Variable string values to be used in place of the format specifiers in
776 # title_loc_key to use to localize the title text to the user's current
777 # localization.
778 # See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
779 "A String",
780 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700781 "vibrateTimings": [ # Set the vibration pattern to use. Pass in an array of
782 # [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
783 # to turn on or off the vibrator. The first value indicates the `Duration` to
784 # wait before turning the vibrator on. The next value indicates the
785 # `Duration` to keep the vibrator on. Subsequent values alternate between
786 # `Duration` to turn the vibrator off and to turn the vibrator on.
787 # If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`,
788 # the default value is used instead of the user-specified `vibrate_timings`.
789 "A String",
790 ],
791 "notificationPriority": "A String", # Set the relative priority for this notification. Priority is an indication
792 # of how much of the user's attention should be consumed by this
793 # notification. Low-priority notifications may be hidden from the user in
794 # certain situations, while the user might be interrupted for a
795 # higher-priority notification. The effect of setting the same priorities may
796 # differ slightly on different platforms. Note this priority differs from
797 # `AndroidMessagePriority`. This priority is processed by the client after
798 # the message has been delivered, whereas
799 # [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority)
800 # is an FCM concept that controls when the message is delivered.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700801 },
802 "priority": "A String", # Message priority. Can take "normal" and "high" values.
803 # For more information, see [Setting the priority of a
804 # message](https://goo.gl/GjONJv).
805 "collapseKey": "A String", # An identifier of a group of messages that can be collapsed, so that only
806 # the last message gets sent when delivery can be resumed. A maximum of 4
807 # different collapse keys is allowed at any given time.
Dan O'Mearadd494642020-05-01 07:42:23 -0700808 "directBootOk": True or False, # If set to true, messages will be allowed to be delivered to the app while
809 # the device is in direct boot mode. See [Support Direct Boot
810 # mode](https://developer.android.com/training/articles/direct-boot).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700811 "ttl": "A String", # How long (in seconds) the message should be kept in FCM storage if the
812 # device is offline. The maximum time to live supported is 4 weeks, and the
813 # default value is 4 weeks if not set. Set it to 0 if want to send the
814 # message immediately.
815 # In JSON format, the Duration type is encoded as a string rather than an
816 # object, where the string ends in the suffix "s" (indicating seconds) and
817 # is preceded by the number of seconds, with nanoseconds expressed as
818 # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
819 # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
820 # be expressed in JSON format as "3.000000001s". The ttl will be rounded down
821 # to the nearest second.
822 "restrictedPackageName": "A String", # Package name of the application where the registration token must match in
823 # order to receive the message.
824 "data": { # Arbitrary key/value payload. If present, it will override
825 # google.firebase.fcm.v1.Message.data.
826 "a_key": "A String",
827 },
828 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700829 "data": { # Input only. Arbitrary key/value payload. The key should not be a reserved
830 # word ("from", "message_type", or any word starting with "google" or "gcm").
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700831 "a_key": "A String",
832 },
833 "condition": "A String", # Condition to send a message to,
Dan O'Mearadd494642020-05-01 07:42:23 -0700834 # e.g. "'foo' in topics &amp;&amp; 'bar' in topics".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700835 }</pre>
836</div>
837
838</body></html>