jlcvp / fcm-node

A Node.JS simple interface to Google's Firebase Cloud Messaging (FCM) for Android & iOS & Web Notification and data push
MIT License
125 stars 46 forks source link

Why I'm getting this error? Messaging payload contains an invalid "collapse_key" property. Valid properties are "data" and "notification #66

Closed bsor-dev closed 3 years ago

bsor-dev commented 4 years ago

This is my payload.

{
        to: "",
        notification: {
          title:"Message Test",
          body:"Driver App"
        },
        data:{
          del_id: "121"
        },
        collapse_key:"Key 1",
      }

It work but if I add collapse_key I'm getting error

Messaging payload contains an invalid "collapse_key" property. Valid properties are "data" and "notification".

jlcvp commented 3 years ago

Yeah, fcm changed their payload structure. I recommend you to use their SDK to deliver notifications

jlcvp commented 3 years ago

Try adding the collapse_key into the notification object