fcm-reminder
v1.0.4
Published
A simple package to send reminder using firebase cloud messaging
Downloads
18
Maintainers
Readme
fcm-reminder
A package for sending reminders using Firebase Cloud Messaging
Installation
You should have Node.js installed in your system
Using npm
$ npm install fcm-reminder
Using yarn
$ yarn add fcm-reminder
Importing
// Using Node.js `require()`
const FCMReminder = require("fcm-reminder");
Overview
const serviceAccount = require("path_to_firebase_config_file");
const FCM_DB_URL = `<Firebase_DB_URL>`;
const regToken = `<FCM token of the device to which the reminder is to be sent>`;
const timestamp = `<Time at which the reminder is to be sent>`;
const messageData = `<A json which will be sent to the device as a notification>`;
FCMReminder.FCMReminder(
serviceAccount,
FCM_DB_URL,
regToken,
timestamp,
messageData
);
Note:
timestamp
should be in ISO-8601 and the format is:YYYY-MM-DDTHH:mm:ss.sssZ
Example of messageData:
messageData: {
title: "Reminder";
}