I am facing InvalidServerResponse while sending notification

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ismailceliktrcommented, Jun 16, 2021

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.

0reactions
mrafiqkcommented, Jun 20, 2021

@jlcvp I think the problem is my token. I regenerated my token and sent my notification again. It works fine.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found