Skip to content

Invalid JSON payload received. Unknown name "clickAction" at 'message.notification': Cannot find field #2180

@Mikkelet

Description

@Mikkelet

[REQUIRED] Step 2: Describe your environment

  • Operating System version: MAC 13.3.1 (a) (22E772610a)
  • Firebase SDK version: 11.30.0
  • Firebase Product: messaging
  • Node.js version: v16.14.0
  • NPM version: 8.3.1

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Send a notification usign the messaging tool and the send-function

Im testing this using serve on local machine

Relevant Code:


    const data: DataMessagePayload = {
       somData: "myData"
    }
    const apns: ApnsConfig = {
        payload: {
            aps: {
                alert: {
                    title: "title",
                    body: "body",
                },
            }
        }
    }
    const notification: NotificationMessagePayload = {
        title: "title",
        body: "body",
        clickAction: "FLUTTER_NOTIFICATION_CLICK",
    }

    const payload: TopicMessage = {
        topic: "myTopic",
        data: data,
        notification: notification,
        apns: apns,
    }

    await firebase.messaging().send(payload)

gives me this error

>    errorInfo: {
>      code: 'messaging/invalid-argument',
>      message: `Invalid JSON payload received. Unknown name "clickAction" at 'message.notification': Cannot find field.`
>    },
>    codePrefix: 'messaging'
>  }


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