Skip to content

Commit 3261013

Browse files
KenChoiKenChoi
authored andcommitted
add set debug mode
1 parent 132fb2b commit 3261013

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

android/src/io/jchat/android/Constant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.jchat.android;
22

33
public class Constant {
4-
4+
static final String ENABLE = "enable";
55
public static final String USERNAME = "username";
66
public static final String PASSWORD = "password";
77
public static final String OLD_PWD = "oldPwd";

android/src/io/jchat/android/JMessageModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ public void init(int mode) {
137137

138138
}
139139

140+
@ReactMethod
141+
public void setDebugMode(ReadableMap map) {
142+
try {
143+
boolean enable = map.getBoolean(Constant.ENABLE);
144+
JMessageClient.setDebugMode(enable);
145+
} catch (Exception e) {
146+
e.printStackTrace();
147+
}
148+
}
149+
140150
/**
141151
* 启动应用时判断登录状态
142152
*

0 commit comments

Comments
 (0)