README
JPush Node.js sdk
极光推送Node.js 服务端 sdk
v2 or v3
极光推送官网更新了v3 接口
http://docs.jpush.cn/display/dev/Push-API-v3
所以,本sdk 库也同步更新...对于v2 接口用0.1.x 版本 , v3 用0.3.x版本.
Usage
v2
npm install jpush@0.1
v3
npm install jpush
Example
Notification
var JPush = require('jpush');
var jpushClient = JPush.build({appkey: "you app key", masterSecret: "you master secret key"});
var body = 'Hi jpush nodejs sdk!';
jpushClient.pushNotification(body, function (err, result){
console.log(result);
})
Message
var JPush = require('jpush');
var jpushClient = JPush.build({appkey: "you app key", masterSecret: "you master secret key"});
var body = 'Hi jpush nodejs sdk!';
jpushClient.pushMessage(body, function (err, result) {
console.log(result);
})
更多例子去看test目录下的单元测试
Api Docs
该在线文档为jpush v2
在线API文档: ** http://blog.gfdsa.net/JPush-Node.js-sdk/ **
支持本项目
如果你觉得这个项目还不错,就请作者喝杯咖啡吧