How to Send Firebase Cloud Massage using Database Trigger and MongoDB Functions

I want full code by using which i can send firebase cloud massage with data from document in massage.
When Data is inserted i want to send FCM to all users of my app.
Eg. if any user inserts a request for something then i want to send notifications to all user about it with his request data from mongodb document.

1 Like

I have the same issue,
Any news about it?

// Construct message
const message = {
“to”: “”,
“notification”: {
“title”: “Title for Notification”,
“body”: “Description of your notification”
}
};

// Send push notification
const gcm = context.services.get(‘gcm’);
const result = gcm.send(message);

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