Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firebase-messaging

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-messaging

Module to send firebase messages

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
338
increased by32.03%
Maintainers
1
Weekly downloads
 
Created
Source

firebase-messaging

npm

NodeJS module to send firebase messages

Install

npm install firebase-messaging

topic(topic, data, [, options, callback])

Send message to topic

message(to, data, [, options, callback])

Send message to device

Options

  • collapse_key [String]
  • priority [String]
  • time_to_live [Number]
  • delay_while_idle [Boolean]
  • notification [Object]

See Firebase Docs

Usage


const firebase = require("firebase-messaging");

var client = new firebase(CLOUD_MESSAGING_KEY);

var data = {
    title: "@Test",
    content: "@Content"
};

var options = {
	delay_while_idle : true	
};

client.topic("news", data, options, function(result){
	// request err or message id
	console.log(result);	
});

client.message(DEVICE_TOKEN, data);

Keywords

FAQs

Package last updated on 03 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc