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 48 forks source link

(InvalidServerResponse) Error when send notification to topic #94

Closed dantn93 closed 2 years ago

dantn93 commented 2 years ago

I found a bug when I sent a notification to topic. My function like that:

let message = {
 notification: {body, title},
 data: {}
 to: `/topics/${topic}`,
 priority: 'high',
 content_availabe: true
}
fcm.send(message, async res) => {
// =>> The result: `InvalidServerResponse`
})

ERROR:

{
 "result": "InvalidServerResponse"
 }

Please check again! It's urgent with me. Thanks

dantn93 commented 2 years ago

Our system worked perfectly with this code before, but now it did not. I just found this error some days ago!

jlcvp commented 2 years ago

They must have changed something in the payload format. Additionally, this lib is becoming strongly deprecated and I do not intend to keep the support for it any further, please use the official firebase sdk for node.