Overview
This node sends push notifications via Firebase Cloud Messaging (FCM). It supports sending messages to specific device tokens, topics, or based on conditions, as well as subscribing or unsubscribing device tokens to/from topics. It is useful for applications that need to deliver real-time notifications or data messages to mobile or web clients using Firebase's messaging infrastructure. For example, sending weather alerts to a topic or sending personalized notifications to specific user devices.
Use Case Examples
- Sending a notification to all devices subscribed to a 'weather' topic.
- Sending a data-only message to a specific device token for app background processing.
- Subscribing multiple device tokens to a 'news' topic for targeted notifications.
Properties
| Name | Meaning |
|---|---|
| Topic | The topic name to send a message to. Required for sending messages to topics or managing topic subscriptions. |
| Message | The notification message fields including title, body, image URL, priority, sound, click action, and custom data payload. Used to configure the notification content and behavior. |
| JSON Parameters | Whether to use raw JSON for the message configuration instead of the structured message fields. |
| Message JSON | The full message JSON payload used when JSON Parameters is true. |
| Message Type | The type of message to send, either a notification with optional data or data-only message. |
Output
JSON
success- Indicates if the message operation was successful.result- The result object returned from Firebase Cloud Messaging API, containing details of the send operation.
Dependencies
- Firebase Cloud Messaging API
- An API key credential or service account key for Firebase authentication
Troubleshooting
- Ensure the Firebase credentials are correctly configured and valid to avoid initialization errors.
- Validate device tokens and topic names to conform to Firebase requirements to prevent invalid token or topic format errors.
- When using JSON parameters, ensure the JSON is well-formed to avoid parsing errors.
- Respect limits such as maximum 500 tokens for multicast messages and 1000 tokens for topic subscription/unsubscription to avoid request errors.
Links
- Firebase Cloud Messaging Documentation - Official Firebase documentation for sending messages and managing topics.