wangriyu / Huawei-push

Huawei Android Push Node Server SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

huawei-push

华为 Android 推送服务 Node 实现版

官方未提供 Node 版的 SDK, 此 SDK 依照官方文档 华为推送服务 Server 端SDK (HuaweiPushServiceSDK for server)实现.

目前只实现 Android 通知栏推送功能,其他实现以后补充,欢迎提 PR。

此项目根据 xiaomi-push 改写而成。

支持的特性

  • Palload: 用于构建要发送的消息内容
  • Notification: 通知栏推送相关

示例

const HWPush = require('./Huawei-push')
const Payload = HWPush.Payload
const Notification = HWPush.Notification

var payload = new Payload();
payload
  .title(config.title)
  .content(config.content)
  .appPkgName(config.appPkgName)
  .icon(config.icon)
  .customize([{"aa":"aaa"},{"bb":"bbb"}])

var notification = new Notification({
  appId: 'your appId',
  appSecret: 'your appSecret'
});
notification.send('your device token', payload, config.callback);

使用示例可以参看example.

API说明

请参考 华为推送服务 Server 端SDK (HuaweiPushServiceSDK for server)

参考: huawei-push.

About

Huawei Android Push Node Server SDK

License:MIT License


Languages

Language:JavaScript 100.0%