mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-03-17 06:21:05 +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 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||||
[]()
|
[]()
|
||||||
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||||
[](https://github.com/jpush/jpush-phonegap-plugin)
|
[](https://github.com/jpush/jpush-phonegap-plugin)
|
||||||
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||||
|
|
||||||
@ -17,16 +17,23 @@
|
|||||||
|
|
||||||
- 通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:
|
- 通过 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 安装:
|
- 或直接通过 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
|
## Usage
|
||||||
### API
|
### API
|
||||||
@ -96,7 +103,7 @@ cordova platform update ios
|
|||||||
## Support
|
## Support
|
||||||
- QQ 群:413602425
|
- QQ 群:413602425
|
||||||
- [JPush 官网文档](https://docs.jiguang.cn/jpush/guideline/intro/)
|
- [JPush 官网文档](https://docs.jiguang.cn/jpush/guideline/intro/)
|
||||||
<!-- - [极光社区](http://community.jiguang.cn/) -->
|
- [极光社区](http://community.jiguang.cn/)
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
Please contribute! [Look at the issues](https://github.com/jpush/jpush-phonegap-plugin/issues).
|
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") {
|
if(device.platform == "Android") {
|
||||||
alertContent = event.alert
|
alertContent = event.alert
|
||||||
} else {
|
} else {
|
||||||
lertContent = event.aps.alert
|
alertContent = event.aps.alert
|
||||||
}
|
}
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jpush-phonegap-plugin",
|
"name": "jpush-phonegap-plugin",
|
||||||
"version": "3.1.7",
|
"version": "3.1.8",
|
||||||
"description": "JPush for cordova plugin",
|
"description": "JPush for cordova plugin",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "jpush-phonegap-plugin",
|
"id": "jpush-phonegap-plugin",
|
||||||
@ -21,13 +21,9 @@
|
|||||||
"cordova-ios",
|
"cordova-ios",
|
||||||
"cordova-android"
|
"cordova-android"
|
||||||
],
|
],
|
||||||
"engines": [{
|
"devDependencies": {
|
||||||
"name": "cordova",
|
|
||||||
"version": ">=3.0"
|
|
||||||
}],
|
|
||||||
"dependencies": {
|
|
||||||
"cordova-plugin-device": "*",
|
"cordova-plugin-device": "*",
|
||||||
"cordova-plugin-jcore": "1.1.4"
|
"cordova-plugin-jcore": "*"
|
||||||
},
|
},
|
||||||
"author": "JiGuang",
|
"author": "JiGuang",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="jpush-phonegap-plugin"
|
id="jpush-phonegap-plugin"
|
||||||
version="3.1.7">
|
version="3.1.8">
|
||||||
|
|
||||||
<name>JPush</name>
|
<name>JPush</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<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
|
// Android methods
|
||||||
|
JPushPlugin.prototype.getConnectionState = function (successCallback) {
|
||||||
|
if (device.platform === 'Android') {
|
||||||
|
this.callNative('getConnectionState', [], successCallback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.setBasicPushNotificationBuilder = function () {
|
JPushPlugin.prototype.setBasicPushNotificationBuilder = function () {
|
||||||
if (device.platform === 'Android') {
|
if (device.platform === 'Android') {
|
||||||
this.callNative('setBasicPushNotificationBuilder', [], null)
|
this.callNative('setBasicPushNotificationBuilder', [], null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user