New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

jpusher

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jpusher

JPush API caller for node.js.

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

JPush API Caller for node.js

极光推送自用API,供node.js。

Usage

npm install jpusher

Example

var JPusher = require("jpusher");

var jPusher = JPusher.createPusher(APP_KEY, API_MASTER_SECRET);
var param = JPusher.createParam(parseInt(Date.now() / 1000));

param.setReceiverType(JPusher.ReceiverType.RT_TAG);
param.addReceivers([ "tag3", "tag4" ]);
jPusher.push(param, "我是消息。", function(err, msgId) {
    if(err) {
        console.log(err);
    } else {
        console.log(msgId);
    }
});

Param Functions

  • setReceiverType: set the receiver type. (ReceiverType.RT_ALL, ReceiverType.RT_TAG, ReceiverType.RT_ALIAS, default to ALL)
  • addReceivers: add receivers. (param is an array)
  • setReceivers: set receivers. (param is an array)
  • setMsgType: set message type. (MsgType.MT_NOTIFICATION, MsgType.MT_CUSTOMIZE, default to NOTIFICATION)
  • setAndroidContent: set android custom content. (only when msgType is MT_CUSTOMIZE)
  • setIOSProperty: params are badge and sound.
  • setTitle: set message title. (default to app name)
  • setBuildId: set builder id. (default to 0, refer to http://docs.jpush.cn/pages/viewpage.action?pageId=557243)
  • setOverrideId: set override id. (default to null)
  • setTimeToLive: set time to live. (default to 86400)
  • setAPNsProduction: set APNs production. (APNsType.AT_DEVELOPMENT, APNsType.AT_PRODUCTION, APNsType.AT_DEFAULT, default to DEFAULT)
  • setPlatform: set platform array. (default to [ "android", "ios" ])
  • setDescription: set push description.

Keywords

jpush

FAQs

Package last updated on 11 Mar 2014

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