Created
February 18, 2018 20:21
-
-
Save hiranya911/4d9d91a34e6be2e2a391bfd7bec882a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const admin = require('firebase-admin'); | |
| admin.initializeApp(); | |
| const message = { | |
| notification: { | |
| title: 'EPA fuel economy stats for new Mazda6', | |
| body: 'New turbo charged 2.5L engine does 23/31/36 mpg.', | |
| }, | |
| condition: `'auto-news' in topics && 'green-earth' in topics`, | |
| }; | |
| admin.messaging().send(message) | |
| .then((resp) => { | |
| console.log('Message sent successfully:', resp); | |
| }).catch((err) => { | |
| console.log('Failed to send the message:', err); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment