enterprise 3.0

This commit is contained in:
hrxiang 2023-07-13 17:21:44 +08:00
parent cdb994d5e3
commit 3527c80e7b
2 changed files with 6 additions and 3 deletions

View File

@ -19,13 +19,15 @@ public class OnBaseListener implements Base {
@Override
public void onError(int l, String s) {
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
String threadName = Thread.currentThread().getName();
Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
CommonUtil.runMainThreadReturnError(result, l, s, null);
}
@Override
public void onSuccess(String s) {
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onSuccess: " + s);
String threadName = Thread.currentThread().getName();
Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " method: 【 " + call.method + " 】, onSuccess: " + s);
CommonUtil.runMainThreadReturn(result, s);
}
}

View File

@ -33,6 +33,7 @@ public class CommonUtil {
}
public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
String threadName = Thread.currentThread().getName();
runMainThread(() -> {
Map<String, Object> res = new ArrayMap<>();
if (null != type) {
@ -47,7 +48,7 @@ public class CommonUtil {
if (null != errMsg) {
res.put("errMsg", errMsg);
}
Log.i("F-OpenIMSDK(native call flutter)", "{ method:" + method + ", type:" + type + " }");
Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " { method:" + method + ", type:" + type + " }");
FlutterOpenimSdkPlugin.channel.invokeMethod(method, res);
});
}