कंसोल पर जाएं

REST Resource: projects.messages

Resource: Message

Message to send by Firebase Cloud Messaging Service.

JSON representation
{
  "name": string,
  "data": {
    string: string,
    ...
  },
  "notification": {
    object (Notification)
  },
  "android": {
    object (AndroidConfig)
  },
  "webpush": {
    object (WebpushConfig)
  },
  "apns": {
    object (ApnsConfig)
  },
  "fcm_options": {
    object (FcmOptions)
  },

  // Union field target can be only one of the following:
  "token": string,
  "topic": string,
  "condition": string
  // End of list of possible types for union field target.
}
Fields
name

string

Output Only. The identifier of the message sent, in the format of projects/*/messages/{message_id}.

data

map (key: string, value: string)

Input only. Arbitrary key/value payload.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

notification

object (Notification)

Input only. Basic notification template to use across all platforms.

android

object (AndroidConfig)

Input only. Android specific options for messages sent through FCM connection server.

webpush

object (WebpushConfig)

Input only. Webpush protocol options.

apns

object (ApnsConfig)

Input only. Apple Push Notification Service specific options.

fcm_options

object (FcmOptions)

Input only. Template for FCM SDK feature options to use across all platforms.

Union field target. Required. Input only. Target to send a message to. target can be only one of the following:
token

string

Registration token to send a message to.

topic

string

Topic name to send a message to, e.g. "weather". Note: "/topics/" prefix should not be provided.

condition

string

Condition to send a message to, e.g. "'foo' in topics && 'bar' in topics".

Notification

Basic notification template to use across all platforms.

JSON representation
{
  "title": string,
  "body": string,
  "image": string
}
Fields
title

string

The notification's title.

body

string

The notification's body text.

image

string

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

AndroidConfig

Android specific options for messages sent through FCM connection server.

JSON representation
{
  "collapse_key": string,
  "priority": enum (AndroidMessagePriority),
  "ttl": string,
  "restricted_package_name": string,
  "data": {
    string: string,
    ...
  },
  "notification": {
    object (AndroidNotification)
  },
  "fcm_options": {
    object (AndroidFcmOptions)
  }
}
Fields
collapse_key

string

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.

priority

enum (AndroidMessagePriority)

Message priority. Can take "normal" and "high" values. For more information, see Setting the priority of a message.