I am facing InvalidServerResponse while sending notification
See original GitHub issueI am not able to send any notification to my android or ios device. We upgraded to a newer version, but our notification still fails. I have attached my sample code here. Please let me know if need to change anything. But it worked fine before. The same code now fails.
var message = {
to: doc.token,
collapse_key: 'green',
notification: {
title: title,
body: body
}
};
if(image) {
message.notification.image = image;
}
fcm.send(message, function (err, response) {
if(err) {
reject(err);
} else {
resolve(response);
}
})
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
"InvalidServerResponse" during post request to the NodeJS ...
I'm sending push notification using the Firebase Cloud Messaging. Google Cloud Collective. node.js · firebase · google-cloud-firestore · postman.
Read more >InvalidServerResponse Error on fcm.send · Issue #5 - GitHub
I'm using fcm-push for a node.js server. It's almost working, but I get an InvalidServerResponse error when the message sends.
Read more >What are Push Notifications? A Complete Guide [Up-to-date]
Push notification alerts can be displayed in three locations on your phone—lock screen, banner, and notification center, when the app user opts-in for...
Read more >How to Use Firebase to Send Push Notifications - MagicBell
A step-by-step guide on how to use Firebase to send push notifications, including Firebase features to know, starting a project, ...
Read more >Firebase Cloud Messaging (FCM) Troubleshooting Guide
Check FCM Server API Key. If it appears that your push notifications are no longer being received on Android devices, it is possible...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My problem was entirely my fault. I manually set the FCM API ip addresses in /etc/hosts for my firewall rules. Requests to an IP address get stuck in the firewall. After rearranging my firewall settings, my problem was solved.
@jlcvp I think the problem is my token. I regenerated my token and sent my notification again. It works fine.