Skip to content

Commit b6fe921

Browse files
committed
fix android hot reload bugs.
1 parent 37eaee9 commit b6fe921

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

android/src/main/java/com/easemob/im_flutter_sdk/EMClientWrapper.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,19 @@ private void kickAllDevices(JSONObject param, String channelName, Result result)
278278

279279
}
280280

281+
private EMOptions options = null;
281282
private void init(JSONObject param, String channelName, Result result) throws JSONException {
282-
EMOptions options = EMOptionsHelper.fromJson(param, this.context);
283+
if (options != null) {
284+
onSuccess(result, channelName, null);
285+
return;
286+
}
287+
options = EMOptionsHelper.fromJson(param, this.context);
283288
EMClient.getInstance().init(this.context, options);
284289
EMClient.getInstance().setDebugMode(param.getBoolean("debugModel"));
285290

286291
bindingManagers();
287292
registerEaseListener();
288293
onSuccess(result, channelName, null);
289-
290294
}
291295

292296
private void renewToken(JSONObject param, String channelName, Result result) throws JSONException {

0 commit comments

Comments
 (0)