Socket
Book a DemoInstallSign in
Socket

cordova-plugin-vivo-push

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-vivo-push

Vivo手机推送

1.0.0
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Vivo推送

Vivo手机推送

安装 cordova-plugin-vivo-push

 cordova plugin add cordova-plugin-vivo-push --variable  APP_KEY=YOUR_APP_KEY --variable APP_ID=YOUR_APP_ID

使用

使用前需注册,以获取 token ,你可以将 token 与你的app用户信息关联后上传到服务器

declare let VivoPush :any;
...
  // 注册推送
  VivoPush.register(function(token) {
      console.log(token);
      alert('register success:' + token);
  }, function(err) {
      console.log(err);
      alert('register fail:' + err);
  }, []);

// 接收token
VivoPush.onNewToken(function(token) {
    console.log(token); // 会多次接收到token
}, function(err) {
      console.log(err);
      alert('register fail:' + err);
});

注册完成后,需要监听 messageReceived 事件

document.addEventListener("messageReceived", function(result) {
    console.log(result);
}, false);

Keywords

ecosystem:cordova

FAQs

Package last updated on 17 Dec 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.