Closed mrafiqk closed 3 years ago
I have same problem. Any idea?
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); } })
Google may have deprecated the sdk version I use or maybe they change the message format. I'll investigate and see if it's worth updating the lib
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.
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); } })
@mrafiqk based on @ismailceliktr testimony, can you check your network settings to see if the firebase host is accessible?
@jlcvp I think the problem is my token. I regenerated my token and sent my notification again. It works fine.
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.