Overview
This node sends push notifications via Firebase Cloud Messaging (FCM). It supports sending messages to specific device tokens, multiple tokens, topics, or based on conditions. It also allows subscribing or unsubscribing device tokens to/from topics. This node is useful for applications that need to send real-time notifications or data messages to mobile devices or web clients using Firebase's messaging infrastructure. For example, it can be used to send alerts, promotional messages, or updates to users' devices.
Use Case Examples
- Send a notification to a single device token with a title, body, and custom data payload.
- Send a high-priority notification to multiple device tokens at once.
- Send a message to all devices subscribed to a specific topic.
- Subscribe a list of device tokens to a topic for group messaging.
Properties
| Name | Meaning |
|---|---|
| Device Token | The registration token or array of registration tokens to send a message to. Used when sending to one or multiple tokens. |
| Multiple Tokens | Boolean flag indicating whether to send to multiple tokens at once. |
| Device Tokens | Array of device tokens to send to when sending to multiple tokens (max 500). |
| Message | The notification message fields including title, body, image URL, priority, sound, click action, and custom data payload. |
| JSON Parameters | Whether to use raw JSON for message configuration instead of the UI fields. |
| Message JSON | Full message JSON payload used when JSON Parameters is true. |
| Message Type | Type of message to send: notification with optional data or data-only message. |
Output
JSON
success- Indicates if the message sending operation was successful.result- The result object returned from Firebase Cloud Messaging API containing details of the send operation.
Dependencies
- Requires Firebase Cloud Messaging API credentials (API key or service account).
Troubleshooting
- Ensure device tokens are valid and correctly formatted; invalid tokens will cause errors.
- Maximum 500 tokens allowed per send to multiple tokens operation; exceeding this limit throws an error.
- Topic names must match the pattern [a-zA-Z0-9-_.~%]+; invalid topics cause errors.
- JSON data fields must be valid JSON; invalid JSON will cause parsing errors.
- Firebase initialization errors usually indicate incorrect or missing credentials.
Links
- Firebase Cloud Messaging Documentation - Official Firebase documentation for sending messages using Firebase Cloud Messaging.