diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java b/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java index 91bff39..8602511 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java @@ -49,7 +49,25 @@ public class CommonUtil { res.put("errMsg", errMsg); } Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " { method:" + method + ", type:" + type + " }"); - FlutterOpenimSdkPlugin.channel.invokeMethod(method, res); + FlutterOpenimSdkPlugin.channel.invokeMethod(method, res, new MethodChannel.Result() { + @Override + public void success(Object result) { + // 处理成功返回值 + Log.i("F-OpenIMSDK(native call flutter)", "Method " + method + " returned: " + result.toString()); + } + + @Override + public void error(String errorCode, String errorMessage, Object errorDetails) { + // 处理错误 + Log.e("F-OpenIMSDK(native call flutter)", "Method " + method + " error: " + errorCode + ", " + errorMessage); + } + + @Override + public void notImplemented() { + // 处理未实现的方法 + Log.w("F-OpenIMSDK(native call flutter)", "Method " + method + " not implemented"); + } + }); }); }