Skip to content

Instantly share code, notes, and snippets.

@n1lesh
Created December 23, 2017 09:05
Show Gist options
  • Save n1lesh/2fc47c6d945cc83a9bf928289eb6e23a to your computer and use it in GitHub Desktop.
Save n1lesh/2fc47c6d945cc83a9bf928289eb6e23a to your computer and use it in GitHub Desktop.
Firebase Cloud Messaging with Node.js - FCM 4
const sendToTopics = (msg, title, topic, response) => {
const data = {
"data": {
"body": msg,
"title": title
}
}
data['to'] = '/topics/' + topic
sendNotifications(data)
response.sendStatus(200)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment