I’m trying to send notifications based on business logic that runs (on nodejs) on my server via a cron. Issue Notifications aren’t appearing on the device. Description I’m using the firebase admin node package. My code looks something like this My log output is something like this Everything I’m seeing suggests this should be sent! Answer sendMulticast and the Admin
Tag: firebase-cloud-messaging
Node.js: The registration token is not a valid FCM registration token
I am developing a Flutter mobile app. From my Nodejs backend, I am trying to send FCM Notifications to the app. I downloaded the private key file from firebase console’s project settings. Below is my Nodejs code. Below is the content in my service-account.json file In my Flutter app, below is how I get the FCM Token. When I run
FCM sent to “/topics/all” is not received
I have tried sending the FCM notification using the code below I am not receiving the notification in my browser when send the message “to”: /topics/all However if I am sending the message with “to”: my registration token, I am receiving the notification. Can some one tell me why this is happening. I understand that the message sent to /topics/all
How to use template literal in Firebase Cloud Function condition
Is it possible to use template literal in message condition of Firebase Cloud Function? I tried the following but it is not working. I changed to this but it is still not working: I get “Error: Invalid condition expression provided.” Answer Don’t forget to add single quotes around topics:
How to get FCM token?
I am trying to get FCM token in react js application. First thing i tried is to use messaging.useServiceWorker(registration) then use messaging.getToken() and it’s working fine on localhost for firefox and google chrome, but on an HTTPS live server it works fine on firefox but in chrome it throws an error: DOMException: Failed to execute ‘subscribe’ on ‘PushManager’: Subscription failed
Firebase Cloud Functions for Firestore are not triggering
Cannot get Firebase Cloud Functions for Firestore to trigger on onWrite of my collection. Trying to setup device to device push notification for chat app. Function is deployed and on Pay as you go plan, however, changes in document, updates or create in “chats” collection is not triggering. Firebase cloud messaging is supposed to send a push and write to
How to send FCM notification to all android devices using Node.js
I want to send the notification to my Android app developed using Ionic t from Node.Js code. I have tried following code and getting Exactly one of topic, token or condition is required. How can I send notification all my users without any condition? Answer If you want to send a notification to all users, then the best thing is