npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ys-cordova-huawei-hms

v2.6.2

Published

Cordova huawei PushPay Plugin

Downloads

3

Readme

华为推送 HMS SDK,由于华为应用市场审核应用必须使用最新版的hms sdk,为方便区分,插件版本与HMS SDK版本号保持一致。

(注:原作者的插件一年前已停止更新,旧版插件无法通过华为应用市场审核,请使用本分支的插件)

更新于2018年6月28号

cordova-huawei-hms

华为推送cordova插件,目前仅适配安卓手机

安装

cordova plugin add https://github.com/waitaction/cordova-huawei-hms.git --variable APPID=YOURAPPID --variable  PACKAGENAME=YOURPACKAGENAME --variable cpid=YOURCPID

例如cordova plugin add https://github.com/waitaction/cordova-huawei-hms.git --variable APPID=10111111 --variable PACKAGENAME=com.lifang123.www --variable cpid=350841385123

怎么用

初始 hms 连接

cordova.plugins.huaweipush.init();

获取设备token

document.addEventListener('huaweipush.receiveRegisterResult', function (event) {
    console.log(event) // 设备token包含在event对像
}.bind(this), false);

你可以使用 event.token 获取到设备token

停止推送服务

cordova.plugins.huaweipush.stop();

接收到推送通知时,点击通知栏打开应用后会触发下面的事件

document.addEventListener('huaweipush.notificationOpened', function (event) {
    console.log(event) // event包含了你自定义的额外字段的数据
}.bind(this), false)

接收透传通知

document.addEventListener('huaweipush.pushMsgReceived', function (event) {
    console.log(event) // event包含了你自定义的额外字段的数据
}.bind(this), false)

尽早定义事件

document.addEventListener事件要尽早定义,在调用cordova.plugins.huaweipush.init()之前.

    <html>
    <head>...</head>
    <body>
    <script>
        document.addEventListener('huaweipush.receiveRegisterResult', function (event) {
            console.log(event) // 设备token包含在event对像
        }.bind(this), false);
    
        document.addEventListener('huaweipush.notificationOpened', function (event) {
            console.log(event) // event包含了你自定义的额外字段的数据
        }.bind(this), false)
    
        document.addEventListener('huaweipush.pushMsgReceived', function (event) {
            console.log(event) // event包含了你自定义的额外字段的数据
        }.bind(this), false)
    </script>
    <div>内容</div>
    </body>
    </html>