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