blob: 53384349945df3231d5650ad84a3371385db03d5 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<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>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#send">send(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Send a message to specified target (a registration token, topic</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="send">send(parent, body=None, x__xgafv=None)</code>
<pre>Send a message to specified target (a registration token, topic
or condition).
Args:
parent: string, Required. It contains the Firebase project id (i.e. the unique identifier
for your Firebase project), in the format of `projects/{project_id}`.
For legacy support, the numeric project number with no padding is also
supported in the format of `projects/{project_number}`. (required)
body: object, The request body.
The object takes the form of:
{ # Request to send a message to specified target.
&quot;validateOnly&quot;: True or False, # Flag for testing the request without actually delivering the message.
&quot;message&quot;: { # Message to send by Firebase Cloud Messaging Service. # Required. Message to send.
&quot;topic&quot;: &quot;A String&quot;, # Topic name to send a message to, e.g. &quot;weather&quot;.
# Note: &quot;/topics/&quot; prefix should not be provided.
&quot;token&quot;: &quot;A String&quot;, # Registration token to send a message to.
&quot;name&quot;: &quot;A String&quot;, # Output Only. The identifier of the message sent, in the format of
# `projects/*/messages/{message_id}`.
&quot;fcmOptions&quot;: { # Platform independent options for features provided by the FCM SDKs. # Input only. Template for FCM SDK feature options to use across all
# platforms.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
},
&quot;notification&quot;: { # Basic notification template to use across all platforms. # Input only. Basic notification template to use across all platforms.
&quot;image&quot;: &quot;A String&quot;, # Contains the URL of an image that is going to be downloaded on the device
# and displayed in a notification.
# JPEG, PNG, BMP have full support across platforms. Animated GIF and video
# only work on iOS. WebP and HEIF have varying levels of support across
# platforms and platform versions.
# Android has 1MB image size limit.
# Quota usage and implications/costs for hosting image on Firebase Storage:
# https://firebase.google.com/pricing
&quot;body&quot;: &quot;A String&quot;, # The notification&#x27;s body text.
&quot;title&quot;: &quot;A String&quot;, # The notification&#x27;s title.
},
&quot;data&quot;: { # Input only. Arbitrary key/value payload. The key should not be a reserved
# word (&quot;from&quot;, &quot;message_type&quot;, or any word starting with &quot;google&quot; or &quot;gcm&quot;).
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;android&quot;: { # Android specific options for messages sent through # Input only. Android specific options for messages sent through
# [FCM connection server](https://goo.gl/4GLdUl).
# [FCM connection server](https://goo.gl/4GLdUl).
&quot;directBootOk&quot;: True or False, # If set to true, messages will be allowed to be delivered to the app while
# the device is in direct boot mode. See [Support Direct Boot
# mode](https://developer.android.com/training/articles/direct-boot).
&quot;data&quot;: { # Arbitrary key/value payload. If present, it will override
# google.firebase.fcm.v1.Message.data.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;notification&quot;: { # Notification to send to android devices. # Notification to send to android devices.
&quot;localOnly&quot;: True or False, # Set whether or not this notification is relevant only to the current
# device. Some notifications can be bridged to other devices for remote
# display, such as a Wear OS watch. This hint can be set to recommend this
# notification not be bridged. See [Wear OS
# guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging)
&quot;notificationCount&quot;: 42, # Sets the number of items this notification represents. May be displayed as
# a badge count for launchers that support badging.See [Notification
# Badge](https://developer.android.com/training/notify-user/badges).
# For example, this might be useful if you&#x27;re using just one notification to
# represent multiple new messages but you want the count here to represent
# the number of total new messages.
# If zero or unspecified, systems that support badging use the default, which
# is to increment a number displayed on the long-press menu each time a new
# notification arrives.
&quot;eventTime&quot;: &quot;A String&quot;, # Set the time that the event in the notification occurred. Notifications in
# the panel are sorted by this time. A point in time is represented using
# [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp).
&quot;sticky&quot;: True or False, # When set to false or unset, the notification is automatically
# dismissed when the user clicks it in the panel. When set to true, the
# notification persists even when the user clicks it.
&quot;bodyLocKey&quot;: &quot;A String&quot;, # The key to the body string in the app&#x27;s string resources to use to localize
# the body text to the user&#x27;s current localization.
# See [String Resources](https://goo.gl/NdFZGI) for more information.
&quot;body&quot;: &quot;A String&quot;, # The notification&#x27;s body text. If present, it will override
# google.firebase.fcm.v1.Notification.body.
&quot;titleLocArgs&quot;: [ # Variable string values to be used in place of the format specifiers in
# title_loc_key to use to localize the title text to the user&#x27;s current
# localization.
# See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
&quot;A String&quot;,
],
&quot;vibrateTimings&quot;: [ # Set the vibration pattern to use. Pass in an array of
# [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
# to turn on or off the vibrator. The first value indicates the `Duration` to
# wait before turning the vibrator on. The next value indicates the
# `Duration` to keep the vibrator on. Subsequent values alternate between
# `Duration` to turn the vibrator off and to turn the vibrator on.
# If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`,
# the default value is used instead of the user-specified `vibrate_timings`.
&quot;A String&quot;,
],
&quot;visibility&quot;: &quot;A String&quot;, # Set the
# [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility)
# of the notification.
&quot;lightSettings&quot;: { # Settings to control notification LED. # Settings to control the notification&#x27;s LED blinking rate and color if LED
# is available on the device. The total blinking time is controlled by the
# OS.
&quot;lightOnDuration&quot;: &quot;A String&quot;, # Required. Along with `light_off_duration`, define the blink rate of LED
# flashes. Resolution defined by
# [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed # Required. Set `color` of the LED with
# [google.type.Color](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto).
# for simplicity of conversion to/from color representations in various
# languages over compactness; for example, the fields of this representation
# can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
# can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
# method in iOS; and, with just a little work, it can be easily formatted into
# a CSS &quot;rgba()&quot; string in JavaScript, as well.
#
# Note: this proto does not carry information about the absolute color space
# that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
# DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
# space.
#
# Note: when color equality needs to be decided, implementations, unless
# documented otherwise, will treat two colors to be equal if all their red,
# green, blue and alpha values each differ by at most 1e-5.
#
# Example (Java):
#
# import com.google.type.Color;
#
# // ...
# public static java.awt.Color fromProto(Color protocolor) {
# float alpha = protocolor.hasAlpha()
# ? protocolor.getAlpha().getValue()
# : 1.0;
#
# return new java.awt.Color(
# protocolor.getRed(),
# protocolor.getGreen(),
# protocolor.getBlue(),
# alpha);
# }
#
# public static Color toProto(java.awt.Color color) {
# float red = (float) color.getRed();
# float green = (float) color.getGreen();
# float blue = (float) color.getBlue();
# float denominator = 255.0;
# Color.Builder resultBuilder =
# Color
# .newBuilder()
# .setRed(red / denominator)
# .setGreen(green / denominator)
# .setBlue(blue / denominator);
# int alpha = color.getAlpha();
# if (alpha != 255) {
# result.setAlpha(
# FloatValue
# .newBuilder()
# .setValue(((float) alpha) / denominator)
# .build());
# }
# return resultBuilder.build();
# }
# // ...
#
# Example (iOS / Obj-C):
#
# // ...
# static UIColor* fromProto(Color* protocolor) {
# float red = [protocolor red];
# float green = [protocolor green];
# float blue = [protocolor blue];
# FloatValue* alpha_wrapper = [protocolor alpha];
# float alpha = 1.0;
# if (alpha_wrapper != nil) {
# alpha = [alpha_wrapper value];
# }
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
# }
#
# static Color* toProto(UIColor* color) {
# CGFloat red, green, blue, alpha;
# if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
# return nil;
# }
# Color* result = [[Color alloc] init];
# [result setRed:red];
# [result setGreen:green];
# [result setBlue:blue];
# if (alpha &lt;= 0.9999) {
# [result setAlpha:floatWrapperWithValue(alpha)];
# }
# [result autorelease];
# return result;
# }
# // ...
#
# Example (JavaScript):
#
# // ...
#
# var protoToCssColor = function(rgb_color) {
# var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0;
# var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255);
# var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255);
#
# if (!(&#x27;alpha&#x27; in rgb_color)) {
# return rgbToCssColor_(red, green, blue);
# }
#
# var alphaFrac = rgb_color.alpha.value || 0.0;
# var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
# return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
# };
#
# var rgbToCssColor_ = function(red, green, blue) {
# var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
# var hexString = rgbNumber.toString(16);
# var missingZeros = 6 - hexString.length;
# var resultBuilder = [&#x27;#&#x27;];
# for (var i = 0; i &lt; missingZeros; i++) {
# resultBuilder.push(&#x27;0&#x27;);
# }
# resultBuilder.push(hexString);
# return resultBuilder.join(&#x27;&#x27;);
# };
#
# // ...
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
# the final pixel color is defined by the equation:
#
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
#
# This means that a value of 1.0 corresponds to a solid color, whereas
# a value of 0.0 corresponds to a completely transparent color. This
# uses a wrapper message rather than a simple float scalar so that it is
# possible to distinguish between a default value and the value being unset.
# If omitted, this color object is to be rendered as a solid color
# (as if the alpha value had been explicitly given with a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
},
&quot;lightOffDuration&quot;: &quot;A String&quot;, # Required. Along with `light_on_duration `, define the blink rate of LED
# flashes. Resolution defined by
# [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
},
&quot;bodyLocArgs&quot;: [ # Variable string values to be used in place of the format specifiers in
# body_loc_key to use to localize the body text to the user&#x27;s current
# localization.
# See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
&quot;A String&quot;,
],
&quot;defaultLightSettings&quot;: True or False, # If set to true, use the Android framework&#x27;s default LED light settings for
# the notification. Default values are specified in
# [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
# If `default_light_settings` is set to true and `light_settings` is also
# set, the user-specified `light_settings` is used instead of the
# default value.
&quot;channelId&quot;: &quot;A String&quot;, # The [notification&#x27;s channel
# id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels)
# (new in Android O). The app must create a channel with this channel ID
# before any notification with this channel ID is received. If you don&#x27;t send
# this channel ID in the request, or if the channel ID provided has not yet
# been created by the app, FCM uses the channel ID specified in the app
# manifest.
&quot;defaultVibrateTimings&quot;: True or False, # If set to true, use the Android framework&#x27;s default vibrate pattern for the
# notification. Default values are specified in
# [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
# If `default_vibrate_timings` is set to true and `vibrate_timings` is also
# set, the default value is used instead of the user-specified
# `vibrate_timings`.
&quot;icon&quot;: &quot;A String&quot;, # The notification&#x27;s icon.
# Sets the notification icon to myicon for drawable resource myicon.
# If you don&#x27;t send this key in the request, FCM displays the launcher icon
# specified in your app manifest.
&quot;ticker&quot;: &quot;A String&quot;, # Sets the &quot;ticker&quot; text, which is sent to accessibility services.
# Prior to API level 21 (`Lollipop`), sets the text that is displayed in the
# status bar when the notification first arrives.
&quot;notificationPriority&quot;: &quot;A String&quot;, # Set the relative priority for this notification. Priority is an indication
# of how much of the user&#x27;s attention should be consumed by this
# notification. Low-priority notifications may be hidden from the user in
# certain situations, while the user might be interrupted for a
# higher-priority notification. The effect of setting the same priorities may
# differ slightly on different platforms. Note this priority differs from
# `AndroidMessagePriority`. This priority is processed by the client after
# the message has been delivered, whereas
# [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority)
# is an FCM concept that controls when the message is delivered.
&quot;color&quot;: &quot;A String&quot;, # The notification&#x27;s icon color, expressed in #rrggbb format.
&quot;image&quot;: &quot;A String&quot;, # Contains the URL of an image that is going to be displayed in a
# notification. If present, it will override
# google.firebase.fcm.v1.Notification.image.
&quot;defaultSound&quot;: True or False, # If set to true, use the Android framework&#x27;s default sound for the
# notification. Default values are specified in
# [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
&quot;sound&quot;: &quot;A String&quot;, # The sound to play when the device receives the notification.
# Supports &quot;default&quot; or the filename of a sound resource bundled in the app.
# Sound files must reside in /res/raw/.
&quot;clickAction&quot;: &quot;A String&quot;, # The action associated with a user click on the notification.
# If specified, an activity with a matching intent filter is launched when
# a user clicks on the notification.
&quot;titleLocKey&quot;: &quot;A String&quot;, # The key to the title string in the app&#x27;s string resources to use to
# localize the title text to the user&#x27;s current localization.
# See [String Resources](https://goo.gl/NdFZGI) for more information.
&quot;tag&quot;: &quot;A String&quot;, # Identifier used to replace existing notifications in the notification
# drawer.
# If not specified, each request creates a new notification.
# If specified and a notification with the same tag is already being shown,
# the new notification replaces the existing one in the notification drawer.
&quot;title&quot;: &quot;A String&quot;, # The notification&#x27;s title. If present, it will override
# google.firebase.fcm.v1.Notification.title.
},
&quot;collapseKey&quot;: &quot;A String&quot;, # An identifier of a group of messages that can be collapsed, so that only
# the last message gets sent when delivery can be resumed. A maximum of 4
# different collapse keys is allowed at any given time.
&quot;priority&quot;: &quot;A String&quot;, # Message priority. Can take &quot;normal&quot; and &quot;high&quot; values.
# For more information, see [Setting the priority of a
# message](https://goo.gl/GjONJv).
&quot;restrictedPackageName&quot;: &quot;A String&quot;, # Package name of the application where the registration token must match in
# order to receive the message.
&quot;ttl&quot;: &quot;A String&quot;, # How long (in seconds) the message should be kept in FCM storage if the
# device is offline. The maximum time to live supported is 4 weeks, and the
# default value is 4 weeks if not set. Set it to 0 if want to send the
# message immediately.
# In JSON format, the Duration type is encoded as a string rather than an
# object, where the string ends in the suffix &quot;s&quot; (indicating seconds) and
# is preceded by the number of seconds, with nanoseconds expressed as
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
# encoded in JSON format as &quot;3s&quot;, while 3 seconds and 1 nanosecond should
# be expressed in JSON format as &quot;3.000000001s&quot;. The ttl will be rounded down
# to the nearest second.
&quot;fcmOptions&quot;: { # Options for features provided by the FCM SDK for Android. # Options for features provided by the FCM SDK for Android.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
},
},
&quot;apns&quot;: { # [Apple Push Notification Service](https://goo.gl/MXRTPa) specific options. # Input only. [Apple Push Notification Service](https://goo.gl/MXRTPa)
# specific options.
&quot;payload&quot;: { # APNs payload as a JSON object, including both `aps` dictionary and custom
# payload. See [Payload Key
# Reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification).
# If present, it overrides google.firebase.fcm.v1.Notification.title
# and google.firebase.fcm.v1.Notification.body.
&quot;a_key&quot;: &quot;&quot;, # Properties of the object.
},
&quot;headers&quot;: { # HTTP request headers defined in Apple Push Notification Service. Refer to
# [APNs request
# headers](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns)
# for supported headers, e.g. &quot;apns-priority&quot;: &quot;10&quot;.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;fcmOptions&quot;: { # Options for features provided by the FCM SDK for iOS. # Options for features provided by the FCM SDK for iOS.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
&quot;image&quot;: &quot;A String&quot;, # Contains the URL of an image that is going to be displayed in a
# notification. If present, it will override
# google.firebase.fcm.v1.Notification.image.
},
},
&quot;webpush&quot;: { # [Webpush protocol](https://tools.ietf.org/html/rfc8030) options. # Input only. [Webpush protocol](https://tools.ietf.org/html/rfc8030)
# options.
&quot;fcmOptions&quot;: { # Options for features provided by the FCM SDK for Web. # Options for features provided by the FCM SDK for Web.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
&quot;link&quot;: &quot;A String&quot;, # The link to open when the user clicks on the notification.
# For all URL values, HTTPS is required.
},
&quot;data&quot;: { # Arbitrary key/value payload. If present, it will override
# google.firebase.fcm.v1.Message.data.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;headers&quot;: { # HTTP headers defined in webpush protocol. Refer to
# [Webpush protocol](https://tools.ietf.org/html/rfc8030#section-5) for
# supported headers, e.g. &quot;TTL&quot;: &quot;15&quot;.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;notification&quot;: { # Web Notification options as a JSON object. Supports Notification instance
# properties as defined in [Web Notification
# API](https://developer.mozilla.org/en-US/docs/Web/API/Notification). If
# present, &quot;title&quot; and &quot;body&quot; fields override
# [google.firebase.fcm.v1.Notification.title] and
# [google.firebase.fcm.v1.Notification.body].
&quot;a_key&quot;: &quot;&quot;, # Properties of the object.
},
},
&quot;condition&quot;: &quot;A String&quot;, # Condition to send a message to,
# e.g. &quot;&#x27;foo&#x27; in topics &amp;&amp; &#x27;bar&#x27; in topics&quot;.
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Message to send by Firebase Cloud Messaging Service.
&quot;topic&quot;: &quot;A String&quot;, # Topic name to send a message to, e.g. &quot;weather&quot;.
# Note: &quot;/topics/&quot; prefix should not be provided.
&quot;token&quot;: &quot;A String&quot;, # Registration token to send a message to.
&quot;name&quot;: &quot;A String&quot;, # Output Only. The identifier of the message sent, in the format of
# `projects/*/messages/{message_id}`.
&quot;fcmOptions&quot;: { # Platform independent options for features provided by the FCM SDKs. # Input only. Template for FCM SDK feature options to use across all
# platforms.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
},
&quot;notification&quot;: { # Basic notification template to use across all platforms. # Input only. Basic notification template to use across all platforms.
&quot;image&quot;: &quot;A String&quot;, # Contains the URL of an image that is going to be downloaded on the device
# and displayed in a notification.
# JPEG, PNG, BMP have full support across platforms. Animated GIF and video
# only work on iOS. WebP and HEIF have varying levels of support across
# platforms and platform versions.
# Android has 1MB image size limit.
# Quota usage and implications/costs for hosting image on Firebase Storage:
# https://firebase.google.com/pricing
&quot;body&quot;: &quot;A String&quot;, # The notification&#x27;s body text.
&quot;title&quot;: &quot;A String&quot;, # The notification&#x27;s title.
},
&quot;data&quot;: { # Input only. Arbitrary key/value payload. The key should not be a reserved
# word (&quot;from&quot;, &quot;message_type&quot;, or any word starting with &quot;google&quot; or &quot;gcm&quot;).
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;android&quot;: { # Android specific options for messages sent through # Input only. Android specific options for messages sent through
# [FCM connection server](https://goo.gl/4GLdUl).
# [FCM connection server](https://goo.gl/4GLdUl).
&quot;directBootOk&quot;: True or False, # If set to true, messages will be allowed to be delivered to the app while
# the device is in direct boot mode. See [Support Direct Boot
# mode](https://developer.android.com/training/articles/direct-boot).
&quot;data&quot;: { # Arbitrary key/value payload. If present, it will override
# google.firebase.fcm.v1.Message.data.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;notification&quot;: { # Notification to send to android devices. # Notification to send to android devices.
&quot;localOnly&quot;: True or False, # Set whether or not this notification is relevant only to the current
# device. Some notifications can be bridged to other devices for remote
# display, such as a Wear OS watch. This hint can be set to recommend this
# notification not be bridged. See [Wear OS
# guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging)
&quot;notificationCount&quot;: 42, # Sets the number of items this notification represents. May be displayed as
# a badge count for launchers that support badging.See [Notification
# Badge](https://developer.android.com/training/notify-user/badges).
# For example, this might be useful if you&#x27;re using just one notification to
# represent multiple new messages but you want the count here to represent
# the number of total new messages.
# If zero or unspecified, systems that support badging use the default, which
# is to increment a number displayed on the long-press menu each time a new
# notification arrives.
&quot;eventTime&quot;: &quot;A String&quot;, # Set the time that the event in the notification occurred. Notifications in
# the panel are sorted by this time. A point in time is represented using
# [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp).
&quot;sticky&quot;: True or False, # When set to false or unset, the notification is automatically
# dismissed when the user clicks it in the panel. When set to true, the
# notification persists even when the user clicks it.
&quot;bodyLocKey&quot;: &quot;A String&quot;, # The key to the body string in the app&#x27;s string resources to use to localize
# the body text to the user&#x27;s current localization.
# See [String Resources](https://goo.gl/NdFZGI) for more information.
&quot;body&quot;: &quot;A String&quot;, # The notification&#x27;s body text. If present, it will override
# google.firebase.fcm.v1.Notification.body.
&quot;titleLocArgs&quot;: [ # Variable string values to be used in place of the format specifiers in
# title_loc_key to use to localize the title text to the user&#x27;s current
# localization.
# See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
&quot;A String&quot;,
],
&quot;vibrateTimings&quot;: [ # Set the vibration pattern to use. Pass in an array of
# [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
# to turn on or off the vibrator. The first value indicates the `Duration` to
# wait before turning the vibrator on. The next value indicates the
# `Duration` to keep the vibrator on. Subsequent values alternate between
# `Duration` to turn the vibrator off and to turn the vibrator on.
# If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`,
# the default value is used instead of the user-specified `vibrate_timings`.
&quot;A String&quot;,
],
&quot;visibility&quot;: &quot;A String&quot;, # Set the
# [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility)
# of the notification.
&quot;lightSettings&quot;: { # Settings to control notification LED. # Settings to control the notification&#x27;s LED blinking rate and color if LED
# is available on the device. The total blinking time is controlled by the
# OS.
&quot;lightOnDuration&quot;: &quot;A String&quot;, # Required. Along with `light_off_duration`, define the blink rate of LED
# flashes. Resolution defined by
# [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
&quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed # Required. Set `color` of the LED with
# [google.type.Color](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto).
# for simplicity of conversion to/from color representations in various
# languages over compactness; for example, the fields of this representation
# can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
# can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
# method in iOS; and, with just a little work, it can be easily formatted into
# a CSS &quot;rgba()&quot; string in JavaScript, as well.
#
# Note: this proto does not carry information about the absolute color space
# that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
# DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
# space.
#
# Note: when color equality needs to be decided, implementations, unless
# documented otherwise, will treat two colors to be equal if all their red,
# green, blue and alpha values each differ by at most 1e-5.
#
# Example (Java):
#
# import com.google.type.Color;
#
# // ...
# public static java.awt.Color fromProto(Color protocolor) {
# float alpha = protocolor.hasAlpha()
# ? protocolor.getAlpha().getValue()
# : 1.0;
#
# return new java.awt.Color(
# protocolor.getRed(),
# protocolor.getGreen(),
# protocolor.getBlue(),
# alpha);
# }
#
# public static Color toProto(java.awt.Color color) {
# float red = (float) color.getRed();
# float green = (float) color.getGreen();
# float blue = (float) color.getBlue();
# float denominator = 255.0;
# Color.Builder resultBuilder =
# Color
# .newBuilder()
# .setRed(red / denominator)
# .setGreen(green / denominator)
# .setBlue(blue / denominator);
# int alpha = color.getAlpha();
# if (alpha != 255) {
# result.setAlpha(
# FloatValue
# .newBuilder()
# .setValue(((float) alpha) / denominator)
# .build());
# }
# return resultBuilder.build();
# }
# // ...
#
# Example (iOS / Obj-C):
#
# // ...
# static UIColor* fromProto(Color* protocolor) {
# float red = [protocolor red];
# float green = [protocolor green];
# float blue = [protocolor blue];
# FloatValue* alpha_wrapper = [protocolor alpha];
# float alpha = 1.0;
# if (alpha_wrapper != nil) {
# alpha = [alpha_wrapper value];
# }
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
# }
#
# static Color* toProto(UIColor* color) {
# CGFloat red, green, blue, alpha;
# if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
# return nil;
# }
# Color* result = [[Color alloc] init];
# [result setRed:red];
# [result setGreen:green];
# [result setBlue:blue];
# if (alpha &lt;= 0.9999) {
# [result setAlpha:floatWrapperWithValue(alpha)];
# }
# [result autorelease];
# return result;
# }
# // ...
#
# Example (JavaScript):
#
# // ...
#
# var protoToCssColor = function(rgb_color) {
# var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0;
# var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255);
# var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255);
#
# if (!(&#x27;alpha&#x27; in rgb_color)) {
# return rgbToCssColor_(red, green, blue);
# }
#
# var alphaFrac = rgb_color.alpha.value || 0.0;
# var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
# return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
# };
#
# var rgbToCssColor_ = function(red, green, blue) {
# var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
# var hexString = rgbNumber.toString(16);
# var missingZeros = 6 - hexString.length;
# var resultBuilder = [&#x27;#&#x27;];
# for (var i = 0; i &lt; missingZeros; i++) {
# resultBuilder.push(&#x27;0&#x27;);
# }
# resultBuilder.push(hexString);
# return resultBuilder.join(&#x27;&#x27;);
# };
#
# // ...
&quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
# the final pixel color is defined by the equation:
#
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
#
# This means that a value of 1.0 corresponds to a solid color, whereas
# a value of 0.0 corresponds to a completely transparent color. This
# uses a wrapper message rather than a simple float scalar so that it is
# possible to distinguish between a default value and the value being unset.
# If omitted, this color object is to be rendered as a solid color
# (as if the alpha value had been explicitly given with a value of 1.0).
&quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
&quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
},
&quot;lightOffDuration&quot;: &quot;A String&quot;, # Required. Along with `light_on_duration `, define the blink rate of LED
# flashes. Resolution defined by
# [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)
},
&quot;bodyLocArgs&quot;: [ # Variable string values to be used in place of the format specifiers in
# body_loc_key to use to localize the body text to the user&#x27;s current
# localization.
# See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
&quot;A String&quot;,
],
&quot;defaultLightSettings&quot;: True or False, # If set to true, use the Android framework&#x27;s default LED light settings for
# the notification. Default values are specified in
# [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
# If `default_light_settings` is set to true and `light_settings` is also
# set, the user-specified `light_settings` is used instead of the
# default value.
&quot;channelId&quot;: &quot;A String&quot;, # The [notification&#x27;s channel
# id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels)
# (new in Android O). The app must create a channel with this channel ID
# before any notification with this channel ID is received. If you don&#x27;t send
# this channel ID in the request, or if the channel ID provided has not yet
# been created by the app, FCM uses the channel ID specified in the app
# manifest.
&quot;defaultVibrateTimings&quot;: True or False, # If set to true, use the Android framework&#x27;s default vibrate pattern for the
# notification. Default values are specified in
# [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
# If `default_vibrate_timings` is set to true and `vibrate_timings` is also
# set, the default value is used instead of the user-specified
# `vibrate_timings`.
&quot;icon&quot;: &quot;A String&quot;, # The notification&#x27;s icon.
# Sets the notification icon to myicon for drawable resource myicon.
# If you don&#x27;t send this key in the request, FCM displays the launcher icon
# specified in your app manifest.
&quot;ticker&quot;: &quot;A String&quot;, # Sets the &quot;ticker&quot; text, which is sent to accessibility services.
# Prior to API level 21 (`Lollipop`), sets the text that is displayed in the
# status bar when the notification first arrives.
&quot;notificationPriority&quot;: &quot;A String&quot;, # Set the relative priority for this notification. Priority is an indication
# of how much of the user&#x27;s attention should be consumed by this
# notification. Low-priority notifications may be hidden from the user in
# certain situations, while the user might be interrupted for a
# higher-priority notification. The effect of setting the same priorities may
# differ slightly on different platforms. Note this priority differs from
# `AndroidMessagePriority`. This priority is processed by the client after
# the message has been delivered, whereas
# [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority)
# is an FCM concept that controls when the message is delivered.
&quot;color&quot;: &quot;A String&quot;, # The notification&#x27;s icon color, expressed in #rrggbb format.
&quot;image&quot;: &quot;A String&quot;, # Contains the URL of an image that is going to be displayed in a
# notification. If present, it will override
# google.firebase.fcm.v1.Notification.image.
&quot;defaultSound&quot;: True or False, # If set to true, use the Android framework&#x27;s default sound for the
# notification. Default values are specified in
# [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
&quot;sound&quot;: &quot;A String&quot;, # The sound to play when the device receives the notification.
# Supports &quot;default&quot; or the filename of a sound resource bundled in the app.
# Sound files must reside in /res/raw/.
&quot;clickAction&quot;: &quot;A String&quot;, # The action associated with a user click on the notification.
# If specified, an activity with a matching intent filter is launched when
# a user clicks on the notification.
&quot;titleLocKey&quot;: &quot;A String&quot;, # The key to the title string in the app&#x27;s string resources to use to
# localize the title text to the user&#x27;s current localization.
# See [String Resources](https://goo.gl/NdFZGI) for more information.
&quot;tag&quot;: &quot;A String&quot;, # Identifier used to replace existing notifications in the notification
# drawer.
# If not specified, each request creates a new notification.
# If specified and a notification with the same tag is already being shown,
# the new notification replaces the existing one in the notification drawer.
&quot;title&quot;: &quot;A String&quot;, # The notification&#x27;s title. If present, it will override
# google.firebase.fcm.v1.Notification.title.
},
&quot;collapseKey&quot;: &quot;A String&quot;, # An identifier of a group of messages that can be collapsed, so that only
# the last message gets sent when delivery can be resumed. A maximum of 4
# different collapse keys is allowed at any given time.
&quot;priority&quot;: &quot;A String&quot;, # Message priority. Can take &quot;normal&quot; and &quot;high&quot; values.
# For more information, see [Setting the priority of a
# message](https://goo.gl/GjONJv).
&quot;restrictedPackageName&quot;: &quot;A String&quot;, # Package name of the application where the registration token must match in
# order to receive the message.
&quot;ttl&quot;: &quot;A String&quot;, # How long (in seconds) the message should be kept in FCM storage if the
# device is offline. The maximum time to live supported is 4 weeks, and the
# default value is 4 weeks if not set. Set it to 0 if want to send the
# message immediately.
# In JSON format, the Duration type is encoded as a string rather than an
# object, where the string ends in the suffix &quot;s&quot; (indicating seconds) and
# is preceded by the number of seconds, with nanoseconds expressed as
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
# encoded in JSON format as &quot;3s&quot;, while 3 seconds and 1 nanosecond should
# be expressed in JSON format as &quot;3.000000001s&quot;. The ttl will be rounded down
# to the nearest second.
&quot;fcmOptions&quot;: { # Options for features provided by the FCM SDK for Android. # Options for features provided by the FCM SDK for Android.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
},
},
&quot;apns&quot;: { # [Apple Push Notification Service](https://goo.gl/MXRTPa) specific options. # Input only. [Apple Push Notification Service](https://goo.gl/MXRTPa)
# specific options.
&quot;payload&quot;: { # APNs payload as a JSON object, including both `aps` dictionary and custom
# payload. See [Payload Key
# Reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification).
# If present, it overrides google.firebase.fcm.v1.Notification.title
# and google.firebase.fcm.v1.Notification.body.
&quot;a_key&quot;: &quot;&quot;, # Properties of the object.
},
&quot;headers&quot;: { # HTTP request headers defined in Apple Push Notification Service. Refer to
# [APNs request
# headers](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns)
# for supported headers, e.g. &quot;apns-priority&quot;: &quot;10&quot;.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;fcmOptions&quot;: { # Options for features provided by the FCM SDK for iOS. # Options for features provided by the FCM SDK for iOS.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
&quot;image&quot;: &quot;A String&quot;, # Contains the URL of an image that is going to be displayed in a
# notification. If present, it will override
# google.firebase.fcm.v1.Notification.image.
},
},
&quot;webpush&quot;: { # [Webpush protocol](https://tools.ietf.org/html/rfc8030) options. # Input only. [Webpush protocol](https://tools.ietf.org/html/rfc8030)
# options.
&quot;fcmOptions&quot;: { # Options for features provided by the FCM SDK for Web. # Options for features provided by the FCM SDK for Web.
&quot;analyticsLabel&quot;: &quot;A String&quot;, # Label associated with the message&#x27;s analytics data.
&quot;link&quot;: &quot;A String&quot;, # The link to open when the user clicks on the notification.
# For all URL values, HTTPS is required.
},
&quot;data&quot;: { # Arbitrary key/value payload. If present, it will override
# google.firebase.fcm.v1.Message.data.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;headers&quot;: { # HTTP headers defined in webpush protocol. Refer to
# [Webpush protocol](https://tools.ietf.org/html/rfc8030#section-5) for
# supported headers, e.g. &quot;TTL&quot;: &quot;15&quot;.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;notification&quot;: { # Web Notification options as a JSON object. Supports Notification instance
# properties as defined in [Web Notification
# API](https://developer.mozilla.org/en-US/docs/Web/API/Notification). If
# present, &quot;title&quot; and &quot;body&quot; fields override
# [google.firebase.fcm.v1.Notification.title] and
# [google.firebase.fcm.v1.Notification.body].
&quot;a_key&quot;: &quot;&quot;, # Properties of the object.
},
},
&quot;condition&quot;: &quot;A String&quot;, # Condition to send a message to,
# e.g. &quot;&#x27;foo&#x27; in topics &amp;&amp; &#x27;bar&#x27; in topics&quot;.
}</pre>
</div>
</body></html>