fwp

fcm-web-push

A node.js library for Firebase Cloud Messaging (Web Push)

Showing:

Popularity

Downloads/wk

2

GitHub Stars

4

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

1

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

fcm-web-push

Firebase Cloud Messaging (Web Push)

Getting started

npm i -S fcm-web-push

const FCMWP = require('fcm-web-push')
const FCM = new FCMWP()
FCM.setAuthKey('xxx')

Verify a user token

let token = 'xxx'
FCM.verifyToken(token)
        .then((verified) => {
            if (verified) {
               ...
            }
            else{
               ...
            }
        })
        .catch((err) => {
            console.log(err)
        })

Send notification

let tokens = ['xxx', 'xxx']
let notification = {
                        "title": "Title",
                        "body": "Description",
                        "click_action": "action url",
                        "icon": "icon url"
                    }
FCM.sendNotification(tokens, notification)
            .then((success) => {
                if (success) {
                   ...
                }
                else{
                   ...
                }
            })
            .catch((err) => console.log(err))

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial