Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
jpush-phonegap-plugin
Advanced tools
支持 iOS, Android 的 Cordova 推送插件。
如需要 IM 功能的插件,可关注 jmessage-phonegap-plugin。
集成 JPush PhoneGap Plugin 有两种方法:
通过 Cordova Plugins 安装,要求 PhoneGap/Cordova CLI 5.0+:
cordova plugin add jpush-phonegap-plugin --variable API_KEY=your_jpush_appkey
直接通过 url 安装:
cordova plugin add https://github.com/jpush/jpush-phonegap-plugin.git --variable API_KEY=your_jpush_appkey
使用 git 命令将 JPush PhoneGap 插件下载的本地,目录标记为 $JPUSH_PLUGIN_DIR:
git clone https://github.com/jpush/jpush-phonegap-plugin.git
cordova plugin add $JPUSH_PLUGIN_DIR --variable API_KEY=your_jpush_appkey
插件项目中包含一个简单的 Demo。若想参考,可以在 /example 文件夹内找到并拷贝以下文件:
src/example/index.html -> www/index.html
src/example/css/* -> www/css
src/example/js/* -> www/js
该项目基于 Cordova 实现,目前无法使用 PhoneGap build 云服务进行打包,建议使用本地环境进行打包。
插件的 API 在 JPushPlugin.js 文件中,该文件的具体位置如下:
[Project]/assets/www/plugins/cn.jpush.phonegap.JPushPlugin/www
[Project]/www/plugins/cn.jpush.phonegap.JPushPlugin/www
若要使用 CLI 来编译项目,注意应使用 cordova compile 而不是 cordova build 命令,因为如果修改了插件安装时默认写入到 AndroidManifest.xml 中的代码,cordova build 可能会导致对 AndroidManifest.xml 的修改。 Cordova CLI 的具体用法可参考 Cordova CLI 官方文档。
Eclipse 中 import PhoneGap 工程之后出现:Type CallbackContext cannot be resolved to a type。
解决方案:Eclipse 中右键单击工程名,Build Path -> Config Build Path -> Projects -> 选中工程名称 -> CordovaLib -> 点击 add。
收不到推送: 请首先按照正确方式再次配置证书、描述文件,具体可参考 iOS 证书设置指南。
设置 PushConfig.plist:
如有问题可访问极光社区。
FAQs
JPush for cordova plugin
The npm package jpush-phonegap-plugin receives a total of 35 weekly downloads. As such, jpush-phonegap-plugin popularity was classified as not popular.
We found that jpush-phonegap-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.