Firebase - Send push notification
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Firebase project
Sends a push notification through Firebase Cloud Messaging (FCM). You can send it to a topic, to one device, or to a list of up to 100 devices. The notification reaches Android apps, iOS apps and browsers that use the Firebase SDK.
The Message Title and Message Body are used on every platform. To set platform options, such as an Android icon or an iOS badge, build them first with the Create message actions and pass their output into this action.
This action is part of the Push Notifications add-on (DnnSharp.PushNotifications). The add-on is installed separately and needs the PUSHN feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Push Notifications actions, the add-on isn't installed.
Typical Use Cases
- Notify a user's devices when their order ships or a ticket is answered
- Send a news alert to every device subscribed to a topic
- Send a reminder from a scheduled job to a list of device tokens
Don't use it to
- Subscribe devices to a topic. Use Firebase - Assign/Unassign to Topic instead.
- Send through Pushwoosh. Use Create PushWoosh Notification instead.
- Send a data-only (silent) message. The action always includes a notification with a title and body.
- Confirm that the notification was delivered. The action returns nothing and doesn't report send errors. See Considerations.
Related Actions
| Action Name | Description |
|---|---|
| Firebase - Create Android message | Builds the Android settings to pass into Android Specific Notification Json. |
| Firebase - Create iOS message | Builds the iOS settings to pass into iOS Specific Notification Json. |
| Firebase - Create WebPush message | Builds the browser settings to pass into WebPush Specific Notification Json. |
| Firebase - Assign/Unassign to Topic | Subscribes devices to the topic you send to. |
| Execute Actions For Each List Entry | Runs this action once per batch or device when you have more than 100 tokens. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Credential Key | The name of an appSettings key in web.config whose value is the full path of your Firebase service account key file, for example FirebaseCredentials. See Credentials. | Yes | empty string | Yes |
| Message Audience | Who receives the message: Topic, Device, or Device list (max 100 tokens). | No | Topic | No |
| Topic Name | The topic to send to, for example news. Shown when Message Audience is Topic. | Yes | empty string | When the audience is Topic |
| Device Token | The registration token of one device. Shown when Message Audience is Device. | Yes | empty string | When the audience is Device |
| Device Tokens | Registration tokens separated by commas, up to 100. Shown when Message Audience is Device list (max 100 tokens). Don't put spaces after the commas. | Yes | empty string | When the audience is Device list |
| Message Title | The title of the notification. A title set in a Create message action replaces it on that platform. | Yes | empty string | No |
| Message Body | The text of the notification. A body set in a Create message action replaces it on that platform. | Yes | empty string | No |
| Data Input Type | Where the custom data comes from: Name Value Pairs or List Name. | No | Name Value Pairs | No |
| Data | Custom key/value pairs sent to the app. Enter a key and a value in each row. Shown when Data Input Type is Name Value Pairs. | Yes, keys and values | empty | No |
| Data List Name | The name of a list whose items have key and value fields. Each item becomes one key/value pair. Shown when Data Input Type is List Name. | No | empty string | No |
| Android Specific Notification Json | The Android settings as JSON, usually the output token of Firebase - Create Android message, for example [AndroidJson]. | Yes | empty string | No |
| iOS Specific Notification Json | The iOS (APNs) settings as JSON, usually the output token of Firebase - Create iOS message. | Yes | empty string | No |
| WebPush Specific Notification Json | The browser settings as JSON, usually the output token of Firebase - Create WebPush message. | Yes | empty string | No |
Output Parameters Reference
This action has no output parameters. It doesn't return the Firebase message ID.
Credentials
The Firebase actions don't use a connector. They read a Firebase service account key file from the server. See Push Notifications for how to create the file and add the appSettings key.
If the key can't be used, the action fails with one of these errors:
No credential key was specified.when Credential Key is empty.The provided credential key was not found in AppSettings section in web.config.The credential file name specified by the CredentialKey found in AppSettings section doesn't point to an existing file on disk.
The file is loaded the first time each key is used. If you replace the file later, restart the site.
Considerations
- Send errors aren't reported. In 1.28, any error after the credentials are loaded is written to the log and the action carries on as if it succeeded. This includes an invalid device token, an unknown topic, an empty Topic Name or Device Token, and invalid platform JSON. Nothing tells the following actions that the send failed. If notifications don't arrive, check the site's log.
- No message ID. In 1.28, the action doesn't return the Firebase message ID or the per-device results of a device list send. Devices that fail in a list are ignored.
- Device tokens come from your app. The registration tokens are created by the Firebase SDK in your mobile or web app. Your app has to send them to your site so you can save them, for example with the user record. Tokens change, so update them when the app sends a new one.
- Device list limit. Firebase accepts up to 100 tokens in one device list send. The commas aren't trimmed, so
token1, token2sends" token2", which Firebase rejects. - Data list format. With List Name, every item must have a
keyfield and avaluefield, and keys must be unique. If the list doesn't exist, no data is sent. - Platform data replaces the common data. If a Create message action for Android or WebPush has its own Data, Firebase sends that data to that platform instead of the data set here.
Examples
To understand how to use the below examples, please see Running Examples.
1. Send a notification to a topic
This action sends a notification to every device subscribed to the news topic. It sends the article ID as custom data so the app can open the article.
{
"Title": "Firebase - Send push notification",
"ActionType": "Firebase.SendPushNotification",
"Description": "Notify news subscribers",
"Parameters": {
"CredentialKey": "FirebaseCredentials",
"MessageAudience": "Topic",
"TopicName": "news",
"Title": "New article: [ArticleTitle]",
"Body": "[ArticleSummary]",
"DataInputType": "NameValue",
"Data": {
"articleId": "[ArticleId]"
}
}
}
2. Send to one device with Android settings
The first action builds the Android settings with high priority and a click action, and saves them in AndroidJson. The second action sends the notification to the device token in [UserDeviceToken] and passes in the Android settings.
[
{
"Title": "Firebase - Create Android message",
"ActionType": "Firebase.CreateAndroidFirebaseMessage",
"Description": "Build the Android settings",
"Parameters": {
"Priority": "High",
"ClickAction": "OPEN_ORDER",
"DataInputType": "NameValue",
"Data": {},
"OutputToken": "AndroidJson"
}
},
{
"Title": "Firebase - Send push notification",
"ActionType": "Firebase.SendPushNotification",
"Description": "Tell the user the order shipped",
"Parameters": {
"CredentialKey": "FirebaseCredentials",
"MessageAudience": "Device",
"DeviceToken": "[UserDeviceToken]",
"Title": "Your order has shipped",
"Body": "Order [OrderId] is on its way.",
"DataInputType": "NameValue",
"Data": {
"orderId": "[OrderId]"
},
"AndroidNotificationJson": "[AndroidJson]"
}
}
]
Revised 10/03/2026