fcm-call

2.0.0 • Public • Published

Firebase Cloud Messaging

This package allows you to send notifications to your android device.

Example

let FCM = require('FCM');
const serverKey = '<Your Server Key>'; 
const referenceKey = '<Your reference key>'; //Device Key
let title = '<Your notification title here.>';
let message = '<Your message here>';

FCM.FCM(serverKey, referenceKey, title, message);

From the above code, you can easily send PushNotification to your dedicated Device easily. :)

You can also pass json inside message.

let FCM = require('FCM');
const serverKey = '<Your Server Key>';
message = { 
            "to": '<Your reference key>',
            "notification": {
                "title": '<Your Title>', 
                "body": '<Your Body>',
                "sound": true,
                "alert": true,
            }
FCM.FCM(serverKey, message);

This aslo will give you a same result. As well as you can also customise notification using it.

Happy Notification! :)

Package Sidebar

Install

npm i fcm-call

Weekly Downloads

122

Version

2.0.0

License

MIT

Unpacked Size

2.69 kB

Total Files

3

Last publish

Collaborators

  • mayurchhapra