Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

push-oppo

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

push-oppo

push-oppo

latest
Source
npmnpm
Version
0.0.9
Version published
Weekly downloads
15
200%
Maintainers
1
Weekly downloads
 
Created
Source

push-oppo

oppo推送Node服务

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

华为推送

小米推送

友盟推送

魅族推送

IOS推送

安装

npm install push-oppo --save-dev

实例

const Oppo = require('push-oppo');
const oppo = new Oppo({
  appKey: 'appKey',
  masterSecret: 'masterSecret'
});

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

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

参数

keyvalue
appIdappID
appSecretappSecret
appKeyappKey
masterSecretmasterSecret
getTokenUrl获取token URL 默认 https://api.push.oppomobile.com/server/v1/auth
saveMessageUrl推送URL 默认 https://api.push.oppomobile.com/server/v1/message/notification/save_message_content
pushUrl推送URL 默认 https://api.push.oppomobile.com/server/v1/message/notification/broadcast
maxLengthoppo推送限制长度 默认1000

oppo官方文档

Keywords

koa

FAQs

Package last updated on 23 Mar 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