# Sending Firebase Cloud Messages via node-red-contrib-fcm-push-node

**URL:** <https://discourse.nodered.org/t/sending-firebase-cloud-messages-via-node-red-contrib-fcm-push-node/22165>\
**Category:** General\
**Created:** [23 February 2020 21:32 UTC](https://discourse.nodered.org/t/sending-firebase-cloud-messages-via-node-red-contrib-fcm-push-node/22165 "2020-02-23T21:32:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![koverskeid](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@koverskeid](https://discourse.nodered.org/u/koverskeid)\
**Post date:** [23 February 2020 21:32 UTC](https://discourse.nodered.org/t/sending-firebase-cloud-messages-via-node-red-contrib-fcm-push-node/22165/1 "2020-02-23T21:32:49Z")

</div>

Hi all,

I'm trying to use FCM to send notifications from my Raspberry to all devices subscribing to the topic "allDevices".

I have added the server key as the environmental variable FCM\_SERVER\_KEY in settings.js.

Then I added a function node to the flow with the following code:

msg.payload = {  
"to":"allDevices",  
"notification": {  
"title":"test",  
"body":"Hello Android!"  
}  
}  
return msg;

This function node is the input for the fcm push node.

However, I only get the error message "Couldnt send message". Any tips?

---

<div class="post-metadata">

**Author:** ![koverskeid](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@koverskeid](https://discourse.nodered.org/u/koverskeid)\
**Post date:** [24 February 2020 21:35 UTC](https://discourse.nodered.org/t/sending-firebase-cloud-messages-via-node-red-contrib-fcm-push-node/22165/2 "2020-02-24T21:35:26Z")

</div>

Never mind, didn't read the fcm documentation properly. Turns out the topic needs to be prefixed with /topics/

Now everything is working like a charm 😃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 March 2020 21:35 UTC](https://discourse.nodered.org/t/sending-firebase-cloud-messages-via-node-red-contrib-fcm-push-node/22165/3 "2020-03-09T21:35:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
