1.0.33 • Published 10 months ago

firebase-fcm v1.0.33

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

About The Package

It a wrapper package of firebase push notification REST api. It can be used with ES5 and upper versions as well as with Typescript and Nest.js.

Built With

This package use following third party packages.

Axios Dotenv

Installation

Follow the steps to install and configure the package.

Step 1 - Install the package

npm install firebase-fcm

Step 2 - Configure server key Add environment variable in .env | .env.local | .env.development | .env.production

FIREBASE_SERVER_KEY="server-key"

or, configure in your code manually.

FirebaseFCM.config("server-key");

Usage

Import the package

If you use require for importing.

  const FirebaseFCM = require("firebase-fcm").default;

If you use import for importing.

  import FirebaseFCM from "firebase-fcm";

Send notification on single device.

  const response = await FirebaseFCM.sendOnMultiDevice(
    'token', 
    'title',
    'subject',
    'image-url',
    {}
  );
  console.log(response);

Send notification on multiple device.

  const response = await FirebaseFCM.sendOnSingleDevice(
    ['token1', 'token2'], 
    'title',
    'subject',
    'image-url',
    {}
  );
  console.log(response);
1.0.33

10 months ago

1.0.32

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.26

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.22

10 months ago

1.0.21

10 months ago

1.0.20

10 months ago

1.0.19

10 months ago

1.0.18

10 months ago

1.0.17

10 months ago

1.0.16

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago