Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80a8fab891 | ||
|
|
ea82c50d79 | ||
|
|
70423d9756 | ||
|
|
a8942269b4 |
@@ -63,12 +63,16 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler,
|
||||
|
||||
@Override
|
||||
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
|
||||
if(isInitialized){
|
||||
return;
|
||||
}
|
||||
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), CHANNEL_NAME);
|
||||
context = flutterPluginBinding.getApplicationContext();
|
||||
channel.setMethodCallHandler(this);
|
||||
connectivityListener = new ConnectivityListener(context);
|
||||
visibilityListener = new VisibilityListener();
|
||||
connectivityListener.register();
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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: ");
|
||||
}
|
||||
|
||||
@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");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ A new Flutter project.
|
||||
|
||||
#s.ios.vendored_frameworks = 'frameworks/*.xcframework'
|
||||
#s.vendored_frameworks = 'frameworks/*.xcframework'
|
||||
s.dependency 'openim_sdk_core_ios','0.0.1'
|
||||
s.dependency 'openim_sdk_core_ios','0.2.0'
|
||||
s.static_framework = true
|
||||
s.library = 'resolv'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user