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。
如需要短信验证码功能的插件,可关注 JSMS Cordova Plugin。
QQ 交流群:413602425。
通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:
cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
或直接通过 url 安装:
cordova plugin add https://github.com/jpush/jpush-phonegap-plugin.git --variable APP_KEY=your_jpush_appkey
或下载到本地安装:
cordova plugin add Your_Plugin_Path --variable APP_KEY=your_jpush_appkey
插件项目中包含一个简单的 Demo。若想参考,可以在 /example 文件夹内找到并拷贝以下文件:
example/index.html -> www/index.html
example/css/* -> www/css
example/js/* -> www/js
该项目基于 Cordova 实现,目前无法使用 PhoneGap build 云服务进行打包,建议使用本地环境进行打包。
右键单击工程名 -> Build Path -> Config Build Path -> Projects -> 选中工程名称 -> CordovaLib -> 点击 add。
Android 的推送通过长连接的方式实现,只有在连接保持的情况下才能收到通知。而有的第三方 ROM 会限制一般应用服务的自启动,也就是 在退出应用后,应用的所有服务均被杀死,且无法自启动,所以就会收不到通知。
目前 JPush 是做了应用互相拉起机制的,也就是当用户打开其他集成了 JPush 的应用时,你的应用也能同时收到推送消息。
如果你的应用希望随时都能收到推送,官方推荐是通过文案的方式引导用户在设置中允许你的应用能够自启动,常见机型的设置方法可以参考这里。
或者自己实现应用保活,网上有很多相关文章(不推荐)。
为什么 QQ、微信之类的应用退出后还能够收到通知?因为这些大厂应用,手机厂商默认都会加入自启动白名单中,也不会在应用退出后杀死它们的相关服务。 如果你多加留意,就会发现非大厂的应用如果你一段时间不用都是收不到推送的。
请首先按照正确方式再次配置证书、描述文件,具体可参考 iOS 证书设置指南。
按照以下步骤逐个尝试:
cordova platform add ios
,后使用 cordova plugin add
Please contribute! Look at the issues.
MIT © JiGuang
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.