Skip to main content
Version: 1.28 (Current)

Firebase - Send push notification

Audience: Low-code Engineers

Skill 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.

note

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​

Action NameDescription
Firebase - Create Android messageBuilds the Android settings to pass into Android Specific Notification Json.
Firebase - Create iOS messageBuilds the iOS settings to pass into iOS Specific Notification Json.
Firebase - Create WebPush messageBuilds the browser settings to pass into WebPush Specific Notification Json.
Firebase - Assign/Unassign to TopicSubscribes devices to the topic you send to.
Execute Actions For Each List EntryRuns this action once per batch or device when you have more than 100 tokens.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Credential KeyThe 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.Yesempty stringYes
Message AudienceWho receives the message: Topic, Device, or Device list (max 100 tokens).NoTopicNo
Topic NameThe topic to send to, for example news. Shown when Message Audience is Topic.Yesempty stringWhen the audience is Topic
Device TokenThe registration token of one device. Shown when Message Audience is Device.Yesempty stringWhen the audience is Device
Device TokensRegistration tokens separated by commas, up to 100. Shown when Message Audience is Device list (max 100 tokens). Don't put spaces after the commas.Yesempty stringWhen the audience is Device list
Message TitleThe title of the notification. A title set in a Create message action replaces it on that platform.Yesempty stringNo
Message BodyThe text of the notification. A body set in a Create message action replaces it on that platform.Yesempty stringNo
Data Input TypeWhere the custom data comes from: Name Value Pairs or List Name.NoName Value PairsNo
DataCustom 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 valuesemptyNo
Data List NameThe 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.Noempty stringNo
Android Specific Notification JsonThe Android settings as JSON, usually the output token of Firebase - Create Android message, for example [AndroidJson].Yesempty stringNo
iOS Specific Notification JsonThe iOS (APNs) settings as JSON, usually the output token of Firebase - Create iOS message.Yesempty stringNo
WebPush Specific Notification JsonThe browser settings as JSON, usually the output token of Firebase - Create WebPush message.Yesempty stringNo

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, token2 sends " token2", which Firebase rejects.
  • Data list format. With List Name, every item must have a key field and a value field, 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​

tip

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