Send Messages with the Firebase Console

You can send notification messages to iOS and Android devices using the Notifications composer in the Firebase console. Though this does not provide the same flexibility or scalability as sending messages with the Admin SDK or the HTTP and XMPP protocols, it can be very useful for testing or for highly targeted marketing and user engagement. After you have developed logic in your app to receive messages, you can allow non-technical users to send messages per the instructions in the Notifications page in the Firebase Help Center.

When you send a notification message from the Notifications composer, Google uses the fields entered in the composer in two ways:

  1. Fields like User segment and Expires determine the message target and delivery options.
  2. Fields like Message text and Custom data are sent to the client in a payload comprised of key/value pairs.

These fields map to keys available through the FCM server protocols. For example, key/value pairs entered in Custom data are handled as a data payload for the notification. Other fields map directly to keys in the FCM notification payload.

Note that some fields in the Notifications composer are not available through the FCM server protocols. For example, you can target user segments based on app, app version, language or user properties in ways that are not available using the to field in the server API.

The keys that the Firebase console sends to clients are:

Key Console field label Description
notification.title Message title Indicates notification title.
notification.body Message text Indicates notification body text.
data Custom data Key/value pairs that you define. These are delivered as a data payload for the app to handle.

Keys that determine message delivery include:

Key Console field label Description
priority Priority

Sets the priority of the message.

For more information, see Setting the priority of a message.

sound Sound

Indicates a sound to play when the device receives a notification.

time_to_live Expires

This parameter specifies how long (in seconds) the message should be kept in FCM storage if the device is offline. For more information, see Setting the lifespan of a message.

Send feedback about...

Need help? Visit our support page.