Socket
Socket
Sign inDemoInstall

cordova-huawei-push2

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-huawei-push2

Cordova huawei Push Plugin


Version published
Maintainers
1
Install size
355 kB
Created

Readme

Source

cordova-huawei-push

The huawei push for cordova, hms sdk version, now only support android.

Install

cordova plugin add cordova-huawei-push --variable APPID=YOURAPPID --variable  PACKAGENAME=YOURPACKAGENAME --save

How to use

Init the hms connection

cordova.plugins.huaweipush.init();

Token Registered

document.addEventListener('huaweipush.receiveRegisterResult', function (event) {
    console.log(event) // event will contain the device token value
}.bind(this), false);

You can get the token value by event.token

Stop the push service

cordova.plugins.huaweipush.stop();

When notification clicked to open the app

document.addEventListener('huaweipush.notificationOpened', function (event) {
    console.log(event) // the event will contain a extras key, which contain the data what you send
}.bind(this), false)

When push message arrived at the app open status

document.addEventListener('huaweipush.pushMsgReceived', function (event) {
    console.log(event) // the event will contain a extras key, which contain the data what you send
}.bind(this), false)

Keywords

FAQs

Last updated on 11 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc