From 70423d9756efa88027ab083aa0e23b338f3eb130 Mon Sep 17 00:00:00 2001 From: cpdl Date: Thu, 5 Dec 2024 15:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flutter_openim_sdk/util/CommonUtil.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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"); + } + }); }); }