Skip to main content
Version: 1.28 (Current)

Firebase - Create WebPush message

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, Firebase project

Builds the browser (WebPush) settings of a Firebase push notification and saves them as JSON in a token. It doesn't send anything. Pass the token into the WebPush Specific Notification Json parameter of Firebase - Send push notification.

Use it to set browser options such as the icon, image, buttons and whether the notification stays on screen, or to give browsers a different title, body or data than the other platforms.

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​

  • Show your site's icon and an image in the browser notification
  • Add buttons, for example View and Dismiss, that your service worker handles
  • Keep an important notification on screen until the user clicks or closes it
  • Replace an older notification with the same tag instead of stacking them

Don't use it to​

Action NameDescription
Firebase - Send push notificationSends the notification with the settings built by this action.
Firebase - Create Android messageBuilds the Android settings of the notification.
Firebase - Create iOS messageBuilds the iOS settings of the notification.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
DirectionThe text direction: Auto, Left To Right or Right To Left.YesAutoNo
Renotifytrue to alert the user again when this notification replaces one with the same Message Tag.YesfalseNo
Require Interactiontrue to keep the notification on screen until the user clicks or dismisses it.YesfalseNo
Silenttrue to show the notification without sound or vibration.YesfalseNo
BadgeThe URL of a small image shown when there isn't room for the full notification, for example on Android browsers.Yesempty stringNo
Message TitleThe browser title. It replaces the Message Title of the Send action in browsers.Yesempty stringNo
Message BodyThe browser body. It replaces the Message Body of the Send action in browsers.Yesempty stringNo
Message IconThe URL of the notification icon.Yesempty stringNo
Message ImageThe URL of a larger image shown in the notification.Yesempty stringNo
Message TagAn ID for the notification. A new notification with the same tag replaces the old one.Yesempty stringNo
Message ActionsButtons shown on the notification. In each row, enter the Action name your service worker receives, the button Title, and an optional Icon URL.NoemptyNo
Data Input TypeWhere the custom data comes from: Name Value Pairs or List Name.NoName Value PairsNo
DataCustom key/value pairs sent to the browser. 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. Shown when Data Input Type is List Name.Noempty stringNo
Output TokenThe name of the token that receives the JSON, for example WebPushJson. Brackets are optional.Noempty stringYes

Output Parameters Reference​

ParameterDescription
[<Output Token>]The WebPush settings as JSON. Pass it into WebPush Specific Notification Json of the Send action.

Considerations​

  • Output Token is required. If Output Token is empty, the action does nothing and shows no error.
  • True or false values. Renotify, Require Interaction and Silent are text boxes. Enter true or false, or a token that returns one of them. An empty value means false.
  • No tokens in buttons. In 1.28, tokens in Message Actions aren't replaced, although the help text says they are. Use fixed values.
  • Browser support varies. Browsers decide which options they show. For example, some ignore Message Image, Message Actions or Require Interaction.
  • Renotify needs a tag. Browsers only use Renotify when Message Tag has a value.
  • WebPush data replaces the common data. If you set Data here, Firebase sends it to browsers instead of the Data of the Send action. Repeat any common keys here.
  • Data list format. With List Name, every item must have a key field and a value field, and keys must be unique. Otherwise, the action fails. If the list doesn't exist, no data is added.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Build a browser notification with buttons​

This action builds browser settings with an icon, an image, a tag and two buttons. The notification stays on screen until the user acts on it. The URL to open is sent as data so the service worker can open it. The JSON is saved in WebPushJson. Pass [WebPushJson] into the Send action.

{
"Title": "Firebase - Create WebPush message",
"ActionType": "Firebase.CreateWebPushFirebaseMessage",
"Description": "Build the browser notification",
"Parameters": {
"Direction": "Auto",
"Renotify": "true",
"RequireInteraction": "true",
"Silent": "false",
"Title": "New comment on [PostTitle]",
"Body": "[CommentAuthor]: [CommentPreview]",
"Icon": "https://www.example.com/images/icon-192.png",
"Image": "https://www.example.com/images/posts/[PostId].jpg",
"Tag": "post-[PostId]",
"Actions": [
{
"ActionName": "view",
"Title": "View",
"Icon": ""
},
{
"ActionName": "dismiss",
"Title": "Dismiss",
"Icon": ""
}
],
"DataInputType": "NameValue",
"Data": {
"url": "https://www.example.com/posts/[PostId]"
},
"OutputToken": "WebPushJson"
}
}

Revised 10/03/2026