Skip to content

I can't set click_action and icon using notification message (Notification Composer)[GUI] #8599

@Mateostin

Description

@Mateostin

Operating System

Ubuntu 24.04

Environment (if applicable)

Chrome 129.0.6668.58

Firebase SDK Version

10.14.1

Firebase SDK Product(s)

Messaging

Project Tooling

im using JavaScript SDK libraries from the CDN

Detailed Problem Description

The FCM Console Notification Composer (Notification message) allows the addition of extra parameters using the "Custom data" function. I wanted to try adding click_action, body, icon, etc. However, I checked payload and i noticed that these parameters are located in "data"

image

{
   "from":"xxx",
   "collapseKey":"xxx",
   "messageId":"xxx",
   "notification":{
      "title":"Test title",
      "body":"Test body",
      "image":"path-to-img"
   },
   "data":{
      "click_action":"my-custom-url",
      "icon":"path-to-icon",
      "badge":"path-to-badge",
   }

Meanwhile, the service worker handles parameters such as click_action, body, and icon only when they are added to "notification". So, what’s the easiest way to define click_action with a link that should open when the notification is clicked? And how can I set the icon parameter directly from the Notification Composer (GUI) – is that even possible?

I should add that when I define a push notification (data message) manually, set the parameters correctly, and then receive the message in onBackgroundMessage, everything works as expected.

Steps and code to reproduce issue

Just try send Push notification from firebase GUI (Notification Composer) and check payload

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions