New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

push-huawei

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

push-huawei

push-huawei

  • 0.1.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

push-huawei

华为推送Node服务

根据华为提供的推送服务实现的 Node 版SDK。支持华为通知栏推送功能,欢迎大家使用。

小米推送

魅族推送

oppo推送

友盟推送

ios推送

安装

npm install push-huawei --save-dev

实例

const Huawei = require('push-huawei');
const huawei = new Huawei({
  appId: 'appId',
  appSecret: 'appSecret',
  appPkgName: '应用包名'
});

huawei.push({
  title: '标题',
  content: '内容',
  list: ['pushId'], 
  sleep: 0, // 请求间隔时间/毫秒
  extras: {
    // ... 额外信息
  },
  success(res){}, // 成功回调
  error(err){}, // 失败回调
  finish(){} // 所有请求回调
});

因为华为api最多支持100台机器推送,如果 list 长度超过100,则内部会发起 Math.ceil(n / 100) 条请求, 同时也会有 Math.ceil(n / 100) 条回调。

参数

keyvalue
appIdappID
$appSecretappSecret
appPkgName应用包名
getTokenUrl获取token URL 默认 https://login.cloud.huawei.com/oauth2/v2/token
pushUrl推送URL 默认 https://api.push.hicloud.com/pushsend.do
grant_type华为接口参数 默认 'grant_type'
nsp_svc华为接口参数 默认 'openpush.message.api.send'
maxLength华为推送限制长度 默认100

华为官方文档

Keywords

FAQs

Package last updated on 12 Jun 2020

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