hemera-fcm
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Hemera FCM

Plugin for Firebase Cloud Messaging

Examples

Setup

const FCM = require('hemera-fcm');
// Code...
hemera.use(FCM, { credentials: require('./google-services') });

Send notification

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

hemera.act({
	cmd: "CMD_SUBSCRIBE" || "CMD_UNSUBSCRIBE",
	topic: "TOPIC_FCM",
	payload: {
		client: "...",
		topic: "...",
	},
}, function() {})

Readme

Keywords

Package Sidebar

Install

npm i hemera-fcm

Weekly Downloads

1

Version

0.0.1

License

ISC

Last publish

Collaborators

  • igor.olshevsky