2019-04-22 16:56:02 +02:00
|
|
|
# With Firebase Cloud Messaging example
|
|
|
|
|
2018-11-25 16:37:34 +01:00
|
|
|
## How to run
|
|
|
|
|
|
|
|
Install it and run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm install
|
|
|
|
npm run build
|
|
|
|
npm run dev
|
|
|
|
```
|
|
|
|
|
|
|
|
## Set your send id
|
|
|
|
|
|
|
|
set your `messagingSenderId` in `static/firebase-messaging-sw.js` and `utils/webPush.js`
|
|
|
|
|
|
|
|
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
|
|
|
|
|
|
|
|
```bash
|
|
|
|
now
|
|
|
|
```
|
|
|
|
|
|
|
|
## How to send a notification
|
|
|
|
|
|
|
|
https://firebase.google.com/docs/cloud-messaging/js/first-message,
|
|
|
|
|
|
|
|
## The idea behind the example
|
|
|
|
|
|
|
|
To demo how to implement firebase cloud messaging to send web push notification in next.js.
|