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

cordova-plugin-tpns

v1.0.8

Published

tpns cordova plugin

Downloads

4

Readme

cordova-plugin-tpns

腾讯移动推送 TPNS cordova 插件

支持平台

Android

安装插件

1、通过npm 安装插件

cordova plugin add cordova-plugin-tpns

2、通过本地文件路径安装

cordova plugin add 文件路径

说明: ionic 项目命令前加上ionic,即ionic cordova plugin xxxxx

API接口和使用示例

1、注册

cordova.plugins.TPNSPlugin.registerXG("registerXG",onSuccess,onFail);

2、取消注册

cordova.plugins.TPNSPlugin.unregisterXG("unregisterXG",onSuccess,onFail);

3、开启调试

var params = {
       message : "enableDebug",
       enableDebug : true
   };
cordova.plugins.TPNSPlugin.enableDebug(params,onSuccess,onFail);

4、设置账号

var params = {
    message : "setAccount",
    accountInfos : [{"account":"elva", "accountType":1002}, {"account":"jay", "accountType":1003}]
};
cordova.plugins.TPNSPlugin.setAccount(params,onSuccess,onFail);

5、删除账号

var params = {
       message : "deleteAccount",
       accountType : "1003,1002"
   };
cordova.plugins.TPNSPlugin.deleteAccount(params,onSuccess,onFail);

6、清除账号

var params = {
    message : "clearAccounts",
    accountType : "1003,1002"
};
cordova.plugins.TPNSPlugin.clearAccounts(params,onSuccess,onFail);

7、新增标签

 var params = {
       message : "addTags",
       tags : "d,e,f"
   };
cordova.plugins.TPNSPlugin.addTags(params,onSuccess,onFail);

8、设置标签

 var params = {
     message : "setTags",
     tags : "a,b,c"
 };
cordova.plugins.TPNSPlugin.setTags(params,onSuccess,onFail);

9、清除标签

var params = {
       message : "clearTags",
       tags : "a,b,c"
   };
cordova.plugins.TPNSPlugin.clearTags(params,onSuccess,onFail);

10、开启第三方推送

var params = {
    message : "enableOtherPush",
    enableOtherPush : true
};
cordova.plugins.TPNSPlugin.enableOtherPush(params,onSuccess,onFail);

11、设置小米推送AppId

var params = {
         message : "setMiPushAppId",
         appId : "miAppId"
     };
cordova.plugins.TPNSPlugin.setMiPushAppId(params,onSuccess,onFail);

12、设置小米推送AppKey

 var params = {
         message : "setMiPushAppKey",
         appId : "miAppKey"
     };
 cordova.plugins.TPNSPlugin.setMiPushAppKey(params,onSuccess,onFail);

13、设置魅族推送AppId

var params = {
         message : "setMzPushAppId",
         appId : "mzAppId"
     };
cordova.plugins.TPNSPlugin.setMzPushAppId(params,onSuccess,onFail);

14、设置魅族推送AppKey

 var params = {
         message : "setMzPushAppKey",
         appId : "mzAppKey"
     };
 cordova.plugins.TPNSPlugin.setMzPushAppKey(params,onSuccess,onFail);

15、开启Oppo通知

var params = {
        message : "enableOppoNotification",
        enableOppoNotification : true
    };
cordova.plugins.TPNSPlugin.enableOppoNotification(params,onSuccess,onFail);

16、设置Oppo推送AppId

var params = {
         message : "setOppoPushAppId",
         appId : "oppoAppId"
     };
cordova.plugins.TPNSPlugin.setOppoPushAppId(params,onSuccess,onFail);

17、设置Oppo推送AppKey

 var params = {
         message : "setOppoPushAppKey",
         appId : "oppoAppKey"
     };
 cordova.plugins.TPNSPlugin.setOppoPushAppKey(params,onSuccess,onFail); 

项目AccessID和AccessKey配置

在项目的platforms/android/app/build.gradle文件中配置accessID和AccessKey

android {
  defaultConfig {
    manifestPlaceholders = [
            XG_ACCESS_ID : "1500045345",
            XG_ACCESS_KEY : "fgTNBfgSU",
    ]
	}
}

注意事项

由于TPNS包的仓库从jecenter迁移到Maven,为顺利拉取到依赖包,需在app的build.gradle配置文件中allprojects结点下的repositories中配置mavenCentral()仓库。

allprojects {
    repositories {
        mavenCentral()
    }
}