Skip to content

Commit

Permalink
Merge branch 'V3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hevin committed Oct 10, 2017
2 parents 38e5e1d + 2aa4bcd commit dc16b0e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JMessage PhoneGap / Cordova Plugin

[![release](https://img.shields.io/badge/release-3.0.17-blue.svg)](https://github.com/jpush/jmessage-phonegap-plugin/releases)
[![release](https://img.shields.io/badge/release-3.0.18-blue.svg)](https://github.com/jpush/jmessage-phonegap-plugin/releases)
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-green.svg)](https://github.com/jpush/jmessage-phonegap-plugin)
[![Code Triagers Badge](https://www.codetriage.com/jpush/jmessage-phonegap-plugin/badges/users.svg)](https://www.codetriage.com/jpush/jmessage-phonegap-plugin)
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jmessage-phonegap-plugin",
"version": "3.0.17",
"version": "3.0.18",
"description": "JMessage Cordova Plugin.",
"cordova": {
"id": "jmessage-phonegap-plugin",
Expand Down
10 changes: 8 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="jmessage-phonegap-plugin"
version="3.0.17">
version="3.0.18">

<name>JMessage</name>
<description>集成极光 IM 和推送功能</description>
Expand Down Expand Up @@ -151,6 +151,12 @@
</intent-filter>
</receiver>

<!-- since 3.0.9 Required SDK 核心功能-->
<provider
android:authorities="$PACKAGE_NAME.DataProvider"
android:name="cn.jpush.android.service.DataProvider"
android:exported="true" />

<meta-data android:name="JPUSH_APPKEY" android:value="$APP_KEY"/>
<meta-data android:name="JPUSH_CHANNEL" android:value="developer-default"/>
</config-file>
Expand All @@ -160,4 +166,4 @@
<source-file src="src/android/JMessageUtils.java" target-dir="src/cn/jiguang/cordova/im"/>
<source-file src="src/android/JsonUtils.java" target-dir="src/cn/jiguang/cordova/im"/>
</platform>
</plugin>
</plugin>
7 changes: 3 additions & 4 deletions src/android/JMessagePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ void setNoDisturb(JSONArray data, final CallbackContext callback) {
try {
JSONObject params = data.getJSONObject(0);
String type = params.getString("type");
final int isNoDisturb = params.getBoolean("isNoDisturb") ? ERR_CODE_PARAMETER : 0;
final int isNoDisturb = params.getBoolean("isNoDisturb") ? 1 : 0; // 1: 设置为免打扰;0: 取消设置。

if (type.equals("single")) {
String username = params.getString("username");
Expand Down Expand Up @@ -1179,9 +1179,8 @@ public void gotResult(int status, String desc, List userInfoList, List groupInfo
void setNoDisturbGlobal(JSONArray data, final CallbackContext callback) {
try {
JSONObject params = data.getJSONObject(0);
int isNoDisturbGlobal = params.getBoolean("isNoDisturb") ? ERR_CODE_PARAMETER : 0;
int isNoDisturbGlobal = params.getBoolean("isNoDisturb") ? 1 : 0; // 1: 设置为免打扰;0: 取消设置。
JMessageClient.setNoDisturbGlobal(isNoDisturbGlobal, new BasicCallback() {

@Override
public void gotResult(int status, String desc) {
handleResult(status, desc, callback);
Expand Down Expand Up @@ -1746,4 +1745,4 @@ private void eventSuccess(JSONObject value) {
pluginResult.setKeepCallback(true);
mCallback.sendPluginResult(pluginResult);
}
}
}
2 changes: 1 addition & 1 deletion src/android/JMessageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static MessageSendingOptions toMessageSendingOptions(JSONObject json) throws JSO
}

if (json.has("notificationTitle") && !json.isNull("notificationTitle")) {
messageSendingOptions.setNotificationText(json.getString("notificationTitle"));
messageSendingOptions.setNotificationTitle(json.getString("notificationTitle"));
}

if (json.has("notificationText") && !json.isNull("notificationText")) {
Expand Down
2 changes: 1 addition & 1 deletion www/JMessagePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ var JMessagePlugin = {
},
/**
* 添加点击通知栏消息通知事件监听。
* Note: Android only, (如果想要 iOS 端 实现相同的功能,需要同时集成 jpush-phonegap-plugin)
* Note: Android only, (如果想要 iOS 端实现相同的功能,需要同时集成 jpush-phonegap-plugin)
* @param {function} listener = function (message) {} // 以参数形式返回消息对象。
*/
addClickMessageNotificationListener: function (listener) {
Expand Down

0 comments on commit dc16b0e

Please sign in to comment.