Package Exports
- push-xiaomi
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (push-xiaomi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
push-xiaomi
小米推送Node服务
根据小米提供的推送服务实现的 Node 版SDK。支持小米通知栏推送功能,欢迎大家使用。
安装
npm install push-xiaomi --save-dev实例
const Xiaomi = require('push-xiaomi');
const xiaomi = new Xiaomi({
appId: 'appId',
appSecret: 'appSecret',
appPkgName: '应用包名'
});
xiaomi.push({
title: '标题',
content: '内容',
list: ['pushId'],
sleep: 0, // 请求间隔时间/毫秒
success(res){}, // 成功回调
error(err){}, // 失败回调
finish(){} // 所有请求回调
});参数
| key | value |
|---|---|
| appId | appID |
| $appSecret | appSecret |
| appPkgName | 应用包名 |
| pushUrl | 推送URL 默认 https://api.xmpush.xiaomi.com/v3/message/regid |
| ... | 详细参数看小米官方文档 |
const Xiaomi = require('push-xiaomi');
const xiaomi = new Xiaomi({
appId: 'appId',
appSecret: 'appSecret',
appPkgName: '应用包名'
});
xiaomi.query({
msg_id: [...msg_id] // 消息id
});