mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 22:55:02 +08:00
Merge remote-tracking branch 'jpush/master'
This commit is contained in:
commit
2fc0bc9213
17
README.md
17
README.md
@ -2,7 +2,7 @@
|
||||
|
||||
[![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||
[![QQ Group](https://img.shields.io/badge/QQ%20Group-413602425-red.svg)]()
|
||||
[![release](https://img.shields.io/badge/release-3.1.7-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||
[![release](https://img.shields.io/badge/release-3.1.8-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin)
|
||||
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||
|
||||
@ -17,16 +17,23 @@
|
||||
|
||||
- 通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:
|
||||
|
||||
cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
|
||||
```
|
||||
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 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
|
||||
```
|
||||
cordova plugin add Your_Plugin_Path --variable APP_KEY=your_jpush_appkey
|
||||
```
|
||||
|
||||
> 如果你的 Cordova 版本 >= v7.0.0,在安装插件和添加 platform 时,在命令行最后加上 --nofetch,否则极大可能会报错。
|
||||
|
||||
## Usage
|
||||
### API
|
||||
@ -96,7 +103,7 @@ cordova platform update ios
|
||||
## Support
|
||||
- QQ 群:413602425
|
||||
- [JPush 官网文档](https://docs.jiguang.cn/jpush/guideline/intro/)
|
||||
<!-- - [极光社区](http://community.jiguang.cn/) -->
|
||||
- [极光社区](http://community.jiguang.cn/)
|
||||
|
||||
## Contribute
|
||||
Please contribute! [Look at the issues](https://github.com/jpush/jpush-phonegap-plugin/issues).
|
||||
|
@ -223,7 +223,7 @@ window.plugins.jPushPlugin.setTagsWithAlias([tag1, tag2], alias1, function () {
|
||||
if(device.platform == "Android") {
|
||||
alertContent = event.alert
|
||||
} else {
|
||||
lertContent = event.aps.alert
|
||||
alertContent = event.aps.alert
|
||||
}
|
||||
}, false)
|
||||
|
||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jpush-phonegap-plugin",
|
||||
"version": "3.1.7",
|
||||
"version": "3.1.8",
|
||||
"description": "JPush for cordova plugin",
|
||||
"cordova": {
|
||||
"id": "jpush-phonegap-plugin",
|
||||
@ -21,13 +21,9 @@
|
||||
"cordova-ios",
|
||||
"cordova-android"
|
||||
],
|
||||
"engines": [{
|
||||
"name": "cordova",
|
||||
"version": ">=3.0"
|
||||
}],
|
||||
"dependencies": {
|
||||
"devDependencies": {
|
||||
"cordova-plugin-device": "*",
|
||||
"cordova-plugin-jcore": "1.1.4"
|
||||
"cordova-plugin-jcore": "*"
|
||||
},
|
||||
"author": "JiGuang",
|
||||
"license": "MIT",
|
||||
|
@ -2,7 +2,7 @@
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
id="jpush-phonegap-plugin"
|
||||
version="3.1.7">
|
||||
version="3.1.8">
|
||||
|
||||
<name>JPush</name>
|
||||
<description>JPush for cordova plugin</description>
|
||||
|
@ -458,6 +458,11 @@ public class JPushPlugin extends CordovaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
void getConnectionState(JSONArray data, CallbackContext callback) {
|
||||
boolean isConnected = JPushInterface.getConnectionState(cordovaActivity.getApplicationContext());
|
||||
callback.success(String.valueOf(isConnected));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义通知行为,声音、震动、呼吸灯等。
|
||||
*/
|
||||
|
@ -208,6 +208,12 @@ JPushPlugin.prototype.addNotificationActions = function (actions, categoryId) {
|
||||
}
|
||||
|
||||
// Android methods
|
||||
JPushPlugin.prototype.getConnectionState = function (successCallback) {
|
||||
if (device.platform === 'Android') {
|
||||
this.callNative('getConnectionState', [], successCallback)
|
||||
}
|
||||
}
|
||||
|
||||
JPushPlugin.prototype.setBasicPushNotificationBuilder = function () {
|
||||
if (device.platform === 'Android') {
|
||||
this.callNative('setBasicPushNotificationBuilder', [], null)
|
||||
|
Loading…
Reference in New Issue
Block a user