Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/igor-adlab/hemera-fcm
Hemera plugin for Google FCM
https://github.com/igor-adlab/hemera-fcm
fcm firebase hemera typescript
Last synced: about 1 month ago
JSON representation
Hemera plugin for Google FCM
- Host: GitHub
- URL: https://github.com/igor-adlab/hemera-fcm
- Owner: Igor-Adlab
- Created: 2017-12-18T22:55:57.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-19T21:29:29.000Z (about 7 years ago)
- Last Synced: 2024-11-07T03:49:21.253Z (about 2 months ago)
- Topics: fcm, firebase, hemera, typescript
- Language: TypeScript
- Size: 49.8 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hemera FCM
Plugin for Firebase Cloud Messaging## Examples
### Setup
```javascript
const FCM = require('hemera-fcm');
// Code...
hemera.use(FCM, { credentials: require('./google-services') });
```### Send notification
```javascript
hemera.act({
cmd: "CMD_SEND_DEVICE" || "CMD_SEND_TOPIC" || "CMD_SEND_GROUP",
topic: "TOPIC_FCM",
id: ["id-1", "id-2", "..."],
payload: {
data: {},
notification: {
title: "...",
body: "...",
},
},
}, function() {})
```
### Subscribe / Unsubscribe to chanel
```javascript
hemera.act({
cmd: "CMD_SUBSCRIBE" || "CMD_UNSUBSCRIBE",
topic: "TOPIC_FCM",
payload: {
client: "...",
topic: "...",
},
}, function() {})
```