Compare commits

..

15 Commits

Author SHA1 Message Date
std-s
57c4f06c86 [Update] 2023-08-11 15:36:06 +08:00
std-s
3c5e640abf [Update] Update the commercial version. 2023-08-01 10:36:34 +08:00
std-s
87360c5f69 [Update] aar & framework. 2023-07-25 16:59:21 +08:00
std-s
a4e7ae13ee [Update] aar. 2023-07-24 11:24:02 +08:00
std-s
2da3a5e557 [Fix] Adjust the monitoring function parameters for uploading files. 2023-07-24 11:23:46 +08:00
hrxiang
cfc94c06da 3.0-enterprise 2023-07-13 18:28:02 +08:00
hrxiang
3527c80e7b enterprise 3.0 2023-07-13 17:21:44 +08:00
hrxiang
cdb994d5e3 enterprise 3.0 2023-07-13 16:13:23 +08:00
hrxiang
e12799da0b putFile -> uploadFile 2023-07-12 20:28:15 +08:00
hrxiang
0c7124a2a5 Update error code 2023-07-12 16:35:35 +08:00
hrxiang
b1fa710117 Add regularly delete 2023-07-10 17:15:24 +08:00
hrxiang
b06dbe122e 3.0.0-enterprise
delete Organization and WorkMoments
2023-07-07 13:39:23 +08:00
hrxiang
021a262325 3.0.0-enterprise 2023-07-05 15:02:18 +08:00
hrxiang
9994a3939d 3.0.0-enterprise 2023-07-04 17:18:06 +08:00
hrxiang
c1f62d0661 3.0 enterprise 2023-07-04 15:06:22 +08:00
91 changed files with 7522 additions and 2445 deletions

View File

@@ -1,27 +1,25 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Dart SDK"> <library name="Dart SDK">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/async" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/cli" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/cli" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/collection" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/convert" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/core" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/developer" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/ffi" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/ffi" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/html" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/html" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/indexed_db" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/indexed_db" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/io" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/isolate" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/js" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/js" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/js_interop" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/js_util" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/js_interop_unsafe" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/js_util" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/math" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/svg" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/mirrors" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/typed_data" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/svg" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/typed_data" /> <root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_gl" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$PROJECT_DIR$/../../install/flutter_sdk/bin/cache/dart-sdk/lib/web_gl" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

1
.idea/misc.xml generated
View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="FrameworkDetectionExcludesConfiguration"> <component name="FrameworkDetectionExcludesConfiguration">
<type id="android" /> <type id="android" />

View File

@@ -1,39 +1,3 @@
## 3.8.0
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.0)
## 3.8.0-rc.16
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.0-rc.16)
-
## 3.5.1
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1)
## 3.5.1-alpha.7
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.7)
## 3.5.1-alpha.2
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.2)
## 3.5.0-rc.1
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.0-rc.1)
## 3.4.0+1
- Adjust some fields and APIs.
## 3.4.0
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.4.0)
## 3.3.0
- [Bug fixes and performance enhancements.](https://github.com/OpenIMSDK/openim-sdk-core/releases/tag/v3.3.0)
## 3.0.0 ## 3.0.0
- The super update is not compatible with the previous version - The super update is not compatible with the previous version

1892
README.md

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -52,5 +52,5 @@ android {
dependencies { dependencies {
// 本地依赖现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下命名core-sdk-0.0.1.aar // 本地依赖现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下命名core-sdk-0.0.1.aar
// implementation 'io.openim:core-sdk:0.0.1@aar' // implementation 'io.openim:core-sdk:0.0.1@aar'
implementation 'io.openim:core-sdk:3.8.0@aar' implementation 'io.openim:core-sdk:3.1.0-e-1.0.0@aar'
} }

View File

@@ -23,6 +23,7 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager;
import io.openim.flutter_openim_sdk.manager.GroupManager; import io.openim.flutter_openim_sdk.manager.GroupManager;
import io.openim.flutter_openim_sdk.manager.IMManager; import io.openim.flutter_openim_sdk.manager.IMManager;
import io.openim.flutter_openim_sdk.manager.MessageManager; import io.openim.flutter_openim_sdk.manager.MessageManager;
import io.openim.flutter_openim_sdk.manager.SignalingManager;
import io.openim.flutter_openim_sdk.manager.UserManager; import io.openim.flutter_openim_sdk.manager.UserManager;
@@ -42,6 +43,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler,
private static MessageManager messageManager; private static MessageManager messageManager;
private static ConversationManager conversationManager; private static ConversationManager conversationManager;
private static GroupManager groupManager; private static GroupManager groupManager;
private static SignalingManager signalingManager;
private static Activity activity; private static Activity activity;
private static Context context; private static Context context;
private ConnectivityListener connectivityListener; private ConnectivityListener connectivityListener;
@@ -55,6 +57,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler,
FlutterOpenimSdkPlugin.messageManager = new MessageManager(); FlutterOpenimSdkPlugin.messageManager = new MessageManager();
FlutterOpenimSdkPlugin.conversationManager = new ConversationManager(); FlutterOpenimSdkPlugin.conversationManager = new ConversationManager();
FlutterOpenimSdkPlugin.groupManager = new GroupManager(); FlutterOpenimSdkPlugin.groupManager = new GroupManager();
FlutterOpenimSdkPlugin.signalingManager = new SignalingManager();
} }

View File

@@ -88,12 +88,4 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
values.put("message", s); values.put("message", s);
CommonUtil.emitEvent("advancedMsgListener", "onRecvOfflineNewMessage", values); CommonUtil.emitEvent("advancedMsgListener", "onRecvOfflineNewMessage", values);
} }
@Override
public void onRecvOnlineOnlyMessage(String s) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("message", s);
CommonUtil.emitEvent("advancedMsgListener", "onRecvOnlineOnlyMessage", values);
}
} }

View File

@@ -19,13 +19,15 @@ public class OnBaseListener implements Base {
@Override @Override
public void onError(int l, String s) { 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); CommonUtil.runMainThreadReturnError(result, l, s, null);
} }
@Override @Override
public void onSuccess(String s) { 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); CommonUtil.runMainThreadReturn(result, s);
} }
} }

View File

@@ -31,9 +31,4 @@ public class OnConnListener implements open_im_sdk_callback.OnConnListener {
public void onUserTokenExpired() { public void onUserTokenExpired() {
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null); CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
} }
@Override
public void onUserTokenInvalid(String s) {
CommonUtil.emitEvent("connectListener", "onUserTokenInvalid", s);
}
} }

View File

@@ -2,6 +2,7 @@ package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnConversationListener implements open_im_sdk_callback.OnConversationListener { public class OnConversationListener implements open_im_sdk_callback.OnConversationListener {
@Override @Override
@@ -9,38 +10,28 @@ public class OnConversationListener implements open_im_sdk_callback.OnConversati
CommonUtil.emitEvent("conversationListener", "onConversationChanged", s); CommonUtil.emitEvent("conversationListener", "onConversationChanged", s);
} }
@Override
public void onConversationUserInputStatusChanged(String s) {
CommonUtil.emitEvent("conversationListener", "onConversationUserInputStatusChanged", s);
}
@Override @Override
public void onNewConversation(String s) { public void onNewConversation(String s) {
CommonUtil.emitEvent("conversationListener", "onNewConversation", s); CommonUtil.emitEvent("conversationListener", "onNewConversation", s);
} }
@Override @Override
public void onSyncServerFailed(boolean reinstalled) { public void onSyncServerFailed() {
CommonUtil.emitEvent("conversationListener", "onSyncServerFailed", reinstalled); CommonUtil.emitEvent("conversationListener", "onSyncServerFailed", null);
} }
@Override @Override
public void onSyncServerFinish(boolean reinstalled) { public void onSyncServerFinish() {
CommonUtil.emitEvent("conversationListener", "onSyncServerFinish", reinstalled); CommonUtil.emitEvent("conversationListener", "onSyncServerFinish", null);
} }
@Override @Override
public void onSyncServerStart(boolean reinstalled) { public void onSyncServerStart() {
CommonUtil.emitEvent("conversationListener", "onSyncServerStart", reinstalled); CommonUtil.emitEvent("conversationListener", "onSyncServerStart", null);
}
@Override
public void onSyncServerProgress(long progress) {
CommonUtil.emitEvent("conversationListener", "onSyncServerProgress", progress);
} }
@Override @Override
public void onTotalUnreadMessageCountChanged(int i) { public void onTotalUnreadMessageCountChanged(int i) {
CommonUtil.emitEvent("conversationListener", "onTotalUnreadMessageCountChanged", i); CommonUtil.emitEvent("conversationListener", "onTotalUnreadMessageCountChanged", i);
} }
} }

View File

@@ -1,90 +1,30 @@
//package io.openim.flutter_openim_sdk.listener; package io.openim.flutter_openim_sdk.listener;
//
//import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
//
//public class OnListenerForService implements open_im_sdk_callback.OnListenerForService { public class OnListenerForService implements open_im_sdk_callback.OnListenerForService {
// @Override @Override
// public void onFriendApplicationAccepted(String s) { public void onFriendApplicationAccepted(String s) {
// CommonUtil.emitEvent("listenerForService", "onFriendApplicationAccepted", s); CommonUtil.emitEvent("listenerForService", "onFriendApplicationAccepted", s);
// } }
//
// @Override @Override
// public void onFriendApplicationAdded(String s) { public void onFriendApplicationAdded(String s) {
// CommonUtil.emitEvent("listenerForService", "onFriendApplicationAdded", s); CommonUtil.emitEvent("listenerForService", "onFriendApplicationAdded", s);
// } }
//
// @Override @Override
// public void onGroupApplicationAccepted(String s) { public void onGroupApplicationAccepted(String s) {
// CommonUtil.emitEvent("listenerForService", "onGroupApplicationAccepted", s); CommonUtil.emitEvent("listenerForService", "onGroupApplicationAccepted", s);
// } }
//
// @Override @Override
// public void onGroupApplicationAdded(String s) { public void onGroupApplicationAdded(String s) {
// CommonUtil.emitEvent("listenerForService", "onGroupApplicationAdded", s); CommonUtil.emitEvent("listenerForService", "onGroupApplicationAdded", s);
// } }
//
// @Override @Override
// public void onHangUp(String s) { public void onRecvNewMessage(String s) {
// CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s);
// } }
// }
// @Override
// public void onInvitationCancelled(String s) {
//
// }
//
// @Override
// public void onInvitationTimeout(String s) {
//
// }
//
// @Override
// public void onInviteeAccepted(String s) {
//
// }
//
// @Override
// public void onInviteeAcceptedByOtherDevice(String s) {
//
// }
//
// @Override
// public void onInviteeRejected(String s) {
//
// }
//
// @Override
// public void onInviteeRejectedByOtherDevice(String s) {
//
// }
//
// @Override
// public void onReceiveCustomSignal(String s) {
//
// }
//
// @Override
// public void onReceiveNewInvitation(String s) {
//
// }
//
// @Override
// public void onRoomParticipantConnected(String s) {
//
// }
//
// @Override
// public void onRoomParticipantDisconnected(String s) {
//
// }
//
// @Override
// public void onStreamChange(String s) {
//
// }
//
// @Override
// public void onRecvNewMessage(String s) {
// CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s);
// }
//}

View File

@@ -0,0 +1,12 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnMessageKvInfoListener implements open_im_sdk_callback.OnMessageKvInfoListener {
// 经过聚合后的kv计算了总数判断了是否包含自己
@Override
public void onMessageKvInfoChanged(String s) {
CommonUtil.emitEvent("messageKvInfoListener", "onMessageKvInfoChanged", s);
}
}

View File

@@ -0,0 +1,66 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnSignalingListener implements open_im_sdk_callback.OnSignalingListener {
@Override
public void onInvitationCancelled(String s) {
CommonUtil.emitEvent("signalingListener", "onInvitationCancelled", s);
}
@Override
public void onInvitationTimeout(String s) {
CommonUtil.emitEvent("signalingListener", "onInvitationTimeout", s);
}
@Override
public void onInviteeAccepted(String s) {
CommonUtil.emitEvent("signalingListener", "onInviteeAccepted", s);
}
@Override
public void onInviteeAcceptedByOtherDevice(String s) {
CommonUtil.emitEvent("signalingListener", "onInviteeAcceptedByOtherDevice", s);
}
@Override
public void onInviteeRejected(String s) {
CommonUtil.emitEvent("signalingListener", "onInviteeRejected", s);
}
@Override
public void onInviteeRejectedByOtherDevice(String s) {
CommonUtil.emitEvent("signalingListener", "onInviteeRejectedByOtherDevice", s);
}
@Override
public void onReceiveCustomSignal(String s) {
CommonUtil.emitEvent("signalingListener", "onReceiveCustomSignal", s);
}
@Override
public void onReceiveNewInvitation(String s) {
CommonUtil.emitEvent("signalingListener", "onReceiveNewInvitation", s);
}
@Override
public void onRoomParticipantConnected(String s) {
CommonUtil.emitEvent("signalingListener", "onRoomParticipantConnected", s);
}
@Override
public void onRoomParticipantDisconnected(String s) {
CommonUtil.emitEvent("signalingListener", "onRoomParticipantDisconnected", s);
}
@Override
public void onStreamChange(String s) {
CommonUtil.emitEvent("signalingListener", "onStreamChange", s);
}
@Override
public void onHangUp(String s) {
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
}
}

View File

@@ -1,26 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import android.util.ArrayMap;
import java.util.Map;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk_callback.UploadLogProgress;
public class OnUploadLogsListener implements UploadLogProgress {
final private MethodChannel.Result result;
public OnUploadLogsListener(MethodChannel.Result result, MethodCall call) {
this.result = result;
}
@Override
public void onProgress(long current, long size) {
final Map<String, Object> values = new ArrayMap<>();
values.put("current", current);
values.put("size", size);
CommonUtil.emitEvent("uploadLogsListener", "onProgress", values);
}
}

View File

@@ -8,24 +8,4 @@ public class OnUserListener implements open_im_sdk_callback.OnUserListener {
public void onSelfInfoUpdated(String s) { public void onSelfInfoUpdated(String s) {
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s); CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
} }
@Override
public void onUserStatusChanged(String s) {
CommonUtil.emitEvent("userListener", "onUserStatusChanged", s);
}
@Override
public void onUserCommandAdd(String s) {
CommonUtil.emitEvent("userListener", "onUserCommandAdd", s);
}
@Override
public void onUserCommandDelete(String s) {
CommonUtil.emitEvent("userListener", "onUserCommandDelete", s);
}
@Override
public void onUserCommandUpdate(String s) {
CommonUtil.emitEvent("userListener", "onUserCommandUpdate", s);
}
} }

View File

@@ -141,6 +141,10 @@ public class ConversationManager extends BaseManager {
} }
public void deleteAllConversationFromLocal(MethodCall methodCall, MethodChannel.Result result) { public void deleteAllConversationFromLocal(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteAllConversationFromLocal(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
} }
public void resetConversationGroupAtType(MethodCall methodCall, MethodChannel.Result result) { public void resetConversationGroupAtType(MethodCall methodCall, MethodChannel.Result result) {
@@ -189,28 +193,4 @@ public class ConversationManager extends BaseManager {
int2long(methodCall, "duration") int2long(methodCall, "duration")
); );
} }
public void hideAllConversations(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.hideAllConversations(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void searchConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchConversation(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "name")
);
}
public void setConversationEx(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationEx(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "ex")
);
}
} }

View File

@@ -52,15 +52,6 @@ public class FriendshipManager extends BaseManager {
); );
} }
public void getFriendListPage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendListPage(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "offset"),
value(methodCall, "count")
);
}
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) { public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendRemark( Open_im_sdk.setFriendRemark(
new OnBaseListener(result, methodCall), new OnBaseListener(result, methodCall),
@@ -73,8 +64,7 @@ public class FriendshipManager extends BaseManager {
Open_im_sdk.addBlack( Open_im_sdk.addBlack(
new OnBaseListener(result, methodCall), new OnBaseListener(result, methodCall),
value(methodCall, "operationID"), value(methodCall, "operationID"),
value(methodCall, "userID"), value(methodCall, "userID")
value(methodCall, "ex")
); );
} }
@@ -132,13 +122,4 @@ public class FriendshipManager extends BaseManager {
jsonValue(methodCall, "searchParam") jsonValue(methodCall, "searchParam")
); );
} }
public void setFriendsEx(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendsEx(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "friendIDs"),
value(methodCall, "ex")
);
}
} }

View File

@@ -62,15 +62,6 @@ public class GroupManager extends BaseManager {
); );
} }
public void getJoinedGroupListPage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getJoinedGroupListPage(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "offset"),
value(methodCall, "count")
);
}
public void createGroup(MethodCall methodCall, MethodChannel.Result result) { public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.createGroup( Open_im_sdk.createGroup(
new OnBaseListener(result, methodCall), new OnBaseListener(result, methodCall),
@@ -101,8 +92,7 @@ public class GroupManager extends BaseManager {
value(methodCall, "operationID"), value(methodCall, "operationID"),
value(methodCall, "groupID"), value(methodCall, "groupID"),
value(methodCall, "reason"), value(methodCall, "reason"),
value(methodCall, "joinSource"), value(methodCall, "joinSource")
value(methodCall, "ex")
); );
} }
@@ -274,12 +264,4 @@ public class GroupManager extends BaseManager {
value(methodCall, "groupID") value(methodCall, "groupID")
); );
} }
public void getUsersInGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInGroup(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
jsonValue(methodCall, "userIDs")
);
}
} }

View File

@@ -6,7 +6,6 @@ import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
import io.openim.flutter_openim_sdk.listener.OnBaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnConnListener; import io.openim.flutter_openim_sdk.listener.OnConnListener;
import io.openim.flutter_openim_sdk.listener.OnUploadFileListener; import io.openim.flutter_openim_sdk.listener.OnUploadFileListener;
import io.openim.flutter_openim_sdk.listener.OnUploadLogsListener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
@@ -22,7 +21,7 @@ public class IMManager extends BaseManager {
} }
public void unInitSDK(MethodCall methodCall, MethodChannel.Result result) { public void unInitSDK(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.unInitSDK(value(methodCall, "operationID")); CommonUtil.runMainThreadReturn(result, Open_im_sdk.unInitSDK(value(methodCall, "operationID")));
} }
public void login(MethodCall methodCall, MethodChannel.Result result) { public void login(MethodCall methodCall, MethodChannel.Result result) {
@@ -58,20 +57,10 @@ public class IMManager extends BaseManager {
Open_im_sdk.updateFcmToken( Open_im_sdk.updateFcmToken(
new OnBaseListener(result, methodCall), new OnBaseListener(result, methodCall),
value(methodCall, "operationID"), value(methodCall, "operationID"),
value(methodCall, "fcmToken"), value(methodCall, "fcmToken")
int2long(methodCall, "expireTime")
); );
} }
public void uploadLogs(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.uploadLogs(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
int2long(methodCall, "line"),
value(methodCall, "ex"),
new OnUploadLogsListener(result, methodCall)
);
}
public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) { public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setAppBackgroundStatus( Open_im_sdk.setAppBackgroundStatus(

View File

@@ -5,6 +5,7 @@ import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener; import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnCustomBusinessListener; import io.openim.flutter_openim_sdk.listener.OnCustomBusinessListener;
import io.openim.flutter_openim_sdk.listener.OnMessageKvInfoListener;
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener; import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
@@ -13,6 +14,74 @@ import open_im_sdk.Open_im_sdk;
public class MessageManager extends BaseManager { public class MessageManager extends BaseManager {
private final static String KEY_ID = "id"; private final static String KEY_ID = "id";
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
/* private static boolean initializedListener = false;
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
protected void clearListeners() {
initializedListener = false;
listeners.clear();
}
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
@Override
public void onRecvC2CReadReceipt(String s) {
for (AdvancedMsgListener l : listeners.values()) {
l.onRecvC2CReadReceipt(s);
}
}
@Override
public void onRecvMessageRevoked(String s) {
for (AdvancedMsgListener l : listeners.values()) {
l.onRecvMessageRevoked(s);
}
}
@Override
public void onRecvNewMessage(String s) {
for (AdvancedMsgListener l : listeners.values()) {
l.onRecvNewMessage(s);
}
}
};
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
listeners.put(key, new AdvancedMsgListener(key));
if (!initializedListener) {
initializedListener = true;
Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
}
}
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
listeners.remove(key);
if (listeners.isEmpty()) {
initializedListener = false;
Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
}
}*/
/*
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
if (!listeners.containsKey(key)) {
AdvancedMsgListener listener = new AdvancedMsgListener(key);
listeners.put(methodCall.argument(KEY_ID), listener);
Open_im_sdk.addAdvancedMsgListener(listener);
}
}
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
OnAdvancedMsgListener listener = listeners.remove(key);
Open_im_sdk.removeAdvancedMsgListener(listener);
}
*/
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID); String key = methodCall.argument(KEY_ID);
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key)); Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
@@ -27,8 +96,7 @@ public class MessageManager extends BaseManager {
jsonValue(methodCall, "message"), jsonValue(methodCall, "message"),
value(methodCall, "userID"), value(methodCall, "userID"),
value(methodCall, "groupID"), value(methodCall, "groupID"),
jsonValue(methodCall, "offlinePushInfo"), jsonValue(methodCall, "offlinePushInfo")
value(methodCall, "isOnlineOnly")
); );
} }
@@ -314,23 +382,6 @@ public class MessageManager extends BaseManager {
); );
} }
public void setMessageLocalEx(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageLocalEx(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "clientMsgID"),
value(methodCall, "localEx")
);
}
public void setAppBadge(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setAppBadge(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "count")
);
}
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) { public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.sendMessageNotOss( Open_im_sdk.sendMessageNotOss(
@@ -339,8 +390,7 @@ public class MessageManager extends BaseManager {
jsonValue(methodCall, "message"), jsonValue(methodCall, "message"),
value(methodCall, "userID"), value(methodCall, "userID"),
value(methodCall, "groupID"), value(methodCall, "groupID"),
jsonValue(methodCall, "offlinePushInfo"), jsonValue(methodCall, "offlinePushInfo")
value(methodCall, "isOnlineOnly")
); );
} }
@@ -348,7 +398,6 @@ public class MessageManager extends BaseManager {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessageByURL( Open_im_sdk.createImageMessageByURL(
value(methodCall, "operationID"), value(methodCall, "operationID"),
value(methodCall, "sourcePath"),
jsonValue(methodCall, "sourcePicture"), jsonValue(methodCall, "sourcePicture"),
jsonValue(methodCall, "bigPicture"), jsonValue(methodCall, "bigPicture"),
jsonValue(methodCall, "snapshotPicture"))); jsonValue(methodCall, "snapshotPicture")));
@@ -380,4 +429,54 @@ public class MessageManager extends BaseManager {
result.success(null); result.success(null);
} }
public void setMessageKvInfoListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageKvInfoListener(new OnMessageKvInfoListener());
result.success(null);
}
// public void setMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.setMessageReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "message"),
// jsonValue(methodCall, "list")
// );
// }
//
// public void deleteMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.deleteMessageReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "message"),
// jsonValue(methodCall, "list")
// );
// }
//
// public void getMessageListReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.getMessageListReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "messageList")
// );
// }
//
// public void addMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.addMessageReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "message"),
// jsonValue(methodCall, "list")
// );
// }
//
// public void getMessageListSomeReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.getMessageListSomeReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "messageList"),
// jsonValue(methodCall, "list")
// );
// }
} }

View File

@@ -0,0 +1,131 @@
package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnSignalingListener;
import open_im_sdk.Open_im_sdk;
public class SignalingManager extends BaseManager {
public void setSignalingListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSignalingListener(new OnSignalingListener());
result.success(null);
}
public void signalingInvite(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingInvite(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingInviteInGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingInviteInGroup(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingAccept(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingAccept(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingReject(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingReject(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingCancel(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingCancel(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingHungUp(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingHungUp(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingGetRoomByGroupID(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingGetRoomByGroupID(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"));
}
public void signalingGetTokenByRoomID(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingGetTokenByRoomID(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "roomID"));
}
public void signalingUpdateMeetingInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingUpdateMeetingInfo(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info"));
}
public void signalingCreateMeeting(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingCreateMeeting(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info"));
}
public void signalingJoinMeeting(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingJoinMeeting(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info"));
}
public void signalingOperateStream(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingOperateStream(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "streamType"),
value(methodCall, "roomID"),
value(methodCall, "userID"),
value(methodCall, "mute"),
value(methodCall, "muteAll"));
}
public void signalingGetMeetings(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingGetMeetings(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"));
}
public void signalingCloseRoom(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingCloseRoom(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "roomID"));
}
public void signalingSendCustomSignal(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingSendCustomSignal(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "customInfo"),
value(methodCall, "roomID"));
}
public void getSignalingInvitationInfoStartApp(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSignalingInvitationInfoStartApp(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"));
}
}

View File

@@ -34,47 +34,4 @@ public class UserManager extends BaseManager {
value(methodCall, "operationID") value(methodCall, "operationID")
); );
} }
public void subscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.subscribeUsersStatus(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "userIDs"));
}
public void unsubscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.unsubscribeUsersStatus(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "userIDs"));
}
public void getSubscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSubscribeUsersStatus(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void getUserStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUserStatus(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "userIDs"));
}
public void getUsersInfoWithCache(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInfoWithCache(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "userIDs"),
value(methodCall, "groupID"));
}
/*
public void setSelfInfoEx(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSelfInfoEx(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall));
}
*/
} }

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) { public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
String threadName = Thread.currentThread().getName();
runMainThread(() -> { runMainThread(() -> {
Map<String, Object> res = new ArrayMap<>(); Map<String, Object> res = new ArrayMap<>();
if (null != type) { if (null != type) {
@@ -47,7 +48,7 @@ public class CommonUtil {
if (null != errMsg) { if (null != errMsg) {
res.put("errMsg", 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); FlutterOpenimSdkPlugin.channel.invokeMethod(method, res);
}); });
} }

View File

@@ -1,9 +1,9 @@
buildscript { buildscript {
repositories { repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
google() google()
mavenCentral() mavenCentral()
} }
@@ -15,10 +15,10 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
google() google()
mavenCentral() mavenCentral()
} }
@@ -30,6 +30,6 @@ subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
tasks.register("clean", Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

View File

@@ -2,8 +2,8 @@ PODS:
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_openim_sdk (0.0.1): - flutter_openim_sdk (0.0.1):
- Flutter - Flutter
- OpenIMSDKCore (= 3.4.0) - OpenIMSDKCore (= 3.0.0-e)
- OpenIMSDKCore (3.4.0) - OpenIMSDKCore (3.0.0-e)
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
@@ -21,9 +21,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_openim_sdk: 54d1c836ff60ebb5b99d246521ef0cb1d834fb13 flutter_openim_sdk: 9b4a8c3f8bc581249d074c4090b32d743adee0e0
OpenIMSDKCore: 47e0e830afe0d2dd905ad3dda255e6a6d26a555c OpenIMSDKCore: b6b5620eb31da76b9c0142e703dff2924341871a
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
COCOAPODS: 1.13.0 COCOAPODS: 1.11.2

View File

@@ -14,7 +14,13 @@ class _MyAppState extends State<MyApp> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
OpenIM.iMManager.initSDK(platformID: 1, apiAddr: '', wsAddr: '', dataDir: '/', listener: OnConnectListener()); OpenIM.iMManager.initSDK(
platformID: 1,
apiAddr: '',
wsAddr: '',
dataDir: '/',
objectStorage: 'minio',
listener: OnConnectListener());
} }
@override @override

View File

@@ -5,56 +5,56 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.11.0" version: "2.10.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.2.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.18.0" version: "1.17.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.6" version: "1.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
flutter: flutter:
@@ -68,68 +68,52 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "3.8.0-rc.15" version: "3.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
leak_tracker: js:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: js
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "10.0.4" version: "0.6.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.13"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.8.0" version: "0.2.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.12.0" version: "1.8.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.9.0" version: "1.8.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -139,32 +123,32 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.9.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.11.1" version: "1.11.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.2" version: "2.1.1"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
term_glyph: term_glyph:
@@ -172,33 +156,25 @@ packages:
description: description:
name: term_glyph name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.7.0" version: "0.4.16"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=2.18.0 <3.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=1.20.0"

38
ios/.gitignore vendored Normal file
View File

@@ -0,0 +1,38 @@
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
*.swp
profile
DerivedData/
build/
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
/Flutter/Generated.xcconfig
/Flutter/ephemeral/
/Flutter/flutter_export_environment.sh

0
ios/Assets/.gitkeep Normal file
View File

View File

@@ -26,9 +26,6 @@ public class ConversationManager: BaseServiceManager {
self["getAtAllTag"] = getAtAllTag self["getAtAllTag"] = getAtAllTag
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
self["setConversationBurnDuration"] = setConversationBurnDuration self["setConversationBurnDuration"] = setConversationBurnDuration
self["hideAllConversations"] = hideAllConversations
self["searchConversation"] = searchConversation
self["setConversationEx"] = setConversationEx
} }
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -78,7 +75,7 @@ public class ConversationManager: BaseServiceManager {
} }
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int: "status"]) Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationID"], methodCall[int: "status"])
} }
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -98,6 +95,7 @@ public class ConversationManager: BaseServiceManager {
} }
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteAllConversationFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func resetConversationGroupAtType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func resetConversationGroupAtType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -115,61 +113,40 @@ public class ConversationManager: BaseServiceManager {
func setConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"]) Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
} }
func hideAllConversations(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkHideAllConversations(BaseCallback(result: result), methodCall[string: "operationID"])
}
func searchConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "name"])
}
func setConversationEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetConversationEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "ex"])
}
} }
public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol { public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
public func onSyncServerProgress(_ progress: Int) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerProgress", errCode: nil, errMsg: nil, data: progress)
}
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
self.channel = channel self.channel = channel
} }
public func onConversationChanged(_ conversationList: String?) { public func onConversationChanged(_ conversationList: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList)
} }
public func onNewConversation(_ conversationList: String?) { public func onNewConversation(_ conversationList: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList)
} }
public func onSyncServerFailed(_ reinstalled: Bool) { public func onSyncServerFailed() {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: reinstalled) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: nil)
} }
public func onSyncServerFinish(_ reinstalled: Bool) { public func onSyncServerFinish() {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: reinstalled) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: nil)
} }
public func onSyncServerStart(_ reinstalled: Bool) { public func onSyncServerStart() {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: reinstalled) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: nil)
} }
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) { public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount)
} }
public func onConversationUserInputStatusChanged(_ change: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationUserInputStatusChanged", errCode: nil, errMsg: nil, data: change)
}
} }

View File

@@ -11,7 +11,6 @@ public class FriendshipManager: BaseServiceManager {
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
self["getFriendList"] = getFriendList self["getFriendList"] = getFriendList
self["getFriendListPage"] = getFriendListPage
self["setFriendRemark"] = setFriendRemark self["setFriendRemark"] = setFriendRemark
self["addBlacklist"] = addBlacklist self["addBlacklist"] = addBlacklist
self["getBlacklist"] = getBlacklist self["getBlacklist"] = getBlacklist
@@ -21,7 +20,6 @@ public class FriendshipManager: BaseServiceManager {
self["acceptFriendApplication"] = acceptFriendApplication self["acceptFriendApplication"] = acceptFriendApplication
self["refuseFriendApplication"] = refuseFriendApplication self["refuseFriendApplication"] = refuseFriendApplication
self["searchFriends"] = searchFriends self["searchFriends"] = searchFriends
self["setFriendsEx"] = setFriendsEx
} }
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -48,17 +46,13 @@ public class FriendshipManager: BaseServiceManager {
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"]) Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getFriendListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
}
func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "ex"]) Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
} }
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -88,10 +82,6 @@ public class FriendshipManager: BaseServiceManager {
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"]) Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
} }
func setFriendsEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetFriendsEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "friendIDs"], methodCall[string: "ex"])
}
} }
public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol { public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol {

View File

@@ -11,7 +11,6 @@ public class GroupManager: BaseServiceManager {
self["getGroupMembersInfo"] = getGroupMembersInfo self["getGroupMembersInfo"] = getGroupMembersInfo
self["getGroupMemberList"] = getGroupMemberList self["getGroupMemberList"] = getGroupMemberList
self["getJoinedGroupList"] = getJoinedGroupList self["getJoinedGroupList"] = getJoinedGroupList
self["getJoinedGroupListPage"] = getJoinedGroupListPage
self["createGroup"] = createGroup self["createGroup"] = createGroup
self["setGroupInfo"] = setGroupInfo self["setGroupInfo"] = setGroupInfo
self["getGroupsInfo"] = getGroupsInfo self["getGroupsInfo"] = getGroupsInfo
@@ -36,7 +35,6 @@ public class GroupManager: BaseServiceManager {
self["searchGroupMembers"] = searchGroupMembers self["searchGroupMembers"] = searchGroupMembers
self["setGroupMemberInfo"] = setGroupMemberInfo self["setGroupMemberInfo"] = setGroupMemberInfo
self["isJoinGroup"] = isJoinGroup self["isJoinGroup"] = isJoinGroup
self["getUsersInGroup"] = getUsersInGroup
} }
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -66,10 +64,6 @@ public class GroupManager: BaseServiceManager {
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"]) Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getJoinedGroupListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetJoinedGroupListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
}
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
@@ -84,8 +78,7 @@ public class GroupManager: BaseServiceManager {
} }
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
"reason"], methodCall[int32: "joinSource"], methodCall[jsonString: "ex"])
} }
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -167,11 +160,6 @@ public class GroupManager: BaseServiceManager {
func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"]) Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
} }
func getUsersInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetUsersInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"],
methodCall[jsonString: "userIDs"])
}
} }
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol { public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {

View File

@@ -13,7 +13,6 @@ public class IMMananger: BaseServiceManager {
self["logout"] = logout self["logout"] = logout
self["getLoginStatus"] = getLoginStatus self["getLoginStatus"] = getLoginStatus
self["uploadFile"] = uploadFile self["uploadFile"] = uploadFile
self["uploadLogs"] = uploadLogs
self["updateFcmToken"] = updateFcmToken self["updateFcmToken"] = updateFcmToken
self["setAppBackgroundStatus"] = setAppBackgroundStatus self["setAppBackgroundStatus"] = setAppBackgroundStatus
self["networkStatusChanged"] = networkStatusChanged self["networkStatusChanged"] = networkStatusChanged
@@ -66,7 +65,7 @@ public class IMMananger: BaseServiceManager {
} }
func unInitSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func unInitSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkUnInitSDK(methodCall[string: "operationID"]) callBack(result, Open_im_sdkUnInitSDK(methodCall[string: "operationID"]))
} }
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@@ -84,15 +83,9 @@ public class IMMananger: BaseServiceManager {
func uploadFile(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func uploadFile(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkUploadFile(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString(), UploadFileListener(channel: self.channel,id: methodCall[string: "id"])) Open_im_sdkUploadFile(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString(), UploadFileListener(channel: self.channel,id: methodCall[string: "id"]))
} }
func uploadLogs(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkUploadLogs(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "line"], methodCall[string: "ex"],
UploadLogsListener(channel: self.channel))
}
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"], methodCall[int64: Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"])
"expireTime"])
} }
func setAppBackgroundStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func setAppBackgroundStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@@ -105,10 +98,6 @@ public class IMMananger: BaseServiceManager {
} }
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol { public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
public func onUserTokenInvalid(_ errMsg: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenInvalid", errCode: nil, errMsg: errMsg, data: nil)
}
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
@@ -136,28 +125,11 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
} }
} }
public class UploadLogsListener: NSObject, Open_im_sdk_callbackUploadLogProgressProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
public func onProgress(_ current: Int64, size: Int64) {
var values: [String: Any] = [:]
values["current"] = current
values["size"] = size
CommonUtil.emitEvent(channel: channel, method: "uploadLogsListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
}
}
public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol { public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol {
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
private let id: String private let id: String
init(channel:FlutterMethodChannel, id: String) { init(channel:FlutterMethodChannel, id: String) {
self.channel = channel self.channel = channel
self.id = id self.id = id

View File

@@ -3,7 +3,8 @@ import OpenIMCore
public class MessageManager: BaseServiceManager { public class MessageManager: BaseServiceManager {
private let KEY_ID: String = "id" private let KEY_ID: String = "id"
// private var listeners: [String: AdvancedMsgListener] = [:]
public override func registerHandlers() { public override func registerHandlers() {
super.registerHandlers() super.registerHandlers()
self["setAdvancedMsgListener"] = setAdvancedMsgListener self["setAdvancedMsgListener"] = setAdvancedMsgListener
@@ -44,15 +45,15 @@ public class MessageManager: BaseServiceManager {
self["getAdvancedHistoryMessageListReverse"] = getAdvancedHistoryMessageListReverse self["getAdvancedHistoryMessageListReverse"] = getAdvancedHistoryMessageListReverse
self["findMessageList"] = findMessageList self["findMessageList"] = findMessageList
self["setMessageLocalEx"] = setMessageLocalEx
self["setAppBadge"] = setAppBadge
self["sendMessageNotOss"] = sendMessageNotOss self["sendMessageNotOss"] = sendMessageNotOss
self["createImageMessageByURL"] = createImageMessageByURL self["createImageMessageByURL"] = createImageMessageByURL
self["createSoundMessageByURL"] = createSoundMessageByURL self["createSoundMessageByURL"] = createSoundMessageByURL
self["createVideoMessageByURL"] = createVideoMessageByURL self["createVideoMessageByURL"] = createVideoMessageByURL
self["createFileMessageByURL"] = createFileMessageByURL self["createFileMessageByURL"] = createFileMessageByURL
self["setCustomBusinessListener"] = setCustomBusinessListener self["setCustomBusinessListener"] = setCustomBusinessListener
self["setMessageKvInfoListener"] = setMessageKvInfoListener
} }
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -65,7 +66,7 @@ public class MessageManager: BaseServiceManager {
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall) let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"], Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"], methodCall[bool: "isOnlineOnly"]) methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
} }
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -216,23 +217,15 @@ public class MessageManager: BaseServiceManager {
func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkFindMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"]) Open_im_sdkFindMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"])
} }
func setMessageLocalEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageLocalEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "clientMsgID"], methodCall[string: "localEx"])
}
func setAppBadge(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetAppBadge(BaseCallback(result: result), methodCall[string: "operationID"], Int32(methodCall[int64: "count"]))
}
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall) let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"], Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"], methodCall[bool: "isOnlineOnly"]) methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
} }
func createImageMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createImageMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateImageMessageByURL(methodCall[string: "operationID"], methodCall[string: "sourcePath"], methodCall[jsonString: "sourcePicture"], methodCall[jsonString: "bigPicture"], methodCall[jsonString: "snapshotPicture"])) callBack(result, Open_im_sdkCreateImageMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "sourcePicture"], methodCall[jsonString: "bigPicture"], methodCall[jsonString: "snapshotPicture"]))
} }
func createSoundMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createSoundMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -251,6 +244,11 @@ public class MessageManager: BaseServiceManager {
Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel)) Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel))
callBack(result) callBack(result)
} }
func setMessageKvInfoListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageKvInfoListener(MessageKvInfoListener(channel: channel))
callBack(result)
}
} }
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol { public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
@@ -357,13 +355,7 @@ public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgLis
values["message"] = message values["message"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values); CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
} }
public func onRecvOnlineOnlyMessage(_ message: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["message"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOnlineOnlyMessage", errCode: nil, errMsg: nil, data: values);
}
} }
public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol { public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
@@ -378,3 +370,18 @@ public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusin
} }
} }
public class MessageKvInfoListener: NSObject, Open_im_sdk_callbackOnMessageKvInfoListenerProtocol {
private let channel: FlutterMethodChannel
init(channel: FlutterMethodChannel) {
self.channel = channel
}
public func onMessageKvInfoChanged(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "messageKvInfoListener", type: "onMessageKvInfoChanged", errCode: nil, errMsg: nil, data: s)
}
}

View File

@@ -0,0 +1,59 @@
//import Foundation
//import OpenIMCore
//
//public class OrganizationManager: BaseServiceManager {
//
// public override func registerHandlers() {
// super.registerHandlers()
// self["setOrganizationListener"] = setOrganizationListener
// self["getSubDepartment"] = getSubDepartment
// self["getDepartmentMember"] = getDepartmentMember
// self["getUserInDepartment"] = getUserInDepartment
// self["getDepartmentMemberAndSubDepartment"] = getDepartmentMemberAndSubDepartment
// self["getDepartmentInfo"] = getDepartmentInfo
// self["searchOrganization"] = searchOrganization
// }
//
// func setOrganizationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
// Open_im_sdkSetOrganizationListener(OrganizationListener(channel: channel))
// callBack(result)
// }
//
// func getSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetSubDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"], methodCall[int: "offset"], methodCall[int: "count"])
// }
//
// func getDepartmentMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetDepartmentMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"], methodCall[int: "offset"], methodCall[int: "count"])
// }
//
// func getUserInDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetUserInDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
// }
//
// func getDepartmentMemberAndSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetDepartmentMemberAndSubDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"])
// }
//
// func getDepartmentInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetDepartmentInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"])
// }
//
// func searchOrganization(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkSearchOrganization(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"], methodCall[int: "offset"], methodCall[int: "count"])
// }
//}
//
//public class OrganizationListener: NSObject, Open_im_sdk_callbackOnOrganizationListenerProtocol {
//
// private let channel:FlutterMethodChannel
//
// init(channel:FlutterMethodChannel) {
// self.channel = channel
// }
//
// public func onOrganizationUpdated() {
// CommonUtil.emitEvent(channel: self.channel, method: "organizationListener", type: "onOrganizationUpdated", errCode: nil, errMsg: nil, data: nil)
// }
//
//}

View File

@@ -0,0 +1,149 @@
import Foundation
import OpenIMCore
public class SignalingManager: BaseServiceManager {
public override func registerHandlers() {
super.registerHandlers()
self["setSignalingListener"] = setSignalingListener
self["signalingInvite"] = signalingInvite
self["signalingInviteInGroup"] = signalingInviteInGroup
self["signalingAccept"] = signalingAccept
self["signalingReject"] = signalingReject
self["signalingCancel"] = signalingCancel
self["signalingHungUp"] = signalingHungUp
self["signalingGetRoomByGroupID"] = signalingGetRoomByGroupID
self["signalingGetTokenByRoomID"] = signalingGetTokenByRoomID
self["signalingUpdateMeetingInfo"] = signalingUpdateMeetingInfo
self["signalingCreateMeeting"] = signalingCreateMeeting
self["signalingJoinMeeting"] = signalingJoinMeeting
self["signalingOperateStream"] = signalingOperateStream
self["signalingGetMeetings"] = signalingGetMeetings
self["signalingCloseRoom"] = signalingCloseRoom
self["signalingSendCustomSignal"] = signalingSendCustomSignal
}
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetSignalingListener(SignalingListener(channel: channel))
callBack(result)
}
func signalingInvite(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingInvite(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingInviteInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingInviteInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingAccept(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingAccept(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingReject(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingReject(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingCancel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingCancel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingHungUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingHungUp(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingGetRoomByGroupID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingGetRoomByGroupID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
}
func signalingGetTokenByRoomID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingGetTokenByRoomID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
}
func signalingUpdateMeetingInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingUpdateMeetingInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
func signalingCreateMeeting(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingCreateMeeting(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
func signalingJoinMeeting(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingJoinMeeting(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
func signalingOperateStream(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingOperateStream(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "streamType"], methodCall[string: "roomID"], methodCall[string: "userID"], methodCall[bool: "mute"], methodCall[bool: "muteAll"])
}
func signalingGetMeetings(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingGetMeetings(BaseCallback(result: result), methodCall[string: "operationID"])
}
func signalingCloseRoom(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingCloseRoom(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
}
func signalingSendCustomSignal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingSendCustomSignal(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "customInfo"], methodCall[string: "roomID"])
}
}
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
public func onInvitationCancelled(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInvitationCancelled", errCode: nil, errMsg: nil, data: s)
}
public func onInvitationTimeout(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInvitationTimeout", errCode: nil, errMsg: nil, data: s)
}
public func onInviteeAccepted(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeAccepted", errCode: nil, errMsg: nil, data: s)
}
public func onInviteeAccepted(byOtherDevice s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeAcceptedByOtherDevice", errCode: nil, errMsg: nil, data: s)
}
public func onInviteeRejected(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeRejected", errCode: nil, errMsg: nil, data: s)
}
public func onInviteeRejected(byOtherDevice s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeRejectedByOtherDevice", errCode: nil, errMsg: nil, data: s)
}
public func onReceiveNewInvitation(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onReceiveNewInvitation", errCode: nil, errMsg: nil, data: s)
}
public func onHangUp(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onHangUp", errCode: nil, errMsg: nil, data: s)
}
public func onRoomParticipantConnected(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantConnected", errCode: nil, errMsg: nil, data: s)
}
public func onRoomParticipantDisconnected(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantDisconnected", errCode: nil, errMsg: nil, data: s)
}
public func onStreamChange(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onStreamChange", errCode: nil, errMsg: nil, data: s)
}
public func onReceiveCustomSignal(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onReceiveCustomSignal", errCode: nil, errMsg: nil, data: s)
}
}

View File

@@ -9,14 +9,6 @@ public class UserManager: BaseServiceManager {
self["getUsersInfo"] = getUsersInfo self["getUsersInfo"] = getUsersInfo
self["setSelfInfo"] = setSelfInfo self["setSelfInfo"] = setSelfInfo
self["getSelfUserInfo"] = getSelfUserInfo self["getSelfUserInfo"] = getSelfUserInfo
self["subscribeUsersStatus"] = subscribeUsersStatus
self["unsubscribeUsersStatus"] = unsubscribeUsersStatus
self["getSubscribeUsersStatus"] = getSubscribeUsersStatus
self["getUserStatus"] = getUserStatus
self["getUsersInfoWithCache"] = getUsersInfoWithCache
/*
self["setSelfInfoEx"] = setSelfInfoEx
*/
} }
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -35,60 +27,17 @@ public class UserManager: BaseServiceManager {
func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"]) Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func subscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
}
func unsubscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkUnsubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
}
func getSubscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetSubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"])
}
func getUserStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetUserStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
}
func getUsersInfoWithCache(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetUsersInfoWithCache(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"],
methodCall[string: "groupID"])
}
/*
func setSelfInfoEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetSelfInfoEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
*/
} }
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol { public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
public func onUserCommandAdd(_ userCommand: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandAdd", errCode: nil, errMsg: nil, data: userCommand)
}
public func onUserCommandDelete(_ userCommand: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandDelete", errCode: nil, errMsg: nil, data: userCommand)
}
public func onUserCommandUpdate(_ userCommand: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandUpdate", errCode: nil, errMsg: nil, data: userCommand)
}
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
self.channel = channel self.channel = channel
} }
public func onSelfInfoUpdated(_ userInfo: String?) { public func onSelfInfoUpdated(_ userInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo) CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
} }
}
public func onUserStatusChanged(_ statusInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo)
}
}

View File

@@ -0,0 +1,44 @@
//import Foundation
//import OpenIMCore
//
//public class WorkMomentsManager: BaseServiceManager {
//
// public override func registerHandlers() {
// super.registerHandlers()
// self["setWorkMomentsListener"] = setWorkMomentsListener
// self["getWorkMomentsUnReadCount"] = getWorkMomentsUnReadCount
// self["getWorkMomentsNotification"] = getWorkMomentsNotification
// self["clearWorkMomentsNotification"] = clearWorkMomentsNotification
// }
//
// func setWorkMomentsListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
// Open_im_sdkSetWorkMomentsListener(WorkMomentsListener(channel: channel))
// callBack(result)
// }
//
// func getWorkMomentsUnReadCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetWorkMomentsUnReadCount(BaseCallback(result: result), methodCall[string: "operationID"])
// }
//
// func getWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
// }
//
// func clearWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkClearWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"])
// }
//}
//
//public class WorkMomentsListener: NSObject, Open_im_sdk_callbackOnWorkMomentsListenerProtocol {
//
// private let channel:FlutterMethodChannel
//
// init(channel:FlutterMethodChannel) {
// self.channel = channel
// }
//
// public func onRecvNewNotification() {
// CommonUtil.emitEvent(channel: self.channel, method: "workMomentsListener", type: "OnRecvNewNotification", errCode: nil, errMsg: nil, data: nil)
// }
//
//}

View File

@@ -8,6 +8,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
let messageManager: MessageManager let messageManager: MessageManager
let groupManager: GroupManager let groupManager: GroupManager
let userManger: UserManager let userManger: UserManager
let signalingManager: SignalingManager
// let workMomentsManager: WorkMomentsManager
// let organizationManager: OrganizationManager
init(channel: FlutterMethodChannel) { init(channel: FlutterMethodChannel) {
self.imManager = IMMananger(channel: channel) self.imManager = IMMananger(channel: channel)
@@ -16,6 +19,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
self.messageManager = MessageManager(channel: channel) self.messageManager = MessageManager(channel: channel)
self.groupManager = GroupManager(channel: channel) self.groupManager = GroupManager(channel: channel)
self.userManger = UserManager(channel: channel) self.userManger = UserManager(channel: channel)
self.signalingManager = SignalingManager(channel: channel)
// self.workMomentsManager = WorkMomentsManager(channel: channel)
// self.organizationManager = OrganizationManager(channel: channel)
} }
public static func register(with registrar: FlutterPluginRegistrar) { public static func register(with registrar: FlutterPluginRegistrar) {
@@ -39,6 +45,12 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
groupManager.handleMethod(call: call, result: result) groupManager.handleMethod(call: call, result: result)
case "userManager": case "userManager":
userManger.handleMethod(call: call, result: result) userManger.handleMethod(call: call, result: result)
case "signalingManager":
signalingManager.handleMethod(call: call, result: result)
// case "workMomentsManager":
// workMomentsManager.handleMethod(call: call, result: result)
// case "organizationManager":
// organizationManager.handleMethod(call: call, result: result)
default: default:
print("Handle ManagerName Error: \(managerName) not found") print("Handle ManagerName Error: \(managerName) not found")
} }

View File

@@ -17,11 +17,9 @@ A new Flutter project.
s.dependency 'Flutter' s.dependency 'Flutter'
s.platform = :ios, '11.0' s.platform = :ios, '11.0'
s.dependency 'OpenIMSDKCore','3.8.0' s.dependency 'OpenIMSDKCore','3.1.0-e-1.0.0'
s.static_framework = true s.static_framework = true
s.library = 'resolv' # s.vendored_frameworks = 'Framework/*.framework'
# s.vendored_frameworks = 'Framework/*.xcframework'
# Flutter.framework does not contain a i386 slice. # Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' }
s.swift_version = '5.0' s.swift_version = '5.0'

BIN
lib/.DS_Store vendored

Binary file not shown.

View File

@@ -18,21 +18,26 @@ export 'src/listener/custom_business_listener.dart';
export 'src/listener/friendship_listener.dart'; export 'src/listener/friendship_listener.dart';
export 'src/listener/group_listener.dart'; export 'src/listener/group_listener.dart';
export 'src/listener/listener_for_service.dart'; export 'src/listener/listener_for_service.dart';
export 'src/listener/message_kv_info_listener.dart';
export 'src/listener/msg_send_progress_listener.dart'; export 'src/listener/msg_send_progress_listener.dart';
export 'src/listener/upload_file_listener.dart'; export 'src/listener/upload_file_listener.dart';
export 'src/listener/signaling_listener.dart';
export 'src/listener/user_listener.dart'; export 'src/listener/user_listener.dart';
export 'src/manager/im_conversation_manager.dart'; export 'src/manager/im_conversation_manager.dart';
export 'src/manager/im_friendship_manager.dart'; export 'src/manager/im_friendship_manager.dart';
export 'src/manager/im_group_manager.dart'; export 'src/manager/im_group_manager.dart';
export 'src/manager/im_manager.dart'; export 'src/manager/im_manager.dart';
export 'src/manager/im_message_manager.dart'; export 'src/manager/im_message_manager.dart';
export 'src/manager/im_signaling_manager.dart';
export 'src/manager/im_user_manager.dart'; export 'src/manager/im_user_manager.dart';
export 'src/models/conversation_info.dart'; export 'src/models/conversation_info.dart';
export 'src/models/group_info.dart'; export 'src/models/group_info.dart';
export 'src/models/init_config.dart'; export 'src/models/meeting_info.dart';
export 'src/models/message.dart'; export 'src/models/message.dart';
export 'src/models/notification_info.dart'; export 'src/models/notification_info.dart';
export 'src/models/organization_info.dart';
export 'src/models/search_info.dart'; export 'src/models/search_info.dart';
export 'src/models/signaling_info.dart';
export 'src/models/user_info.dart'; export 'src/models/user_info.dart';
export 'src/openim.dart'; export 'src/openim.dart';
export 'src/utils.dart'; export 'src/utils.dart';

View File

@@ -1,4 +0,0 @@
class AllowType {
static const allow = 0;
static const notAllow = 1;
}

View File

@@ -1,15 +1,14 @@
/// Conversation types /// 会话类型
class ConversationType { class ConversationType {
/// Single chat /// 单聊
static const single = 1; static const single = 1;
/// Group (Deprecated in v3) ///
@Deprecated('Use superGroup instead')
static const group = 2; static const group = 2;
/// Super group chat /// 大群
static const superGroup = 3; static const superGroup = 3;
/// Notification /// 通知
static const notification = 4; static const notification = 4;
} }

View File

@@ -1,17 +1,17 @@
/// Conversation Strong Hint Content /// 会话强提示内容
class GroupAtType { class GroupAtType {
/// Cancel all hints, equivalent to calling the resetConversationGroupAtType method /// 取消所有提示,即调用了resetConversationGroupAtType方法
static const atNormal = 0; static const atNormal = 0;
/// @ me hint /// @了我提示
static const atMe = 1; static const atMe = 1;
/// @ all hint /// @了所有人提示
static const atAll = 2; static const atAll = 2;
/// @ all and @ me hint /// @了所有人@了我
static const atAllAtMe = 3; static const atAllAtMe = 3;
/// Group notification hint /// 群公告提示
static const groupNotification = 4; static const groupNotification = 4;
} }

View File

@@ -1,14 +0,0 @@
/// Group Member Filter
class GroupMemberFilter {
static const all = 0;
static const owner = 1;
static const admin = 2;
static const member = 3;
static const adminAndMember = 4;
static const superAndAdmin = 4;
}

View File

@@ -1,11 +1,11 @@
/// Group Member Roles /// 群成员角色
class GroupRoleLevel { class GroupRoleLevel {
/// Group owner /// 群主
static const owner = 100; static const owner = 100;
/// Administrator /// 管理员
static const admin = 60; static const admin = 60;
/// Regular member /// 普通成员
static const member = 20; static const member = 20;
} }

View File

@@ -1,7 +0,0 @@
/// Group Status
class GroupStatus {
static const normal = 0;
static const baned = 1;
static const dismissed = 2;
static const muted = 3;
}

View File

@@ -1,9 +1,8 @@
/// Group Types /// 组类型
class GroupType { class GroupType {
/// General group (Deprecated in v3) /// 普通群
@Deprecated('Use work instead')
static const int general = 0; static const int general = 0;
/// Work group /// 工作群
static const int work = 2; static const int work = 2;
} }

View File

@@ -1,11 +1,11 @@
/// Group Join Verification Settings /// 进群验证设置选项
class GroupVerification { class GroupVerification {
/// Apply and invite directly for entry /// 申请需要同意 邀请直接进
static const int applyNeedVerificationInviteDirectly = 0; static const int applyNeedVerificationInviteDirectly = 0;
/// Everyone needs verification to join, except for group owners and administrators who can invite directly /// 所有人进群需要验证,除了群主管理员邀
static const int allNeedVerification = 1; static const int allNeedVerification = 1;
/// Directly join the group /// 直接进群
static const int directly = 2; static const int directly = 2;
} }

View File

@@ -1,16 +1,15 @@
/// The current Flutter platform supports only Android/iOS /// 当前flutter平台仅支持Android/ios
class IMPlatform { class IMPlatform {
/// iOS /// IOS
static const ios = 1; static const ios = 1;
/// Android /// Android
static const android = 2; static const android = 2;
static const windows = 3; static const windows = 3;
static const xos = 4; static const xos = 4;
static const web = 5; static const web = 5;
static const miniWeb = 6; static const mini_web = 6;
static const linux = 7; static const linux = 7;
static const androidPad = 8; static const android_pad = 8;
static const ipad = 9; static const ipad = 9;
} }

View File

@@ -1,5 +0,0 @@
class JoinSource {
static const invited = 2;
static const search = 3;
static const QRCode = 4;
}

View File

@@ -1,4 +1,4 @@
/// Callback Types /// callback类型
class ListenerType { class ListenerType {
static const simpleMsgListener = 'simpleMsgListener'; static const simpleMsgListener = 'simpleMsgListener';
static const connectListener = 'connectListener'; static const connectListener = 'connectListener';
@@ -15,5 +15,4 @@ class ListenerType {
static const messageKvInfoListener = "messageKvInfoListener"; static const messageKvInfoListener = "messageKvInfoListener";
static const listenerForService = "listenerForService"; static const listenerForService = "listenerForService";
static const uploadFileListener = "uploadFileListener"; static const uploadFileListener = "uploadFileListener";
static const uploadLogsListener = "uploadLogsListener";
} }

View File

@@ -1,14 +1,14 @@
/// Message Send Status /// 消息发送状态
class MessageStatus { class MessageStatus {
/// Sending /// 发送中
static const sending = 1; static const sending = 1;
/// Successfully sent /// 已发送成功
static const succeeded = 2; static const succeeded = 2;
/// Send failed /// 发送失败
static const failed = 3; static const failed = 3;
/// Already deleted /// 已经删除
static const deleted = 4; static const deleted = 4;
} }

View File

@@ -1,176 +1,171 @@
/// Message Types /// 消息类型
class MessageType { class MessageType {
/// Normal text /// 普通文本
static const text = 101; static const text = 101;
/// Picture /// 图片
static const picture = 102; static const picture = 102;
/// Voice /// 语音
static const voice = 103; static const voice = 103;
/// Video /// 视频
static const video = 104; static const video = 104;
/// File /// 文件
static const file = 105; static const file = 105;
/// @ Message /// @消息
static const atText = 106; static const at_text = 106;
/// Merge /// 合并
static const merger = 107; static const merger = 107;
/// Business Card /// 名片
static const card = 108; static const card = 108;
/// Location /// 位置
static const location = 109; static const location = 109;
/// Custom /// 自定义
static const custom = 110; static const custom = 110;
/// Typing /// 已读回执
static const has_read_receipt = 112;
/// 正字输入
static const typing = 113; static const typing = 113;
/// Quote Reply /// 引用回复
static const quote = 114; static const quote = 114;
/// Custom Emoji /// 自定义表情
static const customFace = 115; static const custom_face = 115;
/// Group Message Has Read Receipt (Deprecated in v3) /// 群消息已读回执
@Deprecated('Use GroupHasReadReceiptNotification instead')
static const groupHasReadReceipt = 116; static const groupHasReadReceipt = 116;
/// Rich Text Message /// 富文本消息
static const advancedText = 117; static const advancedText = 117;
static const customMsgNotTriggerConversation = 119; static const customMsgNotTriggerConversation = 119;
static const customMsgOnlineOnly = 120; static const customMsgOnlineOnly = 120;
/// Notification Types /// 通知类型
static const notificationBegin = 1000; static const notificationBegin = 1000;
static const friendNotificationBegin = 1200; static const friendNotificationBegin = 1200;
/// Friend Request Accepted /// 好友申请已接受
static const friendApplicationApprovedNotification = 1201; static const friendApplicationApprovedNotification = 1201;
/// Friend Request Rejected /// 好友申请已拒绝
static const friendApplicationRejectedNotification = 1202; static const friendApplicationRejectedNotification = 1202;
/// Friend Request /// 好友申请
static const friendApplicationNotification = 1203; static const friendApplicationNotification = 1203;
/// Friend Added /// 好友已添加
static const friendAddedNotification = 1204; static const friendAddedNotification = 1204;
/// Friend Deleted /// 好友已删除
static const friendDeletedNotification = 1205; static const friendDeletedNotification = 1205;
/// Set Friend Remark /// 设置好友备注
static const friendRemarkSetNotification = 1206; static const friendRemarkSetNotification = 1206;
/// Friend Added to Blacklist /// 好友加入黑名单
static const blackAddedNotification = 1207; static const blackAddedNotification = 1207;
/// Removed from Blacklist /// 已从黑名单移除
static const blackDeletedNotification = 1208; static const blackDeletedNotification = 1208;
static const friendNotificationEnd = 1299; static const friendNotificationEnd = 1299;
/// Conversation Change /// 会话改变
static const conversationChangeNotification = 1300; static const conversationChangeNotification = 1300;
static const userNotificationBegin = 1301; static const userNotificationBegin = 1301;
/// User Information Changed /// 用户信息改变
static const userInfoUpdatedNotification = 1303; static const userInfoUpdatedNotification = 1303;
static const userNotificationEnd = 1399; static const userNotificationEnd = 1399;
/// OA Notification /// OA通知
static const oaNotification = 1400; static const oaNotification = 1400;
static const groupNotificationBegin = 1500; static const groupNotificationBegin = 1500;
/// Group Created /// 群已被创建
static const groupCreatedNotification = 1501; static const groupCreatedNotification = 1501;
/// Group Info Set /// 群资料改变
static const groupInfoSetNotification = 1502; static const groupInfoSetNotification = 1502;
/// Join Group Application /// 进群申请
static const joinGroupApplicationNotification = 1503; static const joinGroupApplicationNotification = 1503;
/// Group Member Quit /// 群成员退出
static const memberQuitNotification = 1504; static const memberQuitNotification = 1504;
/// Group Application Accepted /// 群申请被接受
static const groupApplicationAcceptedNotification = 1505; static const groupApplicationAcceptedNotification = 1505;
/// Group Application Rejected /// 群申请被拒绝
static const groupApplicationRejectedNotification = 1506; static const groupApplicationRejectedNotification = 1506;
/// Group Owner Transferred /// 群拥有者权限转移
static const groupOwnerTransferredNotification = 1507; static const groupOwnerTransferredNotification = 1507;
/// Member Kicked from Group /// 群成员被踢出群
static const memberKickedNotification = 1508; static const memberKickedNotification = 1508;
/// Member Invited to Group /// 邀请进群
static const memberInvitedNotification = 1509; static const memberInvitedNotification = 1509;
/// Member Entered Group /// 群成员进群
static const memberEnterNotification = 1510; static const memberEnterNotification = 1510;
/// Dismiss Group /// 解散群
static const dismissGroupNotification = 1511; static const dismissGroupNotification = 1511;
static const groupNotificationEnd = 1599; static const groupNotificationEnd = 1599;
/// Group Member Muted /// 群成员被禁言
static const groupMemberMutedNotification = 1512; static const groupMemberMutedNotification = 1512;
/// Group Member Cancel Muted /// 群成员被取消禁言
static const groupMemberCancelMutedNotification = 1513; static const groupMemberCancelMutedNotification = 1513;
/// Group Muted /// 群禁言
static const groupMutedNotification = 1514; static const groupMutedNotification = 1514;
/// Cancel Group Muted /// 取消群禁言
static const groupCancelMutedNotification = 1515; static const groupCancelMutedNotification = 1515;
/// Group Member Information Changed /// 群成员信息改变
static const groupMemberInfoChangedNotification = 1516; static const groupMemberInfoChangedNotification = 1516;
/// Group Member Set to Admin /// 群公告修改
static const groupMemberSetToAdminNotification = 1517; static const groupNoticeChangedNotification = 1519;
static const groupMemberSetToOrdinaryUserNotification = 1518; /// 群名字修改
static const groupNameChangedNotification = 1520;
/// Group Notice Changed static const signalingNotificationBegin = 1600;
static const groupInfoSetAnnouncementNotification = 1519;
/// Group Name Changed /// 信令
static const groupInfoSetNameNotification = 1520; static const signalingNotification = 1601;
/// Burn After Reading static const signalingNotificationEnd = 1699;
/// 阅后即焚
static const burnAfterReadingNotification = 1701; static const burnAfterReadingNotification = 1701;
static const notificationEnd = 2000; static const notificationEnd = 2000;
/// Business Notification /// 撤回消息
static const businessNotification = 2001;
/// Recall Message
static const revokeMessageNotification = 2101; static const revokeMessageNotification = 2101;
/// Single Chat Has Read Receipt
static const signalHasReadReceiptNotification = 2150;
/// Group Chat Has Read Receipt
static const groupHasReadReceiptNotification = 2155;
} }

View File

@@ -1,5 +0,0 @@
class ReceiveMessageOpt {
static const receive = 0;
static const notReceive = 1;
static const notNotify = 2;
}

View File

@@ -1,4 +0,0 @@
class AllowType {
static const black = 0;
static const friend = 1;
}

View File

@@ -1,155 +1,172 @@
/// SDK Error Codes // /// 消息发送失败
// class MessageFailedCode {
// /// 被对方拉黑
// static const int blockedByFriend = 1302;
//
// /// 被对方删除
// static const int deletedByFriend = 1303;
//
// /// 已被移除群聊/群已解散
// static const int notInGroup = 1204;
// }
//
// /// 添加好友失败
// class AddFriendFailedCode {
// /// 该用户已设置不可添加
// static const int refuseToAddFriends = 10013;
// }
class SDKErrorCode { class SDKErrorCode {
/// Network Request Error /// 网络请求错误
static const int networkRequestError = 10000; static const int networkRequestError = 10000;
/// Network Waiting Timeout Error /// 网络等待超时错误
static const int networkWaitTimeoutError = 10001; static const int networkWaitTimeoutError = 10001;
/// Parameter Error /// 参数错误
static const int parameterError = 10002; static const int parameterError = 10002;
/// Context Timeout Error, usually when the user has already logged out /// 上下文超时错误,通常为用户已经退出
static const int contextTimeoutError = 10003; static const int contextTimeoutError = 10003;
/// Resources not loaded completely, usually uninitialized or login hasn't completed /// 资源未加载完毕,通常为未初始化,或者登录接口还未成功返回
static const int resourceNotLoaded = 10004; static const int resourceNotLoaded = 10004;
/// Unknown Error, check the error message for details /// 未知错误,需要根据 errmsg 确认原因
static const int unknownError = 10005; static const int unknownError = 10005;
/// SDK Internal Error, check the error message for details /// sdk 内部错误,需要根据 errmsg 确认原因
static const int sdkInternalError = 10006; static const int sdkInternalError = 10006;
/// This user has set not to be added /// 该用户已设置不可添加
static const int refuseToAddFriends = 10013; static const int refuseToAddFriends = 10013;
/// User does not exist or is not registered /// 用户不存在或未注册
static const int userNotExistOrNotRegistered = 10100; static const int userNotExistOrNotRegistered = 10100;
/// User has already logged out /// 用户已经退出登录
static const int userHasLoggedOut = 10101; static const int userHasLoggedOut = 10101;
/// User is attempting to log in again, check the login status to avoid duplicate logins /// 用户重复登录,可以通过 getloginstatus 确认登录状态,避免重复登录
static const int repeatLogin = 10102; static const int repeatLogin = 10102;
/// The file to upload does not exist /// 需要上传的文件不存在
static const int uploadFileNotExist = 10200; static const int uploadFileNotExist = 10200;
/// Message decompression failed /// 消息解压失败
static const int messageDecompressionFailed = 10201; static const int messageDecompressionFailed = 10201;
/// Message decoding failed /// 消息解码失败
static const int messageDecodingFailed = 10202; static const int messageDecodingFailed = 10202;
/// Unsupported long connection binary protocol /// 不支持的长连接二进制协议
static const int unsupportedLongConnection = 10203; static const int unsupportedLongConnection = 10203;
/// Message sent multiple times /// 消息重复发送
static const int messageRepeated = 10204; static const int messageRepeated = 10204;
/// Message content type not supported /// 消息内容类型不支持
static const int messageContentTypeNotSupported = 10205; static const int messageContentTypeNotSupported = 10205;
/// Unsupported session operation /// 不支持的会话操作
static const int unsupportedSessionOperation = 10301; static const int unsupportedSessionOperation = 10301;
/// Group ID does not exist /// 群 ID 不存在
static const int groupIDNotExist = 10400; static const int groupIDNotExist = 10400;
/// Group type is incorrect /// 群组类型错误
static const int wrongGroupType = 10401; static const int wrongGroupType = 10401;
/// Server Internal Error, usually an internal network error, check if server nodes are running correctly /// 服务器内部错误,通常为内部网络错误,需要检查服务器各节点运行是否正常
static const int serverInternalError = 500; static const int serverInternalError = 500;
/// Parameter Error on the server, check if body and header parameters are correct /// 参数错误,需要检查 body 参数以及 header 参数是否正确
static const int serverParameterError = 1001; static const int serverParameterError = 1001;
/// Insufficient Permissions, typically when the token in the header is incorrect or when trying to perform unauthorized actions /// 权限不足,一般为 header 参数中携带 token 不正确,或者权限越级操作
static const int insufficientPermissions = 1002; static const int insufficientPermissions = 1002;
/// Duplicate Database Primary Key /// 数据库主键重复
static const int duplicateDatabasePrimaryKey = 1003; static const int duplicateDatabasePrimaryKey = 1003;
/// Database Record Not Found /// 数据库记录未找到
static const int databaseRecordNotFound = 1004; static const int databaseRecordNotFound = 1004;
/// User ID does not exist /// 用户 ID 不存在
static const int userIDNotExist = 1101; static const int userIDNotExist = 1101;
/// User is already registered /// 用户已经注册
static const int userAlreadyRegistered = 1102; static const int userAlreadyRegistered = 1102;
/// Group does not exist /// 群不存在
static const int groupNotExis = 1201; static const int groupNotExis = 1201;
/// Group already exists /// 群已存在
static const int groupAlreadyExists = 1202; static const int groupAlreadyExists = 1202;
/// User is not in the group /// 用户不在群组中
static const int userIsNotInGroup = 1203; static const int userIsNotInGroup = 1203;
/// Group has been disbanded /// 群组已解散
static const int groupDisbanded = 1204; static const int groupDisbanded = 1204;
/// Group application has already been processed, no need to process it again /// 群申请已经被处理,不需要重复处理
static const int groupApplicationHasBeenProcessed = 1206; static const int groupApplicationHasBeenProcessed = 1206;
/// Cannot add yourself as a friend /// 不能添加自己为好友
static const int notAddMyselfAsAFriend = 1301; static const int notAddMyselfAsAFriend = 1301;
/// You have been blocked by the other party /// 已被对方拉黑
static const int hasBeenBlocked = 1302; static const int hasBeenBlocked = 1302;
/// The other party is not your friend /// 对方不是自己的好友
static const int notFriend = 1303; static const int notFriend = 1303;
/// Already in a friend relationship, no need to reapply /// 已经是好友关系,不需要重复申请
static const int alreadyAFriendRelationship = 1304; static const int alreadyAFriendRelationship = 1304;
/// Message read function is turned off /// 消息已读功能被关闭
static const int messageReadFunctionIsTurnedOff = 1401; static const int messageReadFunctionIsTurnedOff = 1401;
/// You have been banned from speaking in the group /// 你已被禁言,不能在群里发言
static const int youHaveBeenBanned = 1402; static const int youHaveBeenBanned = 1402;
/// The group has been banned from posting /// 群已被禁言,不能发言
static const int groupHasBeenBanned = 1403; static const int groupHasBeenBanned = 1403;
/// This message has been retracted /// 该消息已被撤回
static const int messageHasBeenRetracted = 1404; static const int messageHasBeenRetracted = 1404;
/// Authorization has expired /// 授权过期
static const int licenseExpired = 1405; static const int licenseExpired = 1405;
/// Token has expired /// token 已经过期
static const int tokenHasExpired = 1501; static const int tokenHasExpired = 1501;
/// Invalid token /// token 无效
static const int tokenInvalid = 1502; static const int tokenInvalid = 1502;
/// Token format error /// token 格式错误
static const int tokenFormatError = 1503; static const int tokenFormatError = 1503;
/// Token has not yet taken effect /// token 还未生效
static const int tokenHasNotYetTakenEffect = 1504; static const int tokenHasNotYetTakenEffect = 1504;
/// Unknown token error /// 未知 token 错误
static const int unknownTokenError = 1505; static const int unknownTokenError = 1505;
/// The kicked-out token is invalid /// 被踢出的 token无效
static const int thekickedOutTokenIsInvalid = 1506; static const int thekickedOutTokenIsInvalid = 1506;
/// Token does not exist /// token 不存在
static const int tokenNotExist = 1507; static const int tokenNotExist = 1507;
/// Number of Connections Exceeds Gateway's Maximum Limit /// 连接数超过网关最大限制
static const int connectionsExceedsMaximumLimit = 1601; static const int connectionsExceedsMaximumLimit = 1601;
/// Handshake Parameter Error /// 连接握手参数错误
static const int handshakeParameterError = 1602; static const int handshakeParameterError = 1602;
/// File Upload Expired /// 文件上传过期
static const int fileUploadExpired = 1701; static const int fileUploadExpired = 1701;
} }

View File

@@ -1,15 +1,16 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Message Listener /// 消息监听
class OnAdvancedMsgListener { class OnAdvancedMsgListener {
Function(Message msg)? onMsgDeleted; Function(Message msg)? onMsgDeleted;
Function(RevokedInfo info)? onNewRecvMessageRevoked; Function(RevokedInfo info)? onNewRecvMessageRevoked;
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt; Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt; Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsChanged;
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted; Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
Function(Message msg)? onRecvNewMessage; Function(Message msg)? onRecvNewMessage;
Function(Message msg)? onRecvOfflineNewMessage; Function(Message msg)? onRecvOfflineNewMessage;
Function(Message msg)? onRecvOnlineOnlyMessage;
/// Uniquely identifies /// Uniquely identifies
String id; String id;
@@ -19,38 +20,49 @@ class OnAdvancedMsgListener {
this.onNewRecvMessageRevoked, this.onNewRecvMessageRevoked,
this.onRecvC2CReadReceipt, this.onRecvC2CReadReceipt,
this.onRecvGroupReadReceipt, this.onRecvGroupReadReceipt,
this.onRecvMessageExtensionsAdded,
this.onRecvMessageExtensionsChanged,
this.onRecvMessageExtensionsDeleted, this.onRecvMessageExtensionsDeleted,
this.onRecvNewMessage, this.onRecvNewMessage,
this.onRecvOfflineNewMessage, this.onRecvOfflineNewMessage,
this.onRecvOnlineOnlyMessage,
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}"; }) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
void msgDeleted(Message msg) { void msgDeleted(Message msg) {
onMsgDeleted?.call(msg); onMsgDeleted?.call(msg);
} }
/// Message has been retracted /// 消息被撤回
void newRecvMessageRevoked(RevokedInfo info) { void newRecvMessageRevoked(RevokedInfo info) {
onNewRecvMessageRevoked?.call(info); onNewRecvMessageRevoked?.call(info);
} }
/// C2C Message Read Receipt /// C2C消息已读回执
void recvC2CReadReceipt(List<ReadReceiptInfo> list) { void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
onRecvC2CReadReceipt?.call(list); onRecvC2CReadReceipt?.call(list);
} }
/// Group Message Read Receipt /// 群消息已读回执
void recvGroupReadReceipt(List<ReadReceiptInfo> list) { void recvGroupReadReceipt(List<ReadReceiptInfo> list) {
onRecvGroupReadReceipt?.call(list); onRecvGroupReadReceipt?.call(list);
} }
/// Received Extended Message Deleted /// 收到拓展消息kv新增
/// [list] TypeKey that was deleted void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsAdded?.call(msgID, list);
}
/// 收到拓展消息kv改变
void recvMessageExtensionsChanged(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsChanged?.call(msgID, list);
}
/// 收到扩展消息被删除
/// [list] 被删除的TypeKey
void recvMessageExtensionsDeleted(String msgID, List<String> list) { void recvMessageExtensionsDeleted(String msgID, List<String> list) {
onRecvMessageExtensionsDeleted?.call(msgID, list); onRecvMessageExtensionsDeleted?.call(msgID, list);
} }
/// Received a new message /// 收到了一条新消息
void recvNewMessage(Message msg) { void recvNewMessage(Message msg) {
onRecvNewMessage?.call(msg); onRecvNewMessage?.call(msg);
} }
@@ -58,8 +70,4 @@ class OnAdvancedMsgListener {
void recvOfflineNewMessage(Message msg) { void recvOfflineNewMessage(Message msg) {
onRecvOfflineNewMessage?.call(msg); onRecvOfflineNewMessage?.call(msg);
} }
void recvOnlineOnlyMessage(Message msg) {
onRecvOnlineOnlyMessage?.call(msg);
}
} }

View File

@@ -1,4 +1,4 @@
/// SDK Connection State Listener /// SDK 连接状态监听
class OnConnectListener { class OnConnectListener {
Function(int? code, String? errorMsg)? onConnectFailed; Function(int? code, String? errorMsg)? onConnectFailed;
Function()? onConnectSuccess; Function()? onConnectSuccess;
@@ -14,27 +14,27 @@ class OnConnectListener {
this.onUserTokenExpired, this.onUserTokenExpired,
}); });
/// SDK failed to connect to the server /// SDK连接服务器失败
void connectFailed(int? code, String? errorMsg) { void connectFailed(int? code, String? errorMsg) {
onConnectFailed?.call(code, errorMsg); onConnectFailed?.call(code, errorMsg);
} }
/// SDK successfully connected to the server /// SDK连接服务器成功
void connectSuccess() { void connectSuccess() {
onConnectSuccess?.call(); onConnectSuccess?.call();
} }
/// SDK is currently connecting to the server /// SDK正在连接服务器
void connecting() { void connecting() {
onConnecting?.call(); onConnecting?.call();
} }
/// The account has been logged in from another location, and the current device has been kicked offline /// 账号已在其他地方登录,当前设备被踢下线
void kickedOffline() { void kickedOffline() {
onKickedOffline?.call(); onKickedOffline?.call();
} }
/// Login credentials have expired and require reauthentication /// 登录凭证过期,需要重新登录
void userTokenExpired() { void userTokenExpired() {
onUserTokenExpired?.call(); onUserTokenExpired?.call();
} }

View File

@@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Conversation Listener /// 会话监听
class OnConversationListener { class OnConversationListener {
Function(List<ConversationInfo> list)? onConversationChanged; Function(List<ConversationInfo> list)? onConversationChanged;
Function(List<ConversationInfo> list)? onNewConversation; Function(List<ConversationInfo> list)? onNewConversation;
@@ -18,19 +18,19 @@ class OnConversationListener {
this.onSyncServerStart, this.onSyncServerStart,
}); });
/// Conversations have changed /// 会话发生改变
void conversationChanged(List<ConversationInfo> list) { void conversationChanged(List<ConversationInfo> list) {
onConversationChanged?.call(list); onConversationChanged?.call(list);
} }
/// New conversations have been created /// 有新会话产生
void newConversation(List<ConversationInfo> list) { void newConversation(List<ConversationInfo> list) {
onNewConversation?.call(list); onNewConversation?.call(list);
} }
/// Total unread message count has changed /// 未读消息总数发送改变
void totalUnreadMessageCountChanged(int count) { void totalUnreadMessageCountChanged(int i) {
onTotalUnreadMessageCountChanged?.call(count); onTotalUnreadMessageCountChanged?.call(i);
} }
void syncServerFailed() { void syncServerFailed() {

View File

@@ -1,16 +1,16 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Friendship Listener /// 好友关系监听
class OnFriendshipListener { class OnFriendshipListener {
Function(BlacklistInfo info)? onBlackAdded; Function(BlacklistInfo i)? onBlackAdded;
Function(BlacklistInfo info)? onBlackDeleted; Function(BlacklistInfo i)? onBlackDeleted;
Function(FriendInfo info)? onFriendAdded; Function(FriendInfo i)? onFriendAdded;
Function(FriendApplicationInfo info)? onFriendApplicationAccepted; Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
Function(FriendApplicationInfo info)? onFriendApplicationAdded; Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(FriendApplicationInfo info)? onFriendApplicationDeleted; Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
Function(FriendApplicationInfo info)? onFriendApplicationRejected; Function(FriendApplicationInfo i)? onFriendApplicationRejected;
Function(FriendInfo info)? onFriendDeleted; Function(FriendInfo i)? onFriendDeleted;
Function(FriendInfo info)? onFriendInfoChanged; Function(FriendInfo i)? onFriendInfoChanged;
OnFriendshipListener({ OnFriendshipListener({
this.onBlackAdded, this.onBlackAdded,
@@ -24,48 +24,48 @@ class OnFriendshipListener {
this.onFriendInfoChanged, this.onFriendInfoChanged,
}); });
/// Added to the blacklist /// 已被加入黑名单
void blackAdded(BlacklistInfo info) { void blackAdded(BlacklistInfo u) {
onBlackAdded?.call(info); onBlackAdded?.call(u);
} }
/// Removed from the blacklist /// 已从黑名单移除
void blackDeleted(BlacklistInfo info) { void blackDeleted(BlacklistInfo u) {
onBlackDeleted?.call(info); onBlackDeleted?.call(u);
} }
/// Friend added /// 好友已添加
void friendAdded(FriendInfo info) { void friendAdded(FriendInfo u) {
onFriendAdded?.call(info); onFriendAdded?.call(u);
} }
/// Friend application accepted /// 好友申请已被接受
void friendApplicationAccepted(FriendApplicationInfo info) { void friendApplicationAccepted(FriendApplicationInfo u) {
onFriendApplicationAccepted?.call(info); onFriendApplicationAccepted?.call(u);
} }
/// New friend application added /// 已添加新的好友申请
void friendApplicationAdded(FriendApplicationInfo info) { void friendApplicationAdded(FriendApplicationInfo u) {
onFriendApplicationAdded?.call(info); onFriendApplicationAdded?.call(u);
} }
/// Friend application deleted /// 好友申请已被删除
void friendApplicationDeleted(FriendApplicationInfo info) { void friendApplicationDeleted(FriendApplicationInfo u) {
onFriendApplicationDeleted?.call(info); onFriendApplicationDeleted?.call(u);
} }
/// Friend application rejected /// 好友申请已被拒绝
void friendApplicationRejected(FriendApplicationInfo info) { void friendApplicationRejected(FriendApplicationInfo u) {
onFriendApplicationRejected?.call(info); onFriendApplicationRejected?.call(u);
} }
/// Friend deleted /// 好友已被删除
void friendDeleted(FriendInfo info) { void friendDeleted(FriendInfo u) {
onFriendDeleted?.call(info); onFriendDeleted?.call(u);
} }
/// Friend information changed /// 好友资料发生改变
void friendInfoChanged(FriendInfo info) { void friendInfoChanged(FriendInfo u) {
onFriendInfoChanged?.call(info); onFriendInfoChanged?.call(u);
} }
} }

View File

@@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Group Listener /// 群组监听
class OnGroupListener { class OnGroupListener {
Function(GroupApplicationInfo info)? onGroupApplicationAccepted; Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
Function(GroupApplicationInfo info)? onGroupApplicationAdded; Function(GroupApplicationInfo info)? onGroupApplicationAdded;
@@ -28,22 +28,22 @@ class OnGroupListener {
this.onJoinedGroupDeleted, this.onJoinedGroupDeleted,
}); });
/// Group application accepted /// 群申请已被接受
void groupApplicationAccepted(GroupApplicationInfo info) { void groupApplicationAccepted(GroupApplicationInfo info) {
onGroupApplicationAccepted?.call(info); onGroupApplicationAccepted?.call(info);
} }
/// Group application added /// 群申请已被添加
void groupApplicationAdded(GroupApplicationInfo info) { void groupApplicationAdded(GroupApplicationInfo info) {
onGroupApplicationAdded?.call(info); onGroupApplicationAdded?.call(info);
} }
/// Group application deleted /// 群申请已被删除
void groupApplicationDeleted(GroupApplicationInfo info) { void groupApplicationDeleted(GroupApplicationInfo info) {
onGroupApplicationDeleted?.call(info); onGroupApplicationDeleted?.call(info);
} }
/// Group application rejected /// 群申请已被拒绝
void groupApplicationRejected(GroupApplicationInfo info) { void groupApplicationRejected(GroupApplicationInfo info) {
onGroupApplicationRejected?.call(info); onGroupApplicationRejected?.call(info);
} }
@@ -52,32 +52,32 @@ class OnGroupListener {
onGroupDismissed?.call(info); onGroupDismissed?.call(info);
} }
/// Group information changed /// 群资料发生改变
void groupInfoChanged(GroupInfo info) { void groupInfoChanged(GroupInfo info) {
onGroupInfoChanged?.call(info); onGroupInfoChanged?.call(info);
} }
/// Group member added /// 群成员已添加
void groupMemberAdded(GroupMembersInfo info) { void groupMemberAdded(GroupMembersInfo info) {
onGroupMemberAdded?.call(info); onGroupMemberAdded?.call(info);
} }
/// Group member deleted /// 群成员已删除
void groupMemberDeleted(GroupMembersInfo info) { void groupMemberDeleted(GroupMembersInfo info) {
onGroupMemberDeleted?.call(info); onGroupMemberDeleted?.call(info);
} }
/// Group member information changed /// 群成员信息发送改变
void groupMemberInfoChanged(GroupMembersInfo info) { void groupMemberInfoChanged(GroupMembersInfo info) {
onGroupMemberInfoChanged?.call(info); onGroupMemberInfoChanged?.call(info);
} }
/// Joined group added /// 已加入的群有新增
void joinedGroupAdded(GroupInfo info) { void joinedGroupAdded(GroupInfo info) {
onJoinedGroupAdded?.call(info); onJoinedGroupAdded?.call(info);
} }
/// Joined group deleted /// 已加入的群减少
void joinedGroupDeleted(GroupInfo info) { void joinedGroupDeleted(GroupInfo info) {
onJoinedGroupDeleted?.call(info); onJoinedGroupDeleted?.call(info);
} }

View File

@@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Friend Relationship Listener /// 好友关系监听
class OnListenerForService { class OnListenerForService {
Function(FriendApplicationInfo i)? onFriendApplicationAdded; Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(FriendApplicationInfo i)? onFriendApplicationAccepted; Function(FriendApplicationInfo i)? onFriendApplicationAccepted;

View File

@@ -0,0 +1,11 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OnMessageKvInfoListener {
Function(List<MessageKv> list)? onMessageKvInfoChanged;
OnMessageKvInfoListener({this.onMessageKvInfoChanged});
void messageKvInfoChanged(List<MessageKv> list) {
onMessageKvInfoChanged?.call(list);
}
}

View File

@@ -1,10 +1,10 @@
/// Message Sending Progress Listener /// 消息发送进度监听
class OnMsgSendProgressListener { class OnMsgSendProgressListener {
Function(String clientMsgID, int progress)? onProgress; Function(String clientMsgID, int progress)? onProgress;
OnMsgSendProgressListener({this.onProgress}); OnMsgSendProgressListener({this.onProgress});
/// Message sending progress /// 消息发送进度
void progress(String clientMsgID, int progress) { void progress(String clientMsgID, int progress) {
onProgress?.call(clientMsgID, progress); onProgress?.call(clientMsgID, progress);
} }

View File

@@ -0,0 +1,88 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 信令监听
class OnSignalingListener {
final Function(SignalingInfo info)? onInvitationCancelled;
final Function(SignalingInfo info)? onInvitationTimeout;
final Function(SignalingInfo info)? onInviteeAccepted;
final Function(SignalingInfo info)? onInviteeRejected;
final Function(SignalingInfo info)? onReceiveNewInvitation;
final Function(SignalingInfo info)? onInviteeRejectedByOtherDevice;
final Function(SignalingInfo info)? onInviteeAcceptedByOtherDevice;
final Function(SignalingInfo info)? onHangup;
final Function(RoomCallingInfo info)? onRoomParticipantConnected;
final Function(RoomCallingInfo info)? onRoomParticipantDisconnected;
final Function(MeetingStreamEvent event)? onMeetingStreamChanged;
final Function(CustomSignaling info)? onReceiveCustomSignal;
OnSignalingListener({
this.onInvitationCancelled,
this.onInvitationTimeout,
this.onInviteeAccepted,
this.onInviteeRejected,
this.onReceiveNewInvitation,
this.onInviteeAcceptedByOtherDevice,
this.onInviteeRejectedByOtherDevice,
this.onHangup,
this.onRoomParticipantConnected,
this.onRoomParticipantDisconnected,
this.onMeetingStreamChanged,
this.onReceiveCustomSignal,
});
/// 被邀请者收到:邀请者取消音视频通话
void invitationCancelled(SignalingInfo info) {
onInvitationCancelled?.call(info);
}
/// 邀请者收到:被邀请者超时未接通
void invitationTimeout(SignalingInfo info) {
onInvitationTimeout?.call(info);
}
/// 邀请者收到:被邀请者同意音视频通话
void inviteeAccepted(SignalingInfo info) {
onInviteeAccepted?.call(info);
}
/// 邀请者收到:被邀请者拒绝音视频通话
void inviteeRejected(SignalingInfo info) {
onInviteeRejected?.call(info);
}
/// 被邀请者收到:音视频通话邀请
void receiveNewInvitation(SignalingInfo info) {
onReceiveNewInvitation?.call(info);
}
/// 被邀请者其他端收到比如被邀请者在手机拒接在pc上会收到此回调
void inviteeAcceptedByOtherDevice(SignalingInfo info) {
onInviteeAcceptedByOtherDevice?.call(info);
}
/// 被邀请者其他端收到比如被邀请者在手机拒接在pc上会收到此回调
void inviteeRejectedByOtherDevice(SignalingInfo info) {
onInviteeRejectedByOtherDevice?.call(info);
}
/// 被挂断
void hangup(SignalingInfo info) {
onHangup?.call(info);
}
void roomParticipantConnected(RoomCallingInfo info) {
onRoomParticipantConnected?.call(info);
}
void roomParticipantDisconnected(RoomCallingInfo info) {
onRoomParticipantDisconnected?.call(info);
}
void streamChangedEvent(MeetingStreamEvent event) {
onMeetingStreamChanged?.call(event);
}
void receiveCustomSignal(CustomSignaling info) {
onReceiveCustomSignal?.call(info);
}
}

View File

@@ -1,12 +1,3 @@
class OnUploadLogsListener {
Function(int current, int size)? onUploadProgress;
OnUploadLogsListener({this.onUploadProgress});
void onProgress(int current, int size) {
onUploadProgress?.call(current, size);
}
}
class OnUploadFileListener { class OnUploadFileListener {
Function(String id, int size, String url, int type)? onComplete; Function(String id, int size, String url, int type)? onComplete;
Function(String id, String partHash, String fileHash)? onHashPartComplete; Function(String id, String partHash, String fileHash)? onHashPartComplete;

View File

@@ -1,20 +1,14 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Current User Profile Listener /// 当前用户资料监听
class OnUserListener { class OnUserListener {
/// The information of the logged-in user has been updated /// The information of the logged-in user has been updated
Function(UserInfo info)? onSelfInfoUpdated; Function(UserInfo info)? onSelfInfoUpdated;
Function(UserStatusInfo info)? onUserStatusChanged;
OnUserListener({this.onSelfInfoUpdated, this.onUserStatusChanged}); OnUserListener({this.onSelfInfoUpdated});
/// Callback for changes in user's own information /// 自身信息发送变化回调
void selfInfoUpdated(UserInfo info) { void selfInfoUpdated(UserInfo info) {
onSelfInfoUpdated?.call(info); onSelfInfoUpdated?.call(info);
} }
/// Callback for changes in user status
void userStatusChanged(UserStatusInfo info) {
onUserStatusChanged?.call(info);
}
} }

View File

@@ -9,24 +9,27 @@ class ConversationManager {
ConversationManager(this._channel); ConversationManager(this._channel);
/// Conversation Listener /// 会话监听
Future setConversationListener(OnConversationListener listener) { Future setConversationListener(OnConversationListener listener) {
this.listener = listener; this.listener = listener;
return _channel.invokeMethod('setConversationListener', _buildParam({})); return _channel.invokeMethod('setConversationListener', _buildParam({}));
} }
/// Get All Conversations /// 获取所有会话
Future<List<ConversationInfo>> getAllConversationList({String? operationID}) => _channel Future<List<ConversationInfo>> getAllConversationList(
.invokeMethod( {String? operationID}) =>
'getAllConversationList', _channel
_buildParam({ .invokeMethod(
"operationID": Utils.checkOperationID(operationID), 'getAllConversationList',
})) _buildParam({
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map))); "operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// Paginate Through Conversations /// 分页获取会话
/// [offset] Starting index /// [offset] 开始下标
/// [count] Number of items per page /// [count] 每页数量
Future<List<ConversationInfo>> getConversationListSplit({ Future<List<ConversationInfo>> getConversationListSplit({
int offset = 0, int offset = 0,
int count = 20, int count = 20,
@@ -40,11 +43,12 @@ class ConversationManager {
'count': count, 'count': count,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// Query a Conversation; if it doesn't exist, it will be created /// 查询会话,如果会话不存在会自动生成一个
/// [sourceID] UserID for one-on-one conversation, GroupID for group conversation /// [sourceID] 如果是单聊会话传userID如果是群聊会话传GroupID
/// [sessionType] Reference [ConversationType] /// [sessionType] 参考[ConversationType]
Future<ConversationInfo> getOneConversation({ Future<ConversationInfo> getOneConversation({
required String sourceID, required String sourceID,
required int sessionType, required int sessionType,
@@ -58,10 +62,11 @@ class ConversationManager {
"sessionType": sessionType, "sessionType": sessionType,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => ConversationInfo.fromJson(map))); .then((value) =>
Utils.toObj(value, (map) => ConversationInfo.fromJson(map)));
/// Get Multiple Conversations by Conversation ID /// 根据会话id获取多个会话
/// [conversationIDList] List of conversation IDs /// [conversationIDList] 会话id列表
Future<List<ConversationInfo>> getMultipleConversation({ Future<List<ConversationInfo>> getMultipleConversation({
required List<String> conversationIDList, required List<String> conversationIDList,
String? operationID, String? operationID,
@@ -73,11 +78,12 @@ class ConversationManager {
"conversationIDList": conversationIDList, "conversationIDList": conversationIDList,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// Set Conversation Draft /// 设置会话草稿
/// [conversationID] Conversation ID /// [conversationID] 会话id
/// [draftText] Draft text /// [draftText] 草稿
Future setConversationDraft({ Future setConversationDraft({
required String conversationID, required String conversationID,
required String draftText, required String draftText,
@@ -91,9 +97,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Pin a Conversation /// 置顶会话
/// [conversationID] Conversation ID /// [conversationID] 会话id
/// [isPinned] true: pin, false: unpin /// [isPinned] true置顶false取消置顶
Future pinConversation({ Future pinConversation({
required String conversationID, required String conversationID,
required bool isPinned, required bool isPinned,
@@ -107,8 +113,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Hide a Conversation /// 置顶会话
/// [conversationID] Conversation ID /// [conversationID] 会话id
Future hideConversation({ Future hideConversation({
required String conversationID, required String conversationID,
String? operationID, String? operationID,
@@ -120,34 +126,7 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Hide All Conversations /// 获取未读消息总数
Future hideAllConversations({
String? operationID,
}) =>
_channel.invokeMethod(
'hideAllConversations',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}));
/// Query Conversation ID
/// [sourceID] UserID for one-on-one, GroupID for group
/// [sessionType] Reference [ConversationType]
Future<dynamic> getConversationIDBySessionType({
required String sourceID,
required int sessionType,
String? operationID,
}) {
return _channel.invokeMethod(
'getConversationIDBySessionType',
_buildParam({
'sourceID': sourceID,
'sessionType': sessionType,
'operationID': Utils.checkOperationID(operationID),
}));
}
/// get total unread message count
/// int.tryParse(count) ?? 0; /// int.tryParse(count) ?? 0;
Future<dynamic> getTotalUnreadMsgCount({ Future<dynamic> getTotalUnreadMsgCount({
String? operationID, String? operationID,
@@ -158,9 +137,23 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Message Do-Not-Disturb Setting /// 查询会话id
/// [conversationID] Conversation ID /// [sourceID] 如果是单聊值传用户ID如果是群聊值传组ID
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages /// [sessionType] 参考[ConversationType]
// Future<dynamic> getConversationIDBySessionType({
// required String sourceID,
// required int sessionType,
// }) =>
// _channel.invokeMethod(
// 'getConversationIDBySessionType',
// _buildParam({
// "sourceID": sourceID,
// "sessionType": sessionType,
// }));
/// 消息免打扰设置
/// [conversationID] 会话id
/// [status] 0正常1不接受消息2接受在线消息不接受离线消息
Future<dynamic> setConversationRecvMessageOpt({ Future<dynamic> setConversationRecvMessageOpt({
required String conversationID, required String conversationID,
required int status, required int status,
@@ -174,9 +167,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Query Do-Not-Disturb Status /// 查询免打扰状态
/// [conversationIDList] List of conversation IDs /// [conversationIDList] 会话id列表
/// Returns: [{"conversationId":"single_13922222222","result":0}], result values: 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages /// 返回:[{"conversationId":"single_13922222222","result":0}]result0正常1不接受消息2接受在线消息不接受离线消息
Future<List<dynamic>> getConversationRecvMessageOpt({ Future<List<dynamic>> getConversationRecvMessageOpt({
required List<String> conversationIDList, required List<String> conversationIDList,
String? operationID, String? operationID,
@@ -190,9 +183,9 @@ class ConversationManager {
})) }))
.then((value) => Utils.toListMap(value)); .then((value) => Utils.toListMap(value));
/// Self-Destruct Messages /// 阅后即焚
/// [conversationID] Conversation ID /// [conversationID] 会话id
/// [isPrivate] true: enable, false: disable /// [isPrivate] true开启false关闭
Future<dynamic> setConversationPrivateChat({ Future<dynamic> setConversationPrivateChat({
required String conversationID, required String conversationID,
required bool isPrivate, required bool isPrivate,
@@ -206,8 +199,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Delete a Conversation Locally and from the Server /// 删除本地以及服务器的会话
/// [conversationID] Conversation ID /// [conversationID] 会话ID
Future<dynamic> deleteConversationAndDeleteAllMsg({ Future<dynamic> deleteConversationAndDeleteAllMsg({
required String conversationID, required String conversationID,
String? operationID, String? operationID,
@@ -219,8 +212,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Clear Messages in a Conversation /// 清空会话里的消息
/// [conversationID] Conversation ID /// [conversationID] 会话ID
Future<dynamic> clearConversationAndDeleteAllMsg({ Future<dynamic> clearConversationAndDeleteAllMsg({
required String conversationID, required String conversationID,
String? operationID, String? operationID,
@@ -232,8 +225,7 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Delete All Local Conversations /// 删除所有本地会话
@Deprecated('use hideAllConversations instead')
Future<dynamic> deleteAllConversationFromLocal({ Future<dynamic> deleteAllConversationFromLocal({
String? operationID, String? operationID,
}) => }) =>
@@ -243,8 +235,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Reset Mentioned (Group At) Flags [GroupAtType] /// 重置强提醒标识[GroupAtType]
/// [conversationID] Conversation ID /// [conversationID] 会话id
Future<dynamic> resetConversationGroupAtType({ Future<dynamic> resetConversationGroupAtType({
required String conversationID, required String conversationID,
String? operationID, String? operationID,
@@ -256,7 +248,7 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Query @ All Flag /// 查询@所有人标识
Future<dynamic> getAtAllTag({ Future<dynamic> getAtAllTag({
String? operationID, String? operationID,
}) => }) =>
@@ -266,11 +258,11 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Get @ All Tag /// 查询@所有人标识
String get atAllTag => 'AtAllTag'; String get atAllTag => 'AtAllTag';
/// Global Do-Not-Disturb /// 全局免打扰
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages /// [status] 0正常1不接受消息2接受在线消息不接受离线消息
Future<dynamic> setGlobalRecvMessageOpt({ Future<dynamic> setGlobalRecvMessageOpt({
required int status, required int status,
String? operationID, String? operationID,
@@ -282,9 +274,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Set Self-Destruct Message Duration /// 设置阅后即焚时长
/// [conversationID] Conversation ID /// [conversationID] 会话id
/// [burnDuration] Duration in seconds, default: 30s /// [burnDuration] 时长s默认30s
Future<dynamic> setConversationBurnDuration({ Future<dynamic> setConversationBurnDuration({
required String conversationID, required String conversationID,
int burnDuration = 30, int burnDuration = 30,
@@ -298,8 +290,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Mark Messages as Read /// 标记消息已读
/// [conversationID] Conversation ID /// [conversationID] 会话ID
/// [messageIDList] 被标记的消息clientMsgID
Future markConversationMessageAsRead({ Future markConversationMessageAsRead({
required String conversationID, required String conversationID,
String? operationID, String? operationID,
@@ -311,8 +304,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Enable Regular Deletion /// 开启定期删除
/// [isMsgDestruct] true: enable /// [isMsgDestruct] true 开启
Future<dynamic> setConversationIsMsgDestruct({ Future<dynamic> setConversationIsMsgDestruct({
required String conversationID, required String conversationID,
bool isMsgDestruct = true, bool isMsgDestruct = true,
@@ -326,8 +319,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Regularly Delete Chat Records /// 定期删除聊天记录
/// [duration] Seconds /// [duration]
Future<dynamic> setConversationMsgDestructTime({ Future<dynamic> setConversationMsgDestructTime({
required String conversationID, required String conversationID,
int duration = 1 * 24 * 60 * 60, int duration = 1 * 24 * 60 * 60,
@@ -341,43 +334,17 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// search Conversations /// 会话列表自定义排序规则。
Future<List<ConversationInfo>> searchConversations(
String name, {
String? operationID,
}) {
return _channel
.invokeMethod(
'searchConversations',
_buildParam({
'name': name,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
}
Future<List<ConversationInfo>> setConversationEx(
String conversationID, {
String? ex,
String? operationID,
}) {
return _channel
.invokeMethod(
'setConversationEx',
_buildParam({
'conversationID': conversationID,
'ex': ex,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
}
/// Custom Sort for Conversation List
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
..sort((a, b) { ..sort((a, b) {
if ((a.isPinned == true && b.isPinned == true) || (a.isPinned != true && b.isPinned != true)) { if ((a.isPinned == true && b.isPinned == true) ||
int aCompare = a.draftTextTime! > a.latestMsgSendTime! ? a.draftTextTime! : a.latestMsgSendTime!; (a.isPinned != true && b.isPinned != true)) {
int bCompare = b.draftTextTime! > b.latestMsgSendTime! ? b.draftTextTime! : b.latestMsgSendTime!; int aCompare = a.draftTextTime! > a.latestMsgSendTime!
? a.draftTextTime!
: a.latestMsgSendTime!;
int bCompare = b.draftTextTime! > b.latestMsgSendTime!
? b.draftTextTime!
: b.latestMsgSendTime!;
if (aCompare > bCompare) { if (aCompare > bCompare) {
return -1; return -1;
} else if (aCompare < bCompare) { } else if (aCompare < bCompare) {

View File

@@ -7,15 +7,15 @@ class FriendshipManager {
FriendshipManager(this._channel); FriendshipManager(this._channel);
/// Friend Relationship Listener /// 好友关系监听
Future setFriendshipListener(OnFriendshipListener listener) { Future setFriendshipListener(OnFriendshipListener listener) {
this.listener = listener; this.listener = listener;
return _channel.invokeMethod('setFriendListener', _buildParam({})); return _channel.invokeMethod('setFriendListener', _buildParam({}));
} }
/// Query Friend Information /// 查询好友信息
/// [userIDList] List of user IDs /// [userIDList] userID集合
Future<List<FullUserInfo>> getFriendsInfo({ Future<List<UserInfo>> getFriendsInfo({
required List<String> userIDList, required List<String> userIDList,
String? operationID, String? operationID,
}) => }) =>
@@ -26,11 +26,11 @@ class FriendshipManager {
"userIDList": userIDList, "userIDList": userIDList,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v))); .then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Send a Friend Request, the other party needs to accept the request to become friends. /// 发送一个好友请求,需要对方调用同意申请才能成为好友。
/// [userID] User ID to be invited /// [userID] 被邀请的用户ID
/// [reason] Remark description /// [reason] 备注说明
Future<dynamic> addFriend({ Future<dynamic> addFriend({
required String userID, required String userID,
String? reason, String? reason,
@@ -44,44 +44,40 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Get Friend Requests Sent to Me /// 获取别人加我为好友的申请
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient({String? operationID}) => _channel Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
.invokeMethod( {String? operationID}) =>
'getFriendApplicationListAsRecipient', _channel
_buildParam({ .invokeMethod(
"operationID": Utils.checkOperationID(operationID), 'getFriendApplicationListAsRecipient',
})) _buildParam({
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v))); "operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
/// Get Friend Requests Sent by Me /// 获取我发出的好友申请
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant({String? operationID}) => _channel Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant(
.invokeMethod( {String? operationID}) =>
'getFriendApplicationListAsApplicant', _channel
_buildParam({ .invokeMethod(
"operationID": Utils.checkOperationID(operationID), 'getFriendApplicationListAsApplicant',
})) _buildParam({
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v))); "operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
/// Get Friend List, including friends who have been put into the blacklist /// 获取好友列表,返回的列表包含了已拉入黑名单的好友
Future<List<FullUserInfo>> getFriendList({String? operationID}) => _channel Future<List<UserInfo>> getFriendList({String? operationID}) => _channel
.invokeMethod( .invokeMethod(
'getFriendList', 'getFriendList',
_buildParam({ _buildParam({
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v))); .then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
Future<List<FullUserInfo>> getFriendListPage({String? operationID, int offset = 0, int count = 40}) => _channel /// 获取好友列表,返回的列表包含了已拉入黑名单的好友
.invokeMethod(
'getFriendListPage',
_buildParam({
'offset': offset,
'count': count,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
/// Get Friend List, including friends who have been put into the blacklist (returns a map)
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
.invokeMethod( .invokeMethod(
'getFriendList', 'getFriendList',
@@ -90,9 +86,9 @@ class FriendshipManager {
})) }))
.then((value) => Utils.toListMap(value)); .then((value) => Utils.toListMap(value));
/// Set Friend's Remark /// 设置好友备注
/// [userID] Friend's userID /// [userID] 好友的userID
/// [remark] Friend's remark /// [remark] 好友的备注
Future<dynamic> setFriendRemark({ Future<dynamic> setFriendRemark({
required String userID, required String userID,
required String remark, required String remark,
@@ -106,32 +102,30 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Add to Blacklist /// 加入黑名单
/// [userID] Friend's ID to be added to the blacklist /// [userID] 被加入黑名单的好友ID
Future<dynamic> addBlacklist({ Future<dynamic> addBlacklist({
required String userID, required String userID,
String? ex,
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'addBlacklist', 'addBlacklist',
_buildParam({ _buildParam({
"userID": userID, "userID": userID,
"ex": ex,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Get Blacklist /// 获取黑名单列表
Future<List<BlacklistInfo>> getBlacklist({String? operationID}) => _channel Future<List<UserInfo>> getBlacklist({String? operationID}) => _channel
.invokeMethod( .invokeMethod(
'getBlacklist', 'getBlacklist',
_buildParam({ _buildParam({
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (v) => BlacklistInfo.fromJson(v))); .then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Remove from Blacklist /// 从黑名单移除
/// [userID] User ID /// [userID] 用户ID
Future<dynamic> removeBlacklist({ Future<dynamic> removeBlacklist({
required String userID, required String userID,
String? operationID, String? operationID,
@@ -143,8 +137,8 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Check Friendship Status /// 检查友好关系
/// [userIDList] List of user IDs /// [userIDList] userID列表
Future<List<FriendshipInfo>> checkFriend({ Future<List<FriendshipInfo>> checkFriend({
required List<String> userIDList, required List<String> userIDList,
String? operationID, String? operationID,
@@ -156,10 +150,11 @@ class FriendshipManager {
'userIDList': userIDList, 'userIDList': userIDList,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (v) => FriendshipInfo.fromJson(v))); .then((value) =>
Utils.toList(value, (v) => FriendshipInfo.fromJson(v)));
/// Delete Friend /// 删除好友
/// [userID] User ID /// [userID] 用户ID
Future<dynamic> deleteFriend({ Future<dynamic> deleteFriend({
required String userID, required String userID,
String? operationID, String? operationID,
@@ -171,9 +166,9 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Accept Friend Request /// 接受好友请求
/// [userID] User ID /// [userID] 用户ID
/// [handleMsg] Remark description /// [handleMsg]备注说明
Future<dynamic> acceptFriendApplication({ Future<dynamic> acceptFriendApplication({
required String userID, required String userID,
String? handleMsg, String? handleMsg,
@@ -187,9 +182,9 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Reject Friend Request /// 拒绝好友请求
/// [userID] User ID /// [userID] 用户ID
/// [handleMsg] Remark description /// [handleMsg]备注说明
Future<dynamic> refuseFriendApplication({ Future<dynamic> refuseFriendApplication({
required String userID, required String userID,
String? handleMsg, String? handleMsg,
@@ -203,12 +198,12 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Search for Friends /// 查好友
/// [keywordList] Search keywords, currently supports only one keyword search, cannot be empty /// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] Whether to search for friend IDs with keywords (note: cannot be false at the same time), defaults to false if empty /// [isSearchUserID] 是否以关键词搜索好友ID(注不可以同时为false)为空默认false
/// [isSearchNickname] Whether to search by nickname with keywords, defaults to false if empty /// [isSearchNickname] 是否以关键词搜索昵称为空默认false
/// [isSearchRemark] Whether to search by remark name with keywords, defaults to false if empty /// [isSearchRemark] 是否以关键词搜索备注名为空默认false
Future<List<SearchFriendsInfo>> searchFriends({ Future<List<FriendInfo>> searchFriends({
List<String> keywordList = const [], List<String> keywordList = const [],
bool isSearchUserID = false, bool isSearchUserID = false,
bool isSearchNickname = false, bool isSearchNickname = false,
@@ -227,21 +222,8 @@ class FriendshipManager {
}, },
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => SearchFriendsInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => FriendInfo.fromJson(map)));
Future<String?> setFriendsEx(
List<String> friendIDs, {
String? ex,
String? operationID,
}) {
return _channel.invokeMethod(
'setFriendsEx',
_buildParam({
"friendIDs": friendIDs,
"ex": ex,
"operationID": Utils.checkOperationID(operationID),
}));
}
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "friendshipManager"; param["ManagerName"] = "friendshipManager";

View File

@@ -9,52 +9,58 @@ class GroupManager {
GroupManager(this._channel); GroupManager(this._channel);
/// Group relationship listener /// 组关系监听
Future setGroupListener(OnGroupListener listener) { Future setGroupListener(OnGroupListener listener) {
this.listener = listener; this.listener = listener;
return _channel.invokeMethod('setGroupListener', _buildParam({})); return _channel.invokeMethod('setGroupListener', _buildParam({}));
} }
/// Invite users to a group, allowing them to join without approval. /// 邀请进组,直接进组无需同意。
/// [groupID] Group ID /// [groupID] ID
/// [userIDList] List of user IDs /// [userIDList] 用户ID列表
Future inviteUserToGroup({ Future<List<GroupInviteResult>> inviteUserToGroup({
required String groupID, required String groupID,
required List<String> userIDList, required List<String> userIDList,
String? reason, String? reason,
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel
'inviteUserToGroup', .invokeMethod(
_buildParam({ 'inviteUserToGroup',
'groupID': groupID, _buildParam({
'userIDList': userIDList, 'groupID': groupID,
'reason': reason, 'userIDList': userIDList,
"operationID": Utils.checkOperationID(operationID), 'reason': reason,
})); "operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
/// Remove group members /// 移除组成员
/// [groupID] Group ID /// [groupID] ID
/// [userIDList] List of user IDs /// [userIDList] 用户ID列表
/// [reason] Reason for removal /// [reason] 备注说明
Future kickGroupMember({ Future<List<GroupInviteResult>> kickGroupMember({
required String groupID, required String groupID,
required List<String> userIDList, required List<String> userIDList,
String? reason, String? reason,
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel
'kickGroupMember', .invokeMethod(
_buildParam({ 'kickGroupMember',
'groupID': groupID, _buildParam({
'userIDList': userIDList, 'groupID': groupID,
'reason': reason, 'userIDList': userIDList,
"operationID": Utils.checkOperationID(operationID), 'reason': reason,
})); "operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
/// Query group member information /// 查询组成员资料
/// [groupID] Group ID /// [groupID] ID
/// [userIDList] List of user IDs /// [userIDList] 用户ID列表
Future<List<GroupMembersInfo>> getGroupMembersInfo({ Future<List<GroupMembersInfo>> getGroupMembersInfo({
required String groupID, required String groupID,
required List<String> userIDList, required List<String> userIDList,
@@ -68,13 +74,14 @@ class GroupManager {
'userIDList': userIDList, 'userIDList': userIDList,
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Paginate and retrieve the group member list /// 分页获取组成员列表
/// [groupID] Group ID /// [groupID] ID
/// [filter] Member filter (0: All, 1: Group owner, 2: Administrator, 3: Regular member, 4: Admin + Regular member, 5: Group owner + Admin) /// [filter] 过滤成员 0所有1群主 , 2管理员3普通成员4管理员+普通成员 5,群主+管理员
/// [offset] Starting index /// [offset] 开始下标
/// [count] Total count /// [count] 总数
Future<List<GroupMembersInfo>> getGroupMemberList({ Future<List<GroupMembersInfo>> getGroupMemberList({
required String groupID, required String groupID,
int filter = 0, int filter = 0,
@@ -92,13 +99,14 @@ class GroupManager {
'count': count, 'count': count,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Paginate and retrieve the group member list as a map /// 分页获取组成员列表
/// [groupID] Group ID /// [groupID] ID
/// [filter] Member filter (0: All, 1: Group owner, 2: Administrator, 3: Regular member, 4: Admin + Regular member, 5: Group owner + Admin) /// [filter] 过滤成员 0所有1群主 , 2管理员3普通成员4管理员+普通成员 5,群主+管理员
/// [offset] Starting index /// [offset] 开始下标
/// [count] Total count /// [count] 总数
Future<List<dynamic>> getGroupMemberListMap({ Future<List<dynamic>> getGroupMemberListMap({
required String groupID, required String groupID,
int filter = 0, int filter = 0,
@@ -118,7 +126,7 @@ class GroupManager {
})) }))
.then((value) => Utils.toListMap(value)); .then((value) => Utils.toListMap(value));
/// Query the list of joined groups /// 查询已加入的组列表
Future<List<GroupInfo>> getJoinedGroupList({String? operationID}) => _channel Future<List<GroupInfo>> getJoinedGroupList({String? operationID}) => _channel
.invokeMethod( .invokeMethod(
'getJoinedGroupList', 'getJoinedGroupList',
@@ -127,17 +135,7 @@ class GroupManager {
})) }))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); .then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
Future<List<GroupInfo>> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40}) => _channel /// 查询已加入的组列表
.invokeMethod(
'getJoinedGroupListPage',
_buildParam({
'offset': offset,
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Query the list of joined groups
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
.invokeMethod( .invokeMethod(
'getJoinedGroupList', 'getJoinedGroupList',
@@ -146,8 +144,8 @@ class GroupManager {
})) }))
.then((value) => Utils.toListMap(value)); .then((value) => Utils.toListMap(value));
/// Check if the user has joined a group /// 检查是否已加入组
/// [groupID] Group ID /// [groupID] ID
Future<bool> isJoinedGroup({ Future<bool> isJoinedGroup({
required String groupID, required String groupID,
String? operationID, String? operationID,
@@ -161,11 +159,14 @@ class GroupManager {
})) }))
.then((value) => value == 'true' ? true : false); .then((value) => value == 'true' ? true : false);
/// Create a new group /// 创建一个组
/// [groupInfo] Group information /// [groupName] 群名
/// [memberUserIDs] List of user IDs to add as initial members /// [notification] 公告
/// [adminUserIDs] List of user IDs to add as administrators /// [introduction] 群介绍
/// [ownerUserID] User ID of the owner /// [faceUrl] 群头像
/// [groupType] 组类型 [GroupType]
/// [ex] 额外信息
/// [list] 初创群成员以及其角色列表[GroupMemberRole]
Future<GroupInfo> createGroup({ Future<GroupInfo> createGroup({
required GroupInfo groupInfo, required GroupInfo groupInfo,
List<String> memberUserIDs = const [], List<String> memberUserIDs = const [],
@@ -183,21 +184,47 @@ class GroupManager {
'ownerUserID': ownerUserID, 'ownerUserID': ownerUserID,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map))); .then(
(value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));
/// Edit group information /// 编辑组资料
Future<dynamic> setGroupInfo( /// [groupID] 被编辑的群ID
GroupInfo groupInfo, { /// [groupName] 新的群名
/// [notification] 新的公告
/// [introduction] 新的群介绍
/// [faceURL] 新的群头像
/// [ex] 新的额外信息
Future<dynamic> setGroupInfo({
required String groupID,
String? groupName,
String? notification,
String? introduction,
String? faceURL,
String? ex,
int? needVerification,
int? lookMemberInfo,
int? applyMemberFriend,
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'setGroupInfo', 'setGroupInfo',
_buildParam({ _buildParam({
'groupInfo': groupInfo.toJson(), 'groupInfo': {
"groupID": groupID,
"groupName": groupName,
"notification": notification,
"introduction": introduction,
"faceURL": faceURL,
"ex": ex,
'needVerification': needVerification,
'lookMemberInfo': lookMemberInfo,
'applyMemberFriend': applyMemberFriend,
},
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Query group information /// 查询组信息
/// [groupIDList] 组ID列表
Future<List<GroupInfo>> getGroupsInfo({ Future<List<GroupInfo>> getGroupsInfo({
required List<String> groupIDList, required List<String> groupIDList,
String? operationID, String? operationID,
@@ -209,21 +236,27 @@ class GroupManager {
'groupIDList': groupIDList, 'groupIDList': groupIDList,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); .then(
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Apply to join a group, requiring approval from an administrator or the group. /// 申请加入组,需要通过管理员/群组同意。
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code /// [joinSource] 2:通过邀请 3通过搜索 4通过二维码
Future<dynamic> joinGroup({required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) => _channel.invokeMethod( Future<dynamic> joinGroup({
'joinGroup', required String groupID,
_buildParam({ String? reason,
'groupID': groupID, String? operationID,
'reason': reason, int joinSource = 3,
'joinSource': joinSource, }) =>
'ex': ex, _channel.invokeMethod(
'operationID': Utils.checkOperationID(operationID), 'joinGroup',
})); _buildParam({
'groupID': groupID,
'reason': reason,
'joinSource': joinSource,
'operationID': Utils.checkOperationID(operationID),
}));
/// Exit a group /// 退出组
Future<dynamic> quitGroup({ Future<dynamic> quitGroup({
required String groupID, required String groupID,
String? operationID, String? operationID,
@@ -235,9 +268,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
// (Continuing the code) /// 转移组拥有者权限
/// [groupID] 组ID
/// Transfer group ownership /// [userID] 新拥有者ID
Future<dynamic> transferGroupOwner({ Future<dynamic> transferGroupOwner({
required String groupID, required String groupID,
required String userID, required String userID,
@@ -251,26 +284,34 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Handle group membership applications received as a group owner or administrator /// 作为群主或者管理员,收到的群成员入群申请
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({String? operationID}) => _channel Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient(
.invokeMethod( {String? operationID}) =>
'getGroupApplicationListAsRecipient', _channel
_buildParam({ .invokeMethod(
'operationID': Utils.checkOperationID(operationID), 'getGroupApplicationListAsRecipient',
})) _buildParam({
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); 'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
/// Get the list of group membership applications sent by the user /// 获取自己发出的入群申请记录
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({String? operationID}) => _channel Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant(
.invokeMethod( {String? operationID}) =>
'getGroupApplicationListAsApplicant', _channel
_buildParam({ .invokeMethod(
'operationID': Utils.checkOperationID(operationID), 'getGroupApplicationListAsApplicant',
})) _buildParam({
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); 'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
/// Accept a group membership application as an administrator or group owner /// 管理员或者群主同意某人进入某群
/// Note: Membership applications require approval from administrators or the group. /// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
/// [groupID] 组id
/// [userID] 申请者用户ID
Future<dynamic> acceptGroupApplication({ Future<dynamic> acceptGroupApplication({
required String groupID, required String groupID,
required String userID, required String userID,
@@ -286,8 +327,11 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Refuse a group membership application as an administrator or group owner /// 管理员或者群主拒绝某人进入某群
/// Note: Membership applications require approval from administrators or the group. /// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
/// [groupID] 组id
/// [userID] 申请者用户ID
/// [handleMsg] 说明
Future<dynamic> refuseGroupApplication({ Future<dynamic> refuseGroupApplication({
required String groupID, required String groupID,
required String userID, required String userID,
@@ -303,10 +347,8 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
// (Continuing the code) /// 解散群
/// [groupID] 群ID
/// Dissolve a group
/// [groupID] Group ID
Future<dynamic> dismissGroup({ Future<dynamic> dismissGroup({
required String groupID, required String groupID,
String? operationID, String? operationID,
@@ -318,9 +360,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Enable or disable group mute, preventing all group members from sending messages /// 开启群禁言,所有群成员禁止发言
/// [groupID] Group ID /// [groupID] 将开启群禁言的组ID
/// [mute] true: Enable, false: Disable /// [mute] true开启false关闭
Future<dynamic> changeGroupMute({ Future<dynamic> changeGroupMute({
required String groupID, required String groupID,
required bool mute, required bool mute,
@@ -334,10 +376,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Mute a group member /// 禁言群成员
/// [groupID] Group ID /// [groupID] ID
/// [userID] Member ID to mute /// [userID] 将被禁言的成员ID
/// [seconds] Duration of the mute in seconds (set to 0 to unmute) /// [seconds] 被禁言的时间s设置为0则为解除禁言
Future<dynamic> changeGroupMemberMute({ Future<dynamic> changeGroupMemberMute({
required String groupID, required String groupID,
required String userID, required String userID,
@@ -353,10 +395,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Set the nickname of a group member /// 设置群成员昵称
/// [groupID] Group ID /// [groupID] ID
/// [userID] User ID of the group member /// [userID] 群成员的用户ID
/// [groupNickname] Group nickname /// [groupNickname] 群昵称
Future<dynamic> setGroupMemberNickname({ Future<dynamic> setGroupMemberNickname({
required String groupID, required String groupID,
required String userID, required String userID,
@@ -372,10 +414,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Query a group /// 查询群
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty. /// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchGroupID] Whether to search by group ID (Note: cannot set both to false at the same time); defaults to false if not set. /// [isSearchGroupID] 是否以关键词搜索群ID(注两个不可以同时为false)为空默认false
/// [isSearchGroupName] Whether to search by group name; defaults to false if not set. /// [isSearchGroupName] 是否以关键词搜索群名字为空默认false
Future<List<GroupInfo>> searchGroups({ Future<List<GroupInfo>> searchGroups({
List<String> keywordList = const [], List<String> keywordList = const [],
bool isSearchGroupID = false, bool isSearchGroupID = false,
@@ -393,12 +435,13 @@ class GroupManager {
}, },
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); .then(
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Set group member role /// 设置群成员权限
/// [groupID] Group ID /// [groupID] ID
/// [userID] User ID of the group member /// [userID] 群成员的用户ID
/// [roleLevel] Role level; see [GroupRoleLevel] /// [roleLevel] 角色等级,参考[GroupRoleLevel]
Future<dynamic> setGroupMemberRoleLevel({ Future<dynamic> setGroupMemberRoleLevel({
required String groupID, required String groupID,
required String userID, required String userID,
@@ -414,14 +457,20 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Get a group member list based on join time /// 根据加入时间分页获取组成员列表
/// [groupID] 群ID
/// [joinTimeBegin] 加入开始时间
/// [joinTimeEnd] 加入结束时间
/// [offset] 开始下标
/// [count] 总数
/// [excludeUserIDList] 排除的用户
Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({ Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({
required String groupID, required String groupID,
int offset = 0, int offset = 0,
int count = 0, int count = 0,
int joinTimeBegin = 0, int joinTimeBegin = 0,
int joinTimeEnd = 0, int joinTimeEnd = 0,
List<String> filterUserIDList = const [], List<String> excludeUserIDList = const [],
String? operationID, String? operationID,
}) => }) =>
_channel _channel
@@ -433,14 +482,15 @@ class GroupManager {
'count': count, 'count': count,
'joinTimeBegin': joinTimeBegin, 'joinTimeBegin': joinTimeBegin,
'joinTimeEnd': joinTimeEnd, 'joinTimeEnd': joinTimeEnd,
'excludeUserIDList': filterUserIDList, 'excludeUserIDList': excludeUserIDList,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Set group verification for joining /// 进群验证设置
/// [groupID] Group ID /// [groupID] ID
/// [needVerification] Verification setting; see [GroupVerification] class /// [needVerification] 进群设置,参考[GroupVerification]
Future<dynamic> setGroupVerification({ Future<dynamic> setGroupVerification({
required String groupID, required String groupID,
required int needVerification, required int needVerification,
@@ -454,9 +504,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Allow/disallow members to view each other's information through the group /// 不允许通过群获取成员资料
/// [groupID] Group ID /// [groupID] ID
/// [status] 0: Disable, 1: Enable /// [status] 0关闭1打开
Future<dynamic> setGroupLookMemberInfo({ Future<dynamic> setGroupLookMemberInfo({
required String groupID, required String groupID,
required int status, required int status,
@@ -470,9 +520,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Allow/disallow members to add friends through the group /// 不允许通过群添加好友
/// [groupID] Group ID /// [groupID] ID
/// [status] 0: Disable, 1: Enable /// [status] 0关闭1打开
Future<dynamic> setGroupApplyMemberFriend({ Future<dynamic> setGroupApplyMemberFriend({
required String groupID, required String groupID,
required int status, required int status,
@@ -486,8 +536,8 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// Get group owners and administrators /// 获取群拥有者,管理员
/// [groupId] Group ID /// [groupId] ID
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({ Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
required String groupID, required String groupID,
String? operationID, String? operationID,
@@ -499,15 +549,16 @@ class GroupManager {
'groupID': groupID, 'groupID': groupID,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Search for group members /// 查询群
/// [groupID] Group ID /// [groupID] 群id
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty. /// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] Whether to search by member ID /// [isSearchUserID] 是否以关键词搜成员id
/// [isSearchMemberNickname] Whether to search by member nickname /// [isSearchMemberNickname] 是否以关键词搜索成员昵称
/// [offset] Start index /// [offset] 开始index
/// [count] Total count to retrieve /// [count] 每次获取的总数
Future<List<GroupMembersInfo>> searchGroupMembers({ Future<List<GroupMembersInfo>> searchGroupMembers({
required String groupID, required String groupID,
List<String> keywordList = const [], List<String> keywordList = const [],
@@ -531,15 +582,16 @@ class GroupManager {
}, },
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); .then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Query a group /// 查询群
/// [groupID] Group ID /// [groupID] 群id
/// [keywordList] Search keyword, currently only supports searching with one keyword, and it cannot be empty /// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] Whether to search member IDs with the keyword /// [isSearchUserID] 是否以关键词搜成员id
/// [isSearchMemberNickname] Whether to search member nicknames with the keyword /// [isSearchMemberNickname] 是否以关键词搜索成员昵称
/// [offset] Starting index /// [offset] 开始index
/// [count] Total number to retrieve each time /// [count] 每次获取的总数
Future<List<dynamic>> searchGroupMembersListMap({ Future<List<dynamic>> searchGroupMembersListMap({
required String groupID, required String groupID,
List<String> keywordList = const [], List<String> keywordList = const [],
@@ -565,28 +617,21 @@ class GroupManager {
})) }))
.then((value) => Utils.toListMap(value)); .then((value) => Utils.toListMap(value));
/// Modify the GroupMemberInfo ex field /// 修改GroupMemberInfo ex字段
Future<dynamic> setGroupMemberInfo({ Future<dynamic> setGroupMemberInfo({
required GroupMembersInfo groupMembersInfo, required String groupID,
required String userID,
String? ex,
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'setGroupMemberInfo', 'setGroupMemberInfo',
_buildParam({ _buildParam({
'info': groupMembersInfo.toJson(), 'info': {
'operationID': Utils.checkOperationID(operationID), 'groupID': groupID,
})); 'userID': userID,
'ex': ex,
Future<dynamic> getUsersInGroup( },
String groupID,
List<String> userIDs, {
String? operationID,
}) =>
_channel.invokeMethod(
'getUsersInGroup',
_buildParam({
'groupID': groupID,
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));

View File

@@ -12,16 +12,16 @@ class IMManager {
late MessageManager messageManager; late MessageManager messageManager;
late GroupManager groupManager; late GroupManager groupManager;
late UserManager userManager; late UserManager userManager;
late SignalingManager signalingManager;
late OnConnectListener _connectListener; late OnConnectListener _connectListener;
OnListenerForService? _listenerForService; OnListenerForService? _listenerForService;
OnUploadFileListener? _uploadFileListener; OnUploadFileListener? _uploadFileListener;
OnUploadLogsListener? _uploadLogsListener;
late String userID; late String userID;
late UserInfo userInfo; late UserInfo userInfo;
bool isLogined = false; bool isLogined = false;
String? token; String? token;
String? _objectStorage;
IMManager(this._channel) { IMManager(this._channel) {
conversationManager = ConversationManager(_channel); conversationManager = ConversationManager(_channel);
@@ -29,6 +29,7 @@ class IMManager {
messageManager = MessageManager(_channel); messageManager = MessageManager(_channel);
groupManager = GroupManager(_channel); groupManager = GroupManager(_channel);
userManager = UserManager(_channel); userManager = UserManager(_channel);
signalingManager = SignalingManager(_channel);
_addNativeCallback(_channel); _addNativeCallback(_channel);
} }
@@ -65,29 +66,29 @@ class IMManager {
userInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map)); userInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
userManager.listener.selfInfoUpdated(userInfo); userManager.listener.selfInfoUpdated(userInfo);
break; break;
case 'onUserStatusChanged':
final status = Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
userManager.listener.userStatusChanged(status);
break;
} }
} else if (call.method == ListenerType.groupListener) { } else if (call.method == ListenerType.groupListener) {
String type = call.arguments['type']; String type = call.arguments['type'];
dynamic data = call.arguments['data']; dynamic data = call.arguments['data'];
switch (type) { switch (type) {
case 'onGroupApplicationAccepted': case 'onGroupApplicationAccepted':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map)); final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationAccepted(i); groupManager.listener.groupApplicationAccepted(i);
break; break;
case 'onGroupApplicationAdded': case 'onGroupApplicationAdded':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map)); final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationAdded(i); groupManager.listener.groupApplicationAdded(i);
break; break;
case 'onGroupApplicationDeleted': case 'onGroupApplicationDeleted':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map)); final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationDeleted(i); groupManager.listener.groupApplicationDeleted(i);
break; break;
case 'onGroupApplicationRejected': case 'onGroupApplicationRejected':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map)); final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationRejected(i); groupManager.listener.groupApplicationRejected(i);
break; break;
case 'onGroupDismissed': case 'onGroupDismissed':
@@ -99,15 +100,18 @@ class IMManager {
groupManager.listener.groupInfoChanged(i); groupManager.listener.groupInfoChanged(i);
break; break;
case 'onGroupMemberAdded': case 'onGroupMemberAdded':
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map)); final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.listener.groupMemberAdded(i); groupManager.listener.groupMemberAdded(i);
break; break;
case 'onGroupMemberDeleted': case 'onGroupMemberDeleted':
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map)); final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.listener.groupMemberDeleted(i); groupManager.listener.groupMemberDeleted(i);
break; break;
case 'onGroupMemberInfoChanged': case 'onGroupMemberInfoChanged':
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map)); final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.listener.groupMemberInfoChanged(i); groupManager.listener.groupMemberInfoChanged(i);
break; break;
case 'onJoinedGroupAdded': case 'onJoinedGroupAdded':
@@ -135,19 +139,36 @@ class IMManager {
break; break;
case 'onRecvC2CReadReceipt': case 'onRecvC2CReadReceipt':
var value = call.arguments['data']['msgReceiptList']; var value = call.arguments['data']['msgReceiptList'];
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map)); var list =
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
messageManager.msgListener.recvC2CReadReceipt(list); messageManager.msgListener.recvC2CReadReceipt(list);
break; break;
case 'onRecvGroupReadReceipt': case 'onRecvGroupReadReceipt':
var value = call.arguments['data']['groupMsgReceiptList']; var value = call.arguments['data']['groupMsgReceiptList'];
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map)); var list =
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
messageManager.msgListener.recvGroupReadReceipt(list); messageManager.msgListener.recvGroupReadReceipt(list);
break; break;
case 'onRecvMessageExtensionsAdded':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['reactionExtensionList'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener
.recvMessageExtensionsAdded(msgID, list);
break;
case 'onRecvMessageExtensionsChanged':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['reactionExtensionList'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener
.recvMessageExtensionsChanged(msgID, list);
break;
case 'onRecvMessageExtensionsDeleted': case 'onRecvMessageExtensionsDeleted':
var msgID = call.arguments['data']['msgID']; var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['reactionExtensionKeyList']; var value = call.arguments['data']['reactionExtensionKeyList'];
var list = Utils.toList(value, (map) => '$map'); var list = Utils.toList(value, (map) => '$map');
messageManager.msgListener.recvMessageExtensionsDeleted(msgID, list); messageManager.msgListener
.recvMessageExtensionsDeleted(msgID, list);
break; break;
case 'onRecvNewMessage': case 'onRecvNewMessage':
@@ -160,11 +181,6 @@ class IMManager {
final msg = Utils.toObj(value, (map) => Message.fromJson(map)); final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.msgListener.recvOfflineNewMessage(msg); messageManager.msgListener.recvOfflineNewMessage(msg);
break; break;
case 'onRecvOnlineOnlyMessage':
var value = call.arguments['data']['message'];
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.msgListener.recvOnlineOnlyMessage(msg);
break;
} }
} else if (call.method == ListenerType.msgSendProgressListener) { } else if (call.method == ListenerType.msgSendProgressListener) {
String type = call.arguments['type']; String type = call.arguments['type'];
@@ -194,15 +210,18 @@ class IMManager {
conversationManager.listener.syncServerFailed(); conversationManager.listener.syncServerFailed();
break; break;
case 'onNewConversation': case 'onNewConversation':
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map)); var list =
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
conversationManager.listener.newConversation(list); conversationManager.listener.newConversation(list);
break; break;
case 'onConversationChanged': case 'onConversationChanged':
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map)); var list =
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
conversationManager.listener.conversationChanged(list); conversationManager.listener.conversationChanged(list);
break; break;
case 'onTotalUnreadMessageCountChanged': case 'onTotalUnreadMessageCountChanged':
conversationManager.listener.totalUnreadMessageCountChanged(data ?? 0); conversationManager.listener
.totalUnreadMessageCountChanged(data ?? 0);
break; break;
} }
} else if (call.method == ListenerType.friendListener) { } else if (call.method == ListenerType.friendListener) {
@@ -223,19 +242,23 @@ class IMManager {
friendshipManager.listener.friendAdded(u); friendshipManager.listener.friendAdded(u);
break; break;
case 'onFriendApplicationAccepted': case 'onFriendApplicationAccepted':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map)); final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationAccepted(u); friendshipManager.listener.friendApplicationAccepted(u);
break; break;
case 'onFriendApplicationAdded': case 'onFriendApplicationAdded':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map)); final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationAdded(u); friendshipManager.listener.friendApplicationAdded(u);
break; break;
case 'onFriendApplicationDeleted': case 'onFriendApplicationDeleted':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map)); final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationDeleted(u); friendshipManager.listener.friendApplicationDeleted(u);
break; break;
case 'onFriendApplicationRejected': case 'onFriendApplicationRejected':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map)); final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationRejected(u); friendshipManager.listener.friendApplicationRejected(u);
break; break;
case 'onFriendDeleted': case 'onFriendDeleted':
@@ -247,12 +270,81 @@ class IMManager {
friendshipManager.listener.friendInfoChanged(u); friendshipManager.listener.friendInfoChanged(u);
break; break;
} }
} else if (call.method == ListenerType.signalingListener) {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
dynamic info;
switch (type) {
case 'onRoomParticipantConnected':
case 'onRoomParticipantDisconnected':
info = Utils.toObj(data, (map) => RoomCallingInfo.fromJson(map));
break;
case 'onStreamChange':
info =
Utils.toObj(data, (map) => MeetingStreamEvent.fromJson(map));
break;
case 'onReceiveCustomSignal':
info = Utils.toObj(data, (map) => CustomSignaling.fromJson(map));
break;
default:
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
break;
}
switch (type) {
case 'onInvitationCancelled':
signalingManager.listener.invitationCancelled(info);
break;
case 'onInvitationTimeout':
signalingManager.listener.invitationTimeout(info);
break;
case 'onInviteeAccepted':
signalingManager.listener.inviteeAccepted(info);
break;
case 'onInviteeRejected':
signalingManager.listener.inviteeRejected(info);
break;
case 'onReceiveNewInvitation':
signalingManager.listener.receiveNewInvitation(info);
break;
case 'onInviteeAcceptedByOtherDevice':
signalingManager.listener.inviteeAcceptedByOtherDevice(info);
break;
case 'onInviteeRejectedByOtherDevice':
signalingManager.listener.inviteeRejectedByOtherDevice(info);
break;
case 'onHangUp':
signalingManager.listener.hangup(info);
break;
case 'onRoomParticipantConnected':
signalingManager.listener.roomParticipantConnected(info);
break;
case 'onRoomParticipantDisconnected':
signalingManager.listener.roomParticipantDisconnected(info);
break;
case 'onStreamChange':
signalingManager.listener.streamChangedEvent(info);
break;
case 'onReceiveCustomSignal':
signalingManager.listener.receiveCustomSignal(info);
break;
}
} else if (call.method == ListenerType.customBusinessListener) { } else if (call.method == ListenerType.customBusinessListener) {
String type = call.arguments['type']; String type = call.arguments['type'];
String data = call.arguments['data']; String data = call.arguments['data'];
switch (type) { switch (type) {
case 'onRecvCustomBusinessMessage': case 'onRecvCustomBusinessMessage':
messageManager.customBusinessListener?.recvCustomBusinessMessage(data); messageManager.customBusinessListener
?.recvCustomBusinessMessage(data);
break;
}
} else if (call.method == ListenerType.messageKvInfoListener) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onMessageKvInfoChanged':
final list =
Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
break; break;
} }
} else if (call.method == ListenerType.listenerForService) { } else if (call.method == ListenerType.listenerForService) {
@@ -260,19 +352,23 @@ class IMManager {
String data = call.arguments['data']; String data = call.arguments['data'];
switch (type) { switch (type) {
case 'onFriendApplicationAccepted': case 'onFriendApplicationAccepted':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map)); final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
_listenerForService?.friendApplicationAccepted(u); _listenerForService?.friendApplicationAccepted(u);
break; break;
case 'onFriendApplicationAdded': case 'onFriendApplicationAdded':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map)); final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
_listenerForService?.friendApplicationAdded(u); _listenerForService?.friendApplicationAdded(u);
break; break;
case 'onGroupApplicationAccepted': case 'onGroupApplicationAccepted':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map)); final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
_listenerForService?.groupApplicationAccepted(i); _listenerForService?.groupApplicationAccepted(i);
break; break;
case 'onGroupApplicationAdded': case 'onGroupApplicationAdded':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map)); final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
_listenerForService?.groupApplicationAdded(i); _listenerForService?.groupApplicationAdded(i);
break; break;
case 'onRecvNewMessage': case 'onRecvNewMessage':
@@ -280,15 +376,6 @@ class IMManager {
_listenerForService?.recvNewMessage(msg); _listenerForService?.recvNewMessage(msg);
break; break;
} }
} else if (call.method == ListenerType.uploadLogsListener) {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
switch (type) {
case 'onProgress':
int size = data['size'];
int current = data['current'];
_uploadLogsListener?.onProgress(current, size);
}
} else if (call.method == ListenerType.uploadFileListener) { } else if (call.method == ListenerType.uploadFileListener) {
String type = call.arguments['type']; String type = call.arguments['type'];
dynamic data = call.arguments['data']; dynamic data = call.arguments['data'];
@@ -329,7 +416,8 @@ class IMManager {
int fileSize = data['fileSize']; int fileSize = data['fileSize'];
int streamSize = data['streamSize']; int streamSize = data['streamSize'];
int storageSize = data['storageSize']; int storageSize = data['storageSize'];
_uploadFileListener?.uploadProgress(id, fileSize, streamSize, storageSize); _uploadFileListener?.uploadProgress(
id, fileSize, streamSize, storageSize);
break; break;
case 'uploadID': case 'uploadID':
String id = data['id']; String id = data['id'];
@@ -341,46 +429,28 @@ class IMManager {
int index = data['index']; int index = data['index'];
int partSize = data['partSize']; int partSize = data['partSize'];
String partHash = data['partHash']; String partHash = data['partHash'];
_uploadFileListener?.uploadPartComplete(id, index, partSize, partHash); _uploadFileListener?.uploadPartComplete(
id, index, partSize, partHash);
break; break;
} }
} }
} catch (error, stackTrace) { } catch (error, stackTrace) {
Logger.print("回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace"); Logger.print(
"回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
} }
return Future.value(null); return Future.value(null);
}); });
} }
Future<bool?> init( /// 初始化SDK
InitConfig config, /// [platform] 平台编号[IMPlatform]
OnConnectListener listener, { /// [apiAddr] SDK api地址
String? operationID, /// [wsAddr] SDK websocket地址
}) { /// [dataDir] SDK数据库存储目录
this._connectListener = listener; /// [objectStorage] 存储对象 cos/minio
if (config.logFilePath == null) { /// [logLevel] 日志 1不打印
config.logFilePath = config.dataDir; /// [enabledEncryption] true加密
} /// [enabledCompression] true压缩
return _channel.invokeMethod(
'initSDK',
_buildParam(
{
...config.toMap(),
"operationID": Utils.checkOperationID(operationID),
},
),
);
}
/// Initialize the SDK
/// [platform] Platform ID [IMPlatform]
/// [apiAddr] SDK API address
/// [wsAddr] SDK WebSocket address
/// [dataDir] SDK database storage directory
/// [objectStorage] Object storage minio
/// [logLevel] Log level, 1: no printing
/// [enabledEncryption] true: encryption
/// [enabledCompression] true: compression
Future<dynamic> initSDK({ Future<dynamic> initSDK({
required int platformID, required int platformID,
required String apiAddr, required String apiAddr,
@@ -388,39 +458,47 @@ class IMManager {
required String dataDir, required String dataDir,
required OnConnectListener listener, required OnConnectListener listener,
int logLevel = 6, int logLevel = 6,
String objectStorage = 'cos',
String? encryptionKey,
bool isNeedEncryption = false,
bool isCompression = false, bool isCompression = false,
bool isExternalExtensions = false,
bool isLogStandardOutput = true, bool isLogStandardOutput = true,
String? logFilePath, String? logFilePath,
String? operationID, String? operationID,
}) { }) {
this._connectListener = listener; this._connectListener = listener;
this._objectStorage = objectStorage;
return _channel.invokeMethod( return _channel.invokeMethod(
'initSDK', 'initSDK',
_buildParam( _buildParam(
{ {
"platformID": platformID, "platformID": platformID,
"apiAddr": apiAddr, "apiAddr": apiAddr,
"wsAddr": wsAddr, "wsAddr": wsAddr,
"dataDir": dataDir, "dataDir": dataDir,
"logLevel": logLevel, "logLevel": logLevel,
"isCompression": isCompression, "objectStorage": objectStorage,
"isLogStandardOutput": isLogStandardOutput, "encryptionKey": encryptionKey,
"logFilePath": logFilePath, "isNeedEncryption": isNeedEncryption,
"operationID": Utils.checkOperationID(operationID), "isCompression": isCompression,
}, "isExternalExtensions": isExternalExtensions,
), "isLogStandardOutput": isLogStandardOutput,
); "logFilePath": logFilePath,
"operationID": Utils.checkOperationID(operationID),
},
));
} }
/// Deinitialize the SDK /// 反初始化SDK
Future<dynamic> unInitSDK() { Future<dynamic> unInitSDK() {
return _channel.invokeMethod('unInitSDK', _buildParam({})); return _channel.invokeMethod('unInitSDK', _buildParam({}));
} }
/// Login /// 登录
/// [userID] User ID /// [userID] 用户id
/// [token] Login token obtained from the business server /// [token] 登录token从业务服务器上获取
/// [defaultValue] Default value to use if login fails /// [defaultValue] 获取失败后使用的默认值
Future<UserInfo> login({ Future<UserInfo> login({
required String userID, required String userID,
required String token, required String token,
@@ -430,7 +508,7 @@ class IMManager {
}) async { }) async {
int? status; int? status;
if (checkLoginStatus) { if (checkLoginStatus) {
// 1: logout 2: logging 3: logged // 1: logout 2: logging 3:logged
status = await getLoginStatus(); status = await getLoginStatus();
} }
if (status != LoginStatus.logging && status != LoginStatus.logged) { if (status != LoginStatus.logging && status != LoginStatus.logged) {
@@ -458,38 +536,36 @@ class IMManager {
// return uInfo; // return uInfo;
} }
/// Logout /// 登出
Future<dynamic> logout({String? operationID}) async { Future<dynamic> logout({String? operationID}) async {
var value = await _channel.invokeMethod( var value = await _channel.invokeMethod(
'logout', 'logout',
_buildParam({ _buildParam({
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
}), }));
);
this.isLogined = false; this.isLogined = false;
this.token = null; this.token = null;
return value; return value;
} }
/// Get login status /// 获取登录状态
/// 1: logout 2: logging 3: logged /// 1: logout 2: logging 3:logged
Future<int?> getLoginStatus({ Future<int?> getLoginStatus({
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod<int>( _channel.invokeMethod<int>(
'getLoginStatus', 'getLoginStatus',
_buildParam({ _buildParam({
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
}), }));
);
/// Get the current logged-in user ID /// 获取当前登录用户id
Future<String> getLoginUserID() async => userID; Future<String> getLoginUserID() async => userID;
/// Get the current logged-in user information /// 获取当前登录用户信息
Future<UserInfo> getLoginUserInfo() async => userInfo; Future<UserInfo> getLoginUserInfo() async => userInfo;
/// [id] Same as [OnUploadFileListener] ID, to distinguish which file callback it is ///[id] [OnUploadFileListener] id一致区分是哪个文件的回调
Future uploadFile({ Future uploadFile({
required String id, required String id,
required String filePath, required String filePath,
@@ -499,49 +575,50 @@ class IMManager {
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'uploadFile', 'uploadFile',
_buildParam({ _buildParam({
'id': id, 'id': id,
'filePath': filePath, 'filePath': filePath,
'name': fileName, 'name': fileName,
'contentType': contentType, 'contentType': contentType,
'cause': cause, 'cause': cause,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
}), }));
);
/// Update the Firebase client registration token /// 更新firebase客户端注册token
/// [fcmToken] Firebase token /// [fcmToken] firebase token
Future updateFcmToken({ Future updateFcmToken({
required String fcmToken, required String fcmToken,
required int expireTime,
String? operationID, String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'updateFcmToken', 'updateFcmToken',
_buildParam({ _buildParam({
'fcmToken': fcmToken, 'fcmToken': fcmToken,
'expireTime': expireTime,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
/// 上传日志 /// 标记app处于后台
Future uploadLogs({ // Future setAppBackgroundStatus({
String? ex, // required bool isBackground,
int line = 0, // String? operationID,
String? operationID, // }) =>
}) => // _channel.invokeMethod(
_channel.invokeMethod( // 'setAppBackgroundStatus',
'uploadLogs', // _buildParam({
_buildParam({ // 'isBackground': isBackground,
'ex': ex, // 'operationID': Utils.checkOperationID(operationID),
'line': line, // }));
'operationID': Utils.checkOperationID(operationID),
}));
void setUploadLogsListener(OnUploadLogsListener listener) { /// 网络改变
_uploadLogsListener = listener; // Future networkStatusChanged({
} // String? operationID,
// }) =>
// _channel.invokeMethod(
// 'networkStatusChanged',
// _buildParam({
// 'operationID': Utils.checkOperationID(operationID),
// }));
void setUploadFileListener(OnUploadFileListener listener) { void setUploadFileListener(OnUploadFileListener listener) {
_uploadFileListener = listener; _uploadFileListener = listener;

View File

@@ -4,13 +4,15 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class MessageManager { class MessageManager {
MethodChannel _channel; MethodChannel _channel;
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
OnMsgSendProgressListener? msgSendProgressListener; OnMsgSendProgressListener? msgSendProgressListener;
late OnAdvancedMsgListener msgListener; late OnAdvancedMsgListener msgListener;
OnCustomBusinessListener? customBusinessListener; OnCustomBusinessListener? customBusinessListener;
OnMessageKvInfoListener? messageKvInfoListener;
MessageManager(this._channel); MessageManager(this._channel);
/// Message listener /// 消息监听
Future setAdvancedMsgListener(OnAdvancedMsgListener listener) { Future setAdvancedMsgListener(OnAdvancedMsgListener listener) {
this.msgListener = listener; this.msgListener = listener;
// advancedMsgListeners.add(listener); // advancedMsgListeners.add(listener);
@@ -21,22 +23,21 @@ class MessageManager {
})); }));
} }
/// Message send progress listener /// 消息发送进度监听
void setMsgSendProgressListener(OnMsgSendProgressListener listener) { void setMsgSendProgressListener(OnMsgSendProgressListener listener) {
msgSendProgressListener = listener; msgSendProgressListener = listener;
} }
/// Send a message /// 发送消息
/// [message] Message content /// [message] 消息体
/// [userID] User ID of the recipient /// [userID] 接收消息的用户id
/// [groupID] Group ID of the recipient /// [groupID] 接收消息的组id
/// [offlinePushInfo] Offline message display content /// [offlinePushInfo] 离线消息显示内容
Future<Message> sendMessage({ Future<Message> sendMessage({
required Message message, required Message message,
required OfflinePushInfo offlinePushInfo, required OfflinePushInfo offlinePushInfo,
String? userID, String? userID,
String? groupID, String? groupID,
bool isOnlineOnly = false,
String? operationID, String? operationID,
}) => }) =>
_channel _channel
@@ -47,13 +48,12 @@ class MessageManager {
'offlinePushInfo': offlinePushInfo.toJson(), 'offlinePushInfo': offlinePushInfo.toJson(),
'userID': userID ?? '', 'userID': userID ?? '',
'groupID': groupID ?? '', 'groupID': groupID ?? '',
'isOnlineOnly': isOnlineOnly,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Delete a message from local storage /// 删除本地消息
/// [message] Message to be deleted /// [message] 被删除的消息体
Future deleteMessageFromLocalStorage({ Future deleteMessageFromLocalStorage({
required String conversationID, required String conversationID,
required String clientMsgID, required String clientMsgID,
@@ -68,8 +68,8 @@ class MessageManager {
})); }));
/// core-sdk: DeleteMessage /// core-sdk: DeleteMessage
/// Delete a specified message from local and server /// 删除本地跟服务器的指定的消息
/// [message] Message to be deleted /// [message] 被删除的消息
Future<dynamic> deleteMessageFromLocalAndSvr({ Future<dynamic> deleteMessageFromLocalAndSvr({
required String conversationID, required String conversationID,
required String clientMsgID, required String clientMsgID,
@@ -83,7 +83,7 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Delete all local chat records /// 删除本地所有聊天记录
Future<dynamic> deleteAllMsgFromLocal({ Future<dynamic> deleteAllMsgFromLocal({
String? operationID, String? operationID,
}) => }) =>
@@ -93,7 +93,7 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Delete all chat records from local and server /// 删除本地跟服务器所有聊天记录
Future<dynamic> deleteAllMsgFromLocalAndSvr({ Future<dynamic> deleteAllMsgFromLocalAndSvr({
String? operationID, String? operationID,
}) => }) =>
@@ -103,10 +103,10 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Insert a single chat message into local storage /// 插入单聊消息到本地
/// [receiverID] Receiver's ID /// [receiverID] 接收者id
/// [senderID] Sender's ID /// [senderID] 发送者id
/// [message] Message content /// [message] 消息体
Future<Message> insertSingleMessageToLocalStorage({ Future<Message> insertSingleMessageToLocalStorage({
String? receiverID, String? receiverID,
String? senderID, String? senderID,
@@ -124,10 +124,10 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Insert a group chat message into local storage /// 插入群聊消息到本地
/// [groupID] Group ID /// [groupID] 群id
/// [senderID] Sender's ID /// [senderID] 发送者id
/// [message] Message content /// [message] 消息体
Future<Message> insertGroupMessageToLocalStorage({ Future<Message> insertGroupMessageToLocalStorage({
String? groupID, String? groupID,
String? senderID, String? senderID,
@@ -145,8 +145,8 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Typing status update /// 正在输入提示
/// [msgTip] Custom content /// [msgTip] 自定义内容
Future typingStatusUpdate({ Future typingStatusUpdate({
required String userID, required String userID,
String? msgTip, String? msgTip,
@@ -160,7 +160,7 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Create a text message /// 创建文本消息
Future<Message> createTextMessage({ Future<Message> createTextMessage({
required String text, required String text,
String? operationID, String? operationID,
@@ -174,11 +174,11 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create an @ message /// 创建@消息
/// [text] Input content /// [text] 输入内容
/// [atUserIDList] Collection of userIDs being mentioned /// [atUserIDList] 被@到的userID集合
/// [atUserInfoList] Mapping of userID to nickname, used for displaying nicknames instead of IDs in the user interface /// [atUserInfoList] userIDnickname映射关系用在界面显示时将id替换为nickname
/// [quoteMessage] Quoted message (the message being replied to) /// [quoteMessage] 引用消息(被回复的消息)
Future<Message> createTextAtMessage({ Future<Message> createTextAtMessage({
required String text, required String text,
required List<String> atUserIDList, required List<String> atUserIDList,
@@ -199,8 +199,8 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create an image message /// 创建图片消息
/// [imagePath] Path /// [imagePath] 路径
Future<Message> createImageMessage({ Future<Message> createImageMessage({
required String imagePath, required String imagePath,
String? operationID, String? operationID,
@@ -215,8 +215,8 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create an image message from a full path /// 创建图片消息
/// [imagePath] Path /// [imagePath] 路径
Future<Message> createImageMessageFromFullPath({ Future<Message> createImageMessageFromFullPath({
required String imagePath, required String imagePath,
String? operationID, String? operationID,
@@ -231,9 +231,9 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a sound message /// 创建语音消息
/// [soundPath] Path /// [soundPath] 路径
/// [duration] Duration in seconds /// [duration] 时长s
Future<Message> createSoundMessage({ Future<Message> createSoundMessage({
required String soundPath, required String soundPath,
required int duration, required int duration,
@@ -250,9 +250,9 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a sound message from a full path /// 创建语音消息
/// [soundPath] Path /// [soundPath] 路径
/// [duration] Duration in seconds /// [duration] 时长s
Future<Message> createSoundMessageFromFullPath({ Future<Message> createSoundMessageFromFullPath({
required String soundPath, required String soundPath,
required int duration, required int duration,
@@ -269,11 +269,11 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a video message /// 创建视频消息
/// [videoPath] Path /// [videoPath] 路径
/// [videoType] Video MIME type /// [videoType] 视频mime类型
/// [duration] Duration in seconds /// [duration] 时长s
/// [snapshotPath] Default snapshot image path /// [snapshotPath] 默认站位图路径
Future<Message> createVideoMessage({ Future<Message> createVideoMessage({
required String videoPath, required String videoPath,
required String videoType, required String videoType,
@@ -293,11 +293,11 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a video message from a full path /// 创建视频消息
/// [videoPath] Path /// [videoPath] 路径
/// [videoType] Video MIME type /// [videoType] 视频mime类型
/// [duration] Duration in seconds /// [duration] 时长s
/// [snapshotPath] Default snapshot image path /// [snapshotPath] 默认站位图路径
Future<Message> createVideoMessageFromFullPath({ Future<Message> createVideoMessageFromFullPath({
required String videoPath, required String videoPath,
required String videoType, required String videoType,
@@ -317,9 +317,9 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a file message /// 创建文件消息
/// [filePath] Path /// [filePath] 路径
/// [fileName] File name /// [fileName] 文件名
Future<Message> createFileMessage({ Future<Message> createFileMessage({
required String filePath, required String filePath,
required String fileName, required String fileName,
@@ -336,9 +336,9 @@ class MessageManager {
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
} }
/// Create a file message from a full path /// 创建文件消息
/// [filePath] Path /// [filePath] 路径
/// [fileName] File name /// [fileName] 文件名
Future<Message> createFileMessageFromFullPath({ Future<Message> createFileMessageFromFullPath({
required String filePath, required String filePath,
required String fileName, required String fileName,
@@ -354,10 +354,10 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a merged message /// 创建合并消息
/// [messageList] Selected messages /// [messageList] 被选中的消息
/// [title] Summary title /// [title] 摘要标题
/// [summaryList] Summary content /// [summaryList] 摘要内容
Future<Message> createMergerMessage({ Future<Message> createMergerMessage({
required List<Message> messageList, required List<Message> messageList,
required String title, required String title,
@@ -375,8 +375,8 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a forwarded message /// 创建转发消息
/// [message] Message to be forwarded /// [message] 被转发的消息
Future<Message> createForwardMessage({ Future<Message> createForwardMessage({
required Message message, required Message message,
String? operationID, String? operationID,
@@ -391,10 +391,10 @@ class MessageManager {
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
} }
/// Create a location message /// 创建位置消息
/// [latitude] Latitude /// [latitude] 纬度
/// [longitude] Longitude /// [longitude] 经度
/// [description] Custom description /// [description] 自定义描述信息
Future<Message> createLocationMessage({ Future<Message> createLocationMessage({
required double latitude, required double latitude,
required double longitude, required double longitude,
@@ -412,10 +412,10 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a custom message /// 创建自定义消息
/// [data] Custom data /// [data] 自定义数据
/// [extension] Custom extension content /// [extension] 自定义扩展内容
/// [description] Custom description content /// [description] 自定义描述内容
Future<Message> createCustomMessage({ Future<Message> createCustomMessage({
required String data, required String data,
required String extension, required String extension,
@@ -433,9 +433,9 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a quoted message /// 创建引用消息
/// [text] Reply content /// [text] 回复的内容
/// [quoteMsg] Message being replied to /// [quoteMsg] 被回复的消息
Future<Message> createQuoteMessage({ Future<Message> createQuoteMessage({
required String text, required String text,
required Message quoteMsg, required Message quoteMsg,
@@ -451,8 +451,8 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a card message /// 创建卡片消息
/// [data] Custom data /// [data] 自定义数据
Future<Message> createCardMessage({ Future<Message> createCardMessage({
required String userID, required String userID,
required String nickname, required String nickname,
@@ -474,9 +474,9 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a custom emoji message /// 创建自定义表情消息
/// [index] Positional emoji, matched based on index /// [index] 位置表情,根据index匹配
/// [data] URL emoji, displayed directly using the URL /// [data] url表情直接使用url显示
Future<Message> createFaceMessage({ Future<Message> createFaceMessage({
int index = -1, int index = -1,
String? data, String? data,
@@ -492,16 +492,16 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Search messages /// 搜索消息
/// [conversationID] Query based on conversation, pass null for global search /// [conversationID] 根据会话查询如果是全局搜索传null
/// [keywordList] Search keyword list, currently supports searching with a single keyword /// [keywordList] 搜索关键词列表,目前仅支持一个关键词搜索
/// [keywordListMatchType] Keyword matching mode, 1 means AND, 2 means OR (currently unused) /// [keywordListMatchType] 关键词匹配模式1代表与2代表或暂时未用
/// [senderUserIDList] List of UIDs for messages sent (currently unused) /// [senderUserIDList] 指定消息发送的uid列表 暂时未用
/// [messageTypeList] Message type list /// [messageTypeList] 消息类型列表
/// [searchTimePosition] Start time point for searching. Defaults to 0, meaning searching from now. UTC timestamp, in seconds /// [searchTimePosition] 搜索的起始时间点。默认为0即代表从现在开始搜索。UTC 时间戳,单位:秒
/// [searchTimePeriod] Time range in the past from the start time point, in seconds. Defaults to 0, meaning no time range limitation. Pass 24x60x60 to represent the past day /// [searchTimePeriod] 从起始时间点开始的过去时间范围单位秒。默认为0即代表不限制时间范围传24x60x60代表过去一天
/// [pageIndex] Current page number /// [pageIndex] 当前页数
/// [count] Number of messages per page /// [count] 每页数量
Future<SearchResult> searchLocalMessages({ Future<SearchResult> searchLocalMessages({
String? conversationID, String? conversationID,
List<String> keywordList = const [], List<String> keywordList = const [],
@@ -531,10 +531,11 @@ class MessageManager {
}, },
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map))); .then((value) =>
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
/// Revoke a message /// 撤回消息
/// [message] The message to be revoked /// [message] 被撤回的消息体
Future revokeMessage({ Future revokeMessage({
required String conversationID, required String conversationID,
required String clientMsgID, required String clientMsgID,
@@ -548,9 +549,9 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Mark messages as read /// 标记消息已读
/// [conversationID] Conversation ID /// [conversationID] 会话ID
/// [messageIDList] List of clientMsgIDs of messages to be marked as read /// [messageIDList] 被标记的消息clientMsgID
Future markMessagesAsReadByMsgID({ Future markMessagesAsReadByMsgID({
required String conversationID, required String conversationID,
required List<String> messageIDList, required List<String> messageIDList,
@@ -564,11 +565,11 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Get chat history (messages prior to startMsg) /// 获取聊天记录(以startMsg为节点以前的聊天记录)
/// [conversationID] Conversation ID, can be used for querying notifications /// [conversationID] 会话id查询通知时可用
/// [startMsg] Query [count] messages starting from this message. The message at index == length - 1 is the latest message, so to get the next page of history, use startMsg = list.first /// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息所以获取下一页历史记录startMsg=list.first
/// [count] Total number of messages to retrieve in one request /// [count] 一次拉取的总数
/// [lastMinSeq] Not required for the first page of messages, but necessary for getting the second page of history. Same as [startMsg] /// [lastMinSeq] 第一页消息不用传,获取第二页开始必传 跟[startMsg]一样
Future<AdvancedMessage> getAdvancedHistoryMessageList({ Future<AdvancedMessage> getAdvancedHistoryMessageList({
String? conversationID, String? conversationID,
Message? startMsg, Message? startMsg,
@@ -586,12 +587,13 @@ class MessageManager {
'lastMinSeq': lastMinSeq ?? 0, 'lastMinSeq': lastMinSeq ?? 0,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map))); .then((value) =>
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
/// Get chat history (newly received chat history after startMsg). Used for locating a specific message in global search and then fetching messages received after that message. /// 获取聊天记录(以startMsg为节点新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
/// [conversationID] Conversation ID, can be used for querying notifications /// [conversationID] 会话id查询通知时可用
/// [startMsg] Query [count] messages starting from this message. The message at index == length - 1 is the latest message, so to get the next page of history, use startMsg = list.last /// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息所以获取下一页历史记录startMsg=list.last
/// [count] Total number of messages to retrieve in one request /// [count] 一次拉取的总数
Future<AdvancedMessage> getAdvancedHistoryMessageListReverse({ Future<AdvancedMessage> getAdvancedHistoryMessageListReverse({
String? conversationID, String? conversationID,
Message? startMsg, Message? startMsg,
@@ -609,11 +611,12 @@ class MessageManager {
'lastMinSeq': lastMinSeq ?? 0, 'lastMinSeq': lastMinSeq ?? 0,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map))); .then((value) =>
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
/// Find message details /// 查找消息详细
/// [conversationID] Conversation ID /// [conversationID] 会话id
/// [clientMsgIDList] List of message IDs /// [clientMsgIDList] 消息id列表
Future<SearchResult> findMessageList({ Future<SearchResult> findMessageList({
required List<SearchParams> searchParams, required List<SearchParams> searchParams,
String? operationID, String? operationID,
@@ -625,11 +628,12 @@ class MessageManager {
'searchParams': searchParams.map((e) => e.toJson()).toList(), 'searchParams': searchParams.map((e) => e.toJson()).toList(),
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map))); .then((value) =>
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
/// Rich text message /// 富文本消息
/// [text] Input content /// [text] 输入内容
/// [list] Details of the rich text message /// [list] 富文本消息具体详细
Future<Message> createAdvancedTextMessage({ Future<Message> createAdvancedTextMessage({
required String text, required String text,
List<RichMessageInfo> list = const [], List<RichMessageInfo> list = const [],
@@ -646,10 +650,10 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Rich text message with quote /// 富文本消息
/// [text] Content for the reply /// [text] 回复的内容
/// [quoteMsg] The message being replied to /// [quoteMsg] 被回复的消息
/// [list] Details of the rich text message /// [list] 富文本消息具体详细
Future<Message> createAdvancedQuoteMessage({ Future<Message> createAdvancedQuoteMessage({
required String text, required String text,
required Message quoteMsg, required Message quoteMsg,
@@ -667,17 +671,16 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Send a message /// 发送消息
/// [message] Message body [createImageMessageByURL],[createSoundMessageByURL],[createVideoMessageByURL],[createFileMessageByURL] /// [message] 消息体 [createImageMessageByURL],[createSoundMessageByURL],[createVideoMessageByURL],[createFileMessageByURL]
/// [userID] User ID to receive the message /// [userID] 接收消息的用户id
/// [groupID] Group ID to receive the message /// [groupID] 接收消息的组id
/// [offlinePushInfo] Offline message display content /// [offlinePushInfo] 离线消息显示内容
Future<Message> sendMessageNotOss({ Future<Message> sendMessageNotOss({
required Message message, required Message message,
required OfflinePushInfo offlinePushInfo, required OfflinePushInfo offlinePushInfo,
String? userID, String? userID,
String? groupID, String? groupID,
bool isOnlineOnly = false,
String? operationID, String? operationID,
}) => }) =>
_channel _channel
@@ -688,24 +691,21 @@ class MessageManager {
'offlinePushInfo': offlinePushInfo.toJson(), 'offlinePushInfo': offlinePushInfo.toJson(),
'userID': userID ?? '', 'userID': userID ?? '',
'groupID': groupID ?? '', 'groupID': groupID ?? '',
'isOnlineOnly': isOnlineOnly,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create an image message by URL /// 创建图片消息
Future<Message> createImageMessageByURL({ Future<Message> createImageMessageByURL({
required PictureInfo sourcePicture, required PictureInfo sourcePicture,
required PictureInfo bigPicture, required PictureInfo bigPicture,
required PictureInfo snapshotPicture, required PictureInfo snapshotPicture,
String? sourcePath,
String? operationID, String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'createImageMessageByURL', 'createImageMessageByURL',
_buildParam({ _buildParam({
'sourcePath': sourcePath,
'sourcePicture': sourcePicture.toJson(), 'sourcePicture': sourcePicture.toJson(),
'bigPicture': bigPicture.toJson(), 'bigPicture': bigPicture.toJson(),
'snapshotPicture': snapshotPicture.toJson(), 'snapshotPicture': snapshotPicture.toJson(),
@@ -714,7 +714,7 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a sound message /// 创建语音消息
Future<Message> createSoundMessageByURL({ Future<Message> createSoundMessageByURL({
required SoundElem soundElem, required SoundElem soundElem,
String? operationID, String? operationID,
@@ -729,7 +729,7 @@ class MessageManager {
) )
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a video message /// 创建视频消息
Future<Message> createVideoMessageByURL({ Future<Message> createVideoMessageByURL({
required VideoElem videoElem, required VideoElem videoElem,
String? operationID, String? operationID,
@@ -743,7 +743,7 @@ class MessageManager {
})) }))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); .then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create a file message /// 创建视频消息
Future<Message> createFileMessageByURL({ Future<Message> createFileMessageByURL({
required FileElem fileElem, required FileElem fileElem,
String? operationID, String? operationID,
@@ -763,33 +763,89 @@ class MessageManager {
return _channel.invokeMethod('setCustomBusinessListener', _buildParam({})); return _channel.invokeMethod('setCustomBusinessListener', _buildParam({}));
} }
Future setMessageLocalEx({ ///
required String conversationID, Future setMessageKvInfoListener(OnMessageKvInfoListener listener) {
required String clientMsgID, this.messageKvInfoListener = listener;
required String localEx, return _channel.invokeMethod('setMessageKvInfoListener', _buildParam({}));
String? operationID,
}) {
return _channel.invokeMethod(
'setMessageLocalEx',
_buildParam({
"conversationID": conversationID,
"clientMsgID": clientMsgID,
"localEx": localEx,
"operationID": Utils.checkOperationID(operationID),
}));
} }
Future setAppBadge( Future<List<TypeKeySetResult>> setMessageReactionExtensions({
int count, { required Message message,
List<KeyValue> list = const [],
String? operationID, String? operationID,
}) { }) =>
return _channel.invokeMethod( _channel
'setAppBadge', .invokeMethod(
_buildParam({ 'setMessageReactionExtensions',
'count': count, _buildParam({
'operationID': Utils.checkOperationID(operationID), 'message': message.toJson(),
})); 'list': list.map((e) => e.toJson()).toList(),
} "operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<TypeKeySetResult>> deleteMessageReactionExtensions({
required Message message,
List<String> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'deleteMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListReactionExtensions({
List<Message> messageList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(
value, (map) => MessageTypeKeyMapping.fromJson(map)));
Future<List<TypeKeySetResult>> addMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'addMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListSomeReactionExtensions({
List<Message> messageList = const [],
List<KeyValue> kvList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListSomeReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
'list': kvList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(
value, (map) => MessageTypeKeyMapping.fromJson(map)));
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "messageManager"; param["ManagerName"] = "messageManager";

View File

@@ -0,0 +1,319 @@
import 'package:flutter/services.dart';
import '../../flutter_openim_sdk.dart';
class SignalingManager {
MethodChannel _channel;
late OnSignalingListener listener;
SignalingManager(this._channel);
/// 信令监听
Future setSignalingListener(OnSignalingListener listener) {
this.listener = listener;
return _channel.invokeMethod('setSignalingListener', _buildParam({}));
}
/// 邀请个人加入音视频
/// [info] 信令对象[SignalingInfo]
Future<SignalingCertificate> signalingInvite({
required SignalingInfo info,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingInvite',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 邀请群里某些人加入音视频
/// [info] 信令对象[SignalingInfo]
Future<SignalingCertificate> signalingInviteInGroup({
required SignalingInfo info,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingInviteInGroup',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 同意某人音视频邀请
/// [info] 信令对象[SignalingInfo]
Future<SignalingCertificate> signalingAccept({
required SignalingInfo info,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingAccept',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 拒绝某人音视频邀请
/// [info] 信令对象[SignalingInfo]
Future<dynamic> signalingReject({
required SignalingInfo info,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingReject',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}));
/// 邀请者取消音视频通话
/// [info] 信令对象[SignalingInfo]
Future<dynamic> signalingCancel({
required SignalingInfo info,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingCancel',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}));
/// 挂断
/// [info] 信令对象[SignalingInfo]
Future<dynamic> signalingHungUp({
required SignalingInfo info,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingHungUp',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}));
/// 获取当前群通话信息
/// [groupID] 当前群ID
Future<RoomCallingInfo> signalingGetRoomByGroupID({
required String groupID,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingGetRoomByGroupID',
_buildParam({
'groupID': groupID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => RoomCallingInfo.fromJson(map)));
/// 获取进入房间的信息
/// [roomID] 当前房间ID
Future<SignalingCertificate> signalingGetTokenByRoomID({
required String roomID,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingGetTokenByRoomID',
_buildParam({
'roomID': roomID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(
value,
(map) => SignalingCertificate.fromJson(
map..addAll({'roomID': roomID}))));
/// 会议设置
/// required String roomID,
/// String? meetingName,
/// String? ex,
/// int startTime = 0,
/// int endTime = 0,
/// bool participantCanUnmuteSelf = true,
/// bool participantCanEnableVideo = true,
/// bool onlyHostInviteUser = true,
/// bool onlyHostShareScreen = true,
/// bool joinDisableMicrophone = true,
/// bool joinDisableVideo = true,
/// bool isMuteAllVideo = true,
/// bool isMuteAllMicrophone = true,
/// List<String> addCanScreenUserIDList = const [],
/// List<String> reduceCanScreenUserIDList = const [],
/// List<String> addDisableMicrophoneUserIDList = const [],
/// List<String> reduceDisableMicrophoneUserIDList = const [],
/// List<String> addDisableVideoUserIDList = const [],
/// List<String> reduceDisableVideoUserIDList = const [],
/// List<String> addPinedUserIDList = const [],
/// List<String> reducePinedUserIDList = const [],
/// List<String> addBeWatchedUserIDList = const [],
/// List<String> reduceBeWatchedUserIDList = const [],
Future<dynamic> signalingUpdateMeetingInfo({
required Map info,
String? operationID,
}) {
if (info['meetingID'] != null) {
info['roomID'] = info['meetingID'];
}
assert(info['roomID'] != null);
return _channel.invokeMethod(
'signalingUpdateMeetingInfo',
_buildParam({
'info': info,
'operationID': Utils.checkOperationID(operationID),
}));
}
/// 创建会议室
/// [meetingName] 会议主题
/// [meetingHostUserID] 会议主持人ID
/// [startTime] 开始时间s
/// [meetingDuration] 会议时长s
/// [inviteeUserIDList] 被邀请人ID列表
/// [ex] 其他
Future<SignalingCertificate> signalingCreateMeeting({
required String meetingName,
String? meetingHostUserID,
int? startTime,
int? meetingDuration,
List<String> inviteeUserIDList = const [],
String? ex,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingCreateMeeting',
_buildParam({
'info': {
'meetingName': meetingName,
'meetingHostUserID': meetingHostUserID,
'startTime': startTime,
'meetingDuration': meetingDuration,
'inviteeUserIDList': inviteeUserIDList,
'ex': ex,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 加入会议室
/// [roomID] 会议ID
/// [meetingName] 会议主题
/// [participantNickname] 加入房间显示的名称
Future<SignalingCertificate> signalingJoinMeeting({
required String roomID,
String? meetingName,
String? participantNickname,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingJoinMeeting',
_buildParam({
'info': {
'roomID': roomID,
'meetingName': meetingName,
'participantNickname': participantNickname,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 会议室 管理员对指定的某一个入会人员设置禁言
/// [roomID] 会议ID
/// [streamType] video/audio
/// [userID] 被禁言的用户ID
/// [mute] true禁言
/// [muteAll] truevideo/audio 一起设置
Future<dynamic> signalingOperateStream({
required String roomID,
String? streamType,
required String userID,
bool mute = false,
bool muteAll = false,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingOperateStream',
_buildParam({
'roomID': roomID,
'streamType': streamType,
'userID': userID,
'mute': mute,
'muteAll': muteAll,
'operationID': Utils.checkOperationID(operationID),
}));
/// 获取所有的未完成会议
/// [roomID] 会议ID
Future<MeetingInfoList> signalingGetMeetings({
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingGetMeetings',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => MeetingInfoList.fromJson(map)));
/// 结束会议
/// [roomID] 会议ID
Future<dynamic> signalingCloseRoom({
required String roomID,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingCloseRoom',
_buildParam({
'roomID': roomID,
'operationID': Utils.checkOperationID(operationID),
}));
/// 自定义信令
/// [roomID] 会议ID
/// [customInfo] 自定义信令
Future<dynamic> signalingSendCustomSignal({
required String roomID,
required String customInfo,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingSendCustomSignal',
_buildParam({
'roomID': roomID,
'customInfo': customInfo,
'operationID': Utils.checkOperationID(operationID),
}));
Future<SignalingInfo> getSignalingInvitationInfoStartApp({
String? operationID,
}) =>
_channel
.invokeMethod(
'getSignalingInvitationInfoStartApp',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingInfo.fromJson(map)));
static Map _buildParam(Map param) {
param["ManagerName"] = "signalingManager";
return param;
}
}

View File

@@ -7,15 +7,15 @@ class UserManager {
UserManager(this._channel); UserManager(this._channel);
/// User profile change listener /// 用户资料改变监听
Future setUserListener(OnUserListener listener) { Future setUserListener(OnUserListener listener) {
this.listener = listener; this.listener = listener;
return _channel.invokeMethod('setUserListener', _buildParam({})); return _channel.invokeMethod('setUserListener', _buildParam({}));
} }
/// Get user information /// 获取用户资料
/// [userIDList] List of user IDs /// [userIDList] 用户ID列表
Future<List<FullUserInfo>> getUsersInfo({ Future<List<UserInfo>> getUsersInfo({
required List<String> userIDList, required List<String> userIDList,
String? operationID, String? operationID,
}) => }) =>
@@ -26,9 +26,9 @@ class UserManager {
'userIDList': userIDList, 'userIDList': userIDList,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})) }))
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v))); .then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Get information of the currently logged-in user /// 获取当前登录用户的信息
Future<UserInfo> getSelfUserInfo({ Future<UserInfo> getSelfUserInfo({
String? operationID, String? operationID,
}) => }) =>
@@ -40,15 +40,23 @@ class UserManager {
})) }))
.then((value) => Utils.toObj(value, (map) => UserInfo.fromJson(map))); .then((value) => Utils.toObj(value, (map) => UserInfo.fromJson(map)));
/// Modify the profile of the currently logged-in user /// 修改当前登录用户资料
/// [nickname] Nickname /// [nickname] 昵称
/// [faceURL] Profile picture /// [faceURL] 头像
/// [appManagerLevel] /// [gender] 性别
/// [ex] Additional fields /// [appMangerLevel]
/// [phoneNumber] 手机号
/// [birth] 出生日期
/// [email] 邮箱
/// [ex] 扩展字段
Future<String?> setSelfInfo({ Future<String?> setSelfInfo({
String? nickname, String? nickname,
String? faceURL, String? faceURL,
int? appManagerLevel, int? gender,
int? appMangerLevel,
String? phoneNumber,
int? birth,
String? email,
String? ex, String? ex,
String? operationID, String? operationID,
}) => }) =>
@@ -58,92 +66,15 @@ class UserManager {
// 'userID': userID, // 'userID': userID,
'nickname': nickname, 'nickname': nickname,
'faceURL': faceURL, 'faceURL': faceURL,
'appManagerLevel': appManagerLevel, 'gender': gender,
'appMangerLevel': appMangerLevel,
'phoneNumber': phoneNumber,
'birth': birth,
'email': email,
'ex': ex, 'ex': ex,
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
Future<List<UserStatusInfo>> subscribeUsersStatus(
List<String> userIDs, {
String? operationID,
}) {
return _channel
.invokeMethod(
'subscribeUsersStatus',
_buildParam({
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future unsubscribeUsersStatus(
List<String> userIDs, {
String? operationID,
}) {
return _channel.invokeMethod(
'unsubscribeUsersStatus',
_buildParam({
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}));
}
Future<List<UserStatusInfo>> getSubscribeUsersStatus({
String? operationID,
}) {
return _channel
.invokeMethod(
'getSubscribeUsersStatus',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future<List<UserStatusInfo>> getUserStatus(
List<String> userIDs, {
String? operationID,
}) {
return _channel
.invokeMethod(
'getUserStatus',
_buildParam({
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future<List<FullUserInfo>> getUsersInfoWithCache(
List<String> userIDs, {
String? groupID,
String? operationID,
}) {
return _channel
.invokeMethod(
'getUsersInfoWithCache',
_buildParam({
'userIDs': userIDs,
'groupID': groupID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => FullUserInfo.fromJson(map)));
}
/*
Future<String?> setSelfUserInfoEx(
UserInfo userInfo, {
String? operationID,
}) {
return _channel.invokeMethod(
'setSelfUserInfoEx',
_buildParam({
...userInfo.toJson(),
'operationID': Utils.checkOperationID(operationID),
}));
}
*/
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "userManager"; param["ManagerName"] = "userManager";
return param; return param;

View File

@@ -3,67 +3,66 @@ import 'dart:convert';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class ConversationInfo { class ConversationInfo {
// Unique identifier for the conversation /// 会话ID
String conversationID; String conversationID;
// Type of the conversation (e.g., single, group, super group) /// 会话类型[ConversationType]
int? conversationType; int? conversationType;
// User ID in case of a single chat /// 参与会话的userID
String? userID; String? userID;
// Group ID in case of a group chat /// 参与会话的groupID
String? groupID; String? groupID;
// Display name or nickname /// 昵称
String? showName; String? showName;
// URL of the user's or group's profile picture /// 头像
String? faceURL; String? faceURL;
// Message reception option (0: normal, 1: do not accept messages, 2: accept online messages but not offline messages) /// 免打扰 0正常1不接受消息2接受在线消息不接受离线消息
int? recvMsgOpt; int? recvMsgOpt;
// Number of unread messages in the conversation /// 未读消息数
int unreadCount = 0; int? unreadCount;
// Latest message in the conversation /// 强制提示,[GroupAtType]包含@所有人,@个人以及公告提示
Message? latestMsg;
// Timestamp of the latest message
int? latestMsgSendTime;
// Draft text for the conversation
String? draftText;
// Timestamp when the draft text was created
int? draftTextTime;
// Indicates whether the conversation is pinned
bool? isPinned;
// Indicates whether the conversation is a private chat with features like self-destructing messages
bool? isPrivateChat;
// Duration for which messages are readable (in seconds)
int? burnDuration;
// Indicates whether the conversation has self-destructing messages enabled
bool? isMsgDestruct;
// Timestamp for self-destructing messages (in seconds)
int? msgDestructTime;
// Additional data or metadata
String? ex;
// Indicates whether the user is no longer in the group (if applicable)
bool? isNotInGroup;
// Group @ type, which includes @ all, @ individual, and announcement prompts
int? groupAtType; int? groupAtType;
// Constructor to create a ConversationInfo object /// 会话最新消息内容
Message? latestMsg;
/// 最新消息发送时间
int? latestMsgSendTime;
/// 草稿
String? draftText;
/// 草稿生成时间
int? draftTextTime;
/// 是否置顶
bool? isPinned;
/// 是否开启了私聊(阅后即焚)
bool? isPrivateChat;
/// 可阅读期限 s
int? burnDuration;
/// 是否开启定期销毁
bool? isMsgDestruct;
/// 定期销毁时间 s
int? msgDestructTime;
/// 附加内容
String? ex;
/// 是否还在组内如果退群返回true
bool? isNotInGroup;
ConversationInfo({ ConversationInfo({
required this.conversationID, required this.conversationID,
this.conversationType, this.conversationType,
@@ -72,7 +71,7 @@ class ConversationInfo {
this.showName, this.showName,
this.faceURL, this.faceURL,
this.recvMsgOpt, this.recvMsgOpt,
this.unreadCount = 0, this.unreadCount,
this.latestMsg, this.latestMsg,
this.latestMsgSendTime, this.latestMsgSendTime,
this.draftText, this.draftText,
@@ -87,7 +86,8 @@ class ConversationInfo {
this.msgDestructTime, this.msgDestructTime,
}); });
ConversationInfo.fromJson(Map<String, dynamic> json) : conversationID = json['conversationID'] { ConversationInfo.fromJson(Map<String, dynamic> json)
: conversationID = json['conversationID'] {
conversationType = json['conversationType']; conversationType = json['conversationType'];
userID = json['userID']; userID = json['userID'];
groupID = json['groupID']; groupID = json['groupID'];
@@ -115,7 +115,6 @@ class ConversationInfo {
msgDestructTime = json['msgDestructTime']; msgDestructTime = json['msgDestructTime'];
} }
// Method to convert the ConversationInfo object to a JSON map
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final data = Map<String, dynamic>(); final data = Map<String, dynamic>();
data['conversationID'] = this.conversationID; data['conversationID'] = this.conversationID;
@@ -141,18 +140,23 @@ class ConversationInfo {
return data; return data;
} }
// Check if it's a single chat /// 是单聊
bool get isSingleChat => conversationType == ConversationType.single; bool get isSingleChat => conversationType == ConversationType.single;
// Check if it's a group chat /// 是群聊
bool get isGroupChat => conversationType == ConversationType.group || conversationType == ConversationType.superGroup; bool get isGroupChat =>
conversationType == ConversationType.group ||
conversationType == ConversationType.superGroup;
// Check if it's a valid conversation (not in a group if isNotInGroup is true) /// 是有效的
bool get isValid => isSingleChat || (isGroupChat && !isNotInGroup!); bool get isValid => isSingleChat || isGroupChat && !isNotInGroup!;
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
identical(this, other) || other is ConversationInfo && runtimeType == other.runtimeType && conversationID == other.conversationID; identical(this, other) ||
other is ConversationInfo &&
runtimeType == other.runtimeType &&
conversationID == other.conversationID;
@override @override
int get hashCode => conversationID.hashCode; int get hashCode => conversationID.hashCode;

View File

@@ -1,56 +1,56 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// Group Information /// 群信息
class GroupInfo { class GroupInfo {
/// Group ID /// ID
String groupID; String groupID;
/// Group Name /// 群名
String? groupName; String? groupName;
/// Group Announcement /// 群公告
String? notification; String? notification;
/// Group Introduction /// 群简介
String? introduction; String? introduction;
/// Group Avatar /// 群头像
String? faceURL; String? faceURL;
/// Owner's ID /// 拥有者ID
String? ownerUserID; String? ownerUserID;
/// Creation Time /// 创建时间
int? createTime; int? createTime;
/// Number of Group Members /// 群成员数
int? memberCount; int? memberCount;
/// Group Status: 0 - Normal, 1 - Blocked, 2 - Dissolved, 3 - Muted /// 群状态0正常1被封2解散3禁言
int? status; int? status;
/// Creator's ID /// 创建者ID
String? creatorUserID; String? creatorUserID;
/// Group Type [GroupType] /// 群类型[GroupType]
int? groupType; int? groupType;
/// Extra Information /// 扩展字段
String? ex; String? ex;
/// Entry Verification Method [GroupVerification] /// 进群验证方式[GroupVerification]
int? needVerification; int? needVerification;
/// Don't Allow Access to Member Information via the Group: 0 - Disabled, 1 - Enabled /// 不允许通过群获取成员资料 0关闭1打开
int? lookMemberInfo; int? lookMemberInfo;
/// Don't Allow Adding Friends via the Group: 0 - Disabled, 1 - Enabled /// 不允许通过群添加好友 0关闭1打开
int? applyMemberFriend; int? applyMemberFriend;
/// Notification Update Time /// 通知更新时间
int? notificationUpdateTime; int? notificationUpdateTime;
/// Notification Initiator /// 通知发起人
String? notificationUserID; String? notificationUserID;
GroupInfo({ GroupInfo({
@@ -74,6 +74,7 @@ class GroupInfo {
}); });
GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] { GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] {
/*groupID = json['groupID'];*/
groupName = json['groupName']; groupName = json['groupName'];
notification = json['notification']; notification = json['notification'];
introduction = json['introduction']; introduction = json['introduction'];
@@ -114,7 +115,7 @@ class GroupInfo {
return data; return data;
} }
/// Corresponding Conversation Type for Group Type /// 群类型对应的会话类型
int get sessionType => groupType == GroupType.general int get sessionType => groupType == GroupType.general
? ConversationType.group ? ConversationType.group
: ConversationType.superGroup; : ConversationType.superGroup;
@@ -130,42 +131,42 @@ class GroupInfo {
int get hashCode => groupID.hashCode; int get hashCode => groupID.hashCode;
} }
/// Group Member Information /// 群成员信息
class GroupMembersInfo { class GroupMembersInfo {
/// Group ID /// 群id
String? groupID; String? groupID;
/// User ID /// 用户id
String? userID; String? userID;
/// Nickname /// 昵称
String? nickname; String? nickname;
/// Avatar /// 头像
String? faceURL; String? faceURL;
/// Role [GroupRoleLevel] /// 角色[GroupRoleLevel]
int? roleLevel; int? roleLevel;
/// Join Time /// 加入时间
int? joinTime; int? joinTime;
/// Entry Source: 2 - Invited, 3 - Searched, 4 - QR Code /// 入群方式 2邀请加入 3搜索加入 4通过二维码加入
int? joinSource; int? joinSource;
/// Operator's ID /// 操作者id
String? operatorUserID; String? operatorUserID;
/// Extra Information /// 扩展字段
String? ex; String? ex;
/// Mute End Time (seconds) /// 禁言时间s
int? muteEndTime; int? muteEndTime;
/// Application Manager Level ///
int? appManagerLevel; int? appMangerLevel;
/// Inviter's User ID /// 邀请人id
String? inviterUserID; String? inviterUserID;
GroupMembersInfo({ GroupMembersInfo({
@@ -179,7 +180,7 @@ class GroupMembersInfo {
this.joinSource, this.joinSource,
this.operatorUserID, this.operatorUserID,
this.muteEndTime, this.muteEndTime,
this.appManagerLevel, this.appMangerLevel,
this.inviterUserID, this.inviterUserID,
}); });
@@ -194,7 +195,7 @@ class GroupMembersInfo {
joinSource = json['joinSource']; joinSource = json['joinSource'];
operatorUserID = json['operatorUserID']; operatorUserID = json['operatorUserID'];
muteEndTime = json['muteEndTime']; muteEndTime = json['muteEndTime'];
appManagerLevel = json['appManagerLevel']; appMangerLevel = json['appMangerLevel'];
inviterUserID = json['inviterUserID']; inviterUserID = json['inviterUserID'];
} }
@@ -210,7 +211,7 @@ class GroupMembersInfo {
data['joinSource'] = this.joinSource; data['joinSource'] = this.joinSource;
data['operatorUserID'] = this.operatorUserID; data['operatorUserID'] = this.operatorUserID;
data['muteEndTime'] = this.muteEndTime; data['muteEndTime'] = this.muteEndTime;
data['appManagerLevel'] = this.appManagerLevel; data['appMangerLevel'] = this.appMangerLevel;
data['inviterUserID'] = this.inviterUserID; data['inviterUserID'] = this.inviterUserID;
return data; return data;
} }
@@ -227,12 +228,12 @@ class GroupMembersInfo {
int get hashCode => groupID.hashCode ^ userID.hashCode; int get hashCode => groupID.hashCode ^ userID.hashCode;
} }
/// Group Member Role /// 群成员角色
class GroupMemberRole { class GroupMemberRole {
/// User ID /// 用户ID
String? userID; String? userID;
/// [GroupRoleLevel] 1: Normal Member, 2: Group Owner, 3: Administrator /// [GroupRoleLevel] 1普通成员, 2群主3管理员
int? roleLevel; int? roleLevel;
GroupMemberRole({this.userID, this.roleLevel = 1}); GroupMemberRole({this.userID, this.roleLevel = 1});
@@ -250,78 +251,78 @@ class GroupMemberRole {
} }
} }
/// Group Application Information /// 群申请信息
class GroupApplicationInfo { class GroupApplicationInfo {
/// Group ID /// ID
String? groupID; String? groupID;
/// Group Nickname /// 群昵称
String? groupName; String? groupName;
/// Group Announcement /// 群公告
String? notification; String? notification;
/// Group Introduction /// 群介绍
String? introduction; String? introduction;
/// Group Avatar /// 群头像
String? groupFaceURL; String? groupFaceURL;
/// Group Creation Time /// 群创建时间
int? createTime; int? createTime;
/// Group Status /// 群状态
int? status; int? status;
/// Creator's ID /// 创建者id
String? creatorUserID; String? creatorUserID;
/// Group Type /// 群类型
int? groupType; int? groupType;
/// Owner's ID /// 拥有者id
String? ownerUserID; String? ownerUserID;
/// Member Count /// 成员数量
int? memberCount; int? memberCount;
/// User ID Initiating the Group Join Request /// 发起入群申请的用户id
String? userID; String? userID;
/// User's Nickname Initiating the Group Join Request /// 发起入群申请的用户昵称
String? nickname; String? nickname;
/// User's Avatar Initiating the Group Join Request /// 发起入群申请的用户头像
String? userFaceURL; String? userFaceURL;
/// User's Gender Initiating the Group Join Request /// 发起入群申请的用户性别
int? gender; int? gender;
/// Handling Result: -1 - Rejected, 1 - Accepted /// 处理结果:-1拒绝1同意
int? handleResult; int? handleResult;
/// Request Description /// 请求说明
String? reqMsg; String? reqMsg;
/// Handling Result Description /// 处理结果说明
String? handledMsg; String? handledMsg;
/// Request Time /// 请求时间
int? reqTime; int? reqTime;
/// Handler User ID /// 处理者用户ID
String? handleUserID; String? handleUserID;
/// Handling Time /// 处理时间
int? handledTime; int? handledTime;
/// Extra Information /// 扩展信息
String? ex; String? ex;
/// Join Source: 2 - Invited, 3 - Searched, 4 - QR Code /// 2通过邀请 3通过搜索 4通过二维码
int? joinSource; int? joinSource;
/// Inviting User's ID /// 邀请进群用户ID
String? inviterUserID; String? inviterUserID;
GroupApplicationInfo({ GroupApplicationInfo({
@@ -408,7 +409,6 @@ class GroupApplicationInfo {
} }
} }
/// Group Invitation Result
class GroupInviteResult { class GroupInviteResult {
String? userID; String? userID;
int? result; int? result;

View File

@@ -1,43 +0,0 @@
class InitConfig {
int platformID;
String apiAddr;
String wsAddr;
String dataDir;
int logLevel;
bool isLogStandardOutput;
String? logFilePath;
InitConfig({
required this.platformID,
required this.apiAddr,
required this.wsAddr,
required this.dataDir,
this.logLevel = 6,
this.isLogStandardOutput = true,
this.logFilePath,
});
factory InitConfig.fromJson(Map<String, dynamic> json) {
return InitConfig(
platformID: json['platformID'],
apiAddr: json['apiAddr'],
wsAddr: json['wsAddr'],
dataDir: json['dataDir'],
logLevel: json['logLevel'],
isLogStandardOutput: json['isLogStandardOutput'],
logFilePath: json['logFilePath'],
);
}
Map<String, dynamic> toMap() {
return {
'platformID': platformID,
'apiAddr': apiAddr,
'wsAddr': wsAddr,
'dataDir': dataDir,
'logLevel': logLevel,
'isLogStandardOutput': isLogStandardOutput,
'logFilePath': logFilePath,
};
}
}

View File

@@ -0,0 +1,155 @@
class MeetingInfoList {
List<MeetingInfo>? meetingInfoList;
MeetingInfoList({this.meetingInfoList});
MeetingInfoList.fromJson(Map<String, dynamic> json) {
if (json['meetingInfoList'] != null) {
meetingInfoList = <MeetingInfo>[];
json['meetingInfoList'].forEach((v) {
meetingInfoList!.add(MeetingInfo.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.meetingInfoList != null) {
data['meetingInfoList'] =
this.meetingInfoList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class MeetingInfo {
String? roomID;
String? meetingName;
String? ex;
String? hostUserID;
List<String>? inviteeUserIDList; //邀请列表
int? createTime;
int? startTime;
int? endTime;
bool? participantCanUnmuteSelf; //成员是否能自己解除禁言
bool? participantCanEnableVideo; //成员是否能开启视频
bool? onlyHostInviteUser; //仅主持人可邀请用户
bool? onlyHostShareScreen; //仅主持人可共享屏幕
bool? joinDisableMicrophone; //加入是否默认关麦克风
bool? joinDisableVideo; //加入是否默认关视频
bool? isMuteAllVideo; // 是否全员禁用视频
bool? isMuteAllMicrophone; // 是否全员禁用麦克风
List<String>? canScreenUserIDList; // 可共享屏幕的ID列表
List<String>? disableMicrophoneUserIDList; // 当前被禁言麦克风的id列表
List<String>? disableVideoUserIDList; // 当前禁用视频流的ID列表
List<String>? pinedUserIDList; // 置顶ID列表
List<String>? beWatchedUserIDList; // 正在被观看用户列表
MeetingInfo({
this.roomID,
this.meetingName,
this.ex,
this.hostUserID,
this.inviteeUserIDList,
this.createTime,
this.startTime,
this.endTime,
this.participantCanUnmuteSelf,
this.participantCanEnableVideo,
this.onlyHostInviteUser,
this.onlyHostShareScreen,
this.joinDisableMicrophone,
this.joinDisableVideo,
this.isMuteAllVideo,
this.isMuteAllMicrophone,
this.canScreenUserIDList,
this.disableMicrophoneUserIDList,
this.disableVideoUserIDList,
this.pinedUserIDList,
this.beWatchedUserIDList,
});
MeetingInfo.fromJson(Map<String, dynamic> json) {
roomID = json['roomID'];
meetingName = json['meetingName'];
ex = json['ex'];
hostUserID = json['hostUserID'];
inviteeUserIDList = json['inviteeUserIDList'] == null
? null
: (json['inviteeUserIDList'] as List).cast<String>();
createTime = json['createTime'];
startTime = json['startTime'];
endTime = json['endTime'];
participantCanUnmuteSelf = json['participantCanUnmuteSelf'];
participantCanEnableVideo = json['participantCanEnableVideo'];
onlyHostInviteUser = json['onlyHostInviteUser'];
onlyHostShareScreen = json['onlyHostShareScreen'];
joinDisableMicrophone = json['joinDisableMicrophone'];
joinDisableVideo = json['joinDisableVideo'];
isMuteAllVideo = json['isMuteAllVideo'];
isMuteAllMicrophone = json['isMuteAllMicrophone'];
canScreenUserIDList = json['canScreenUserIDList'] == null
? null
: (json['canScreenUserIDList'] as List).cast<String>();
disableMicrophoneUserIDList = json['disableMicrophoneUserIDList'] == null
? null
: (json['disableMicrophoneUserIDList'] as List).cast<String>();
disableVideoUserIDList = json['disableVideoUserIDList'] == null
? null
: (json['disableVideoUserIDList'] as List).cast<String>();
pinedUserIDList = json['pinedUserIDList'] == null
? null
: (json['pinedUserIDList'] as List).cast<String>();
beWatchedUserIDList = json['beWatchedUserIDList'] == null
? null
: (json['beWatchedUserIDList'] as List).cast<String>();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['roomID'] = roomID;
data['meetingName'] = meetingName;
data['ex'] = ex;
data['hostUserID'] = hostUserID;
data['inviteeUserIDList'] = inviteeUserIDList;
data['createTime'] = createTime;
data['startTime'] = startTime;
data['endTime'] = endTime;
data['participantCanUnmuteSelf'] = participantCanUnmuteSelf;
data['participantCanEnableVideo'] = participantCanEnableVideo;
data['onlyHostInviteUser'] = onlyHostInviteUser;
data['onlyHostShareScreen'] = onlyHostShareScreen;
data['joinDisableMicrophone'] = joinDisableMicrophone;
data['joinDisableVideo'] = joinDisableVideo;
data['isMuteAllVideo'] = isMuteAllVideo;
data['isMuteAllMicrophone'] = isMuteAllMicrophone;
data['canScreenUserIDList'] = canScreenUserIDList;
data['disableMicrophoneUserIDList'] = disableMicrophoneUserIDList;
data['disableVideoUserIDList'] = disableVideoUserIDList;
data['pinedUserIDList'] = pinedUserIDList;
data['beWatchedUserIDList'] = beWatchedUserIDList;
return data;
}
}
class MeetingStreamEvent {
String? roomID;
String? streamType;
bool? mute;
MeetingStreamEvent({this.roomID, this.streamType, this.mute});
MeetingStreamEvent.fromJson(Map<String, dynamic> json) {
roomID = json['roomID'];
streamType = json['streamType'];
mute = json['mute'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['roomID'] = this.roomID;
data['streamType'] = this.streamType;
data['mute'] = this.mute;
return data;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,38 @@
import '../../flutter_openim_sdk.dart'; import '../../flutter_openim_sdk.dart';
/// OA notification /// oa 通知
class OANotification { class OANotification {
/// Title /// 标题
String? notificationName; String? notificationName;
/// Avatar /// 头像
String? notificationFaceURL; String? notificationFaceURL;
/// Type /// 类型
int? notificationType; int? notificationType;
/// Text content /// 文本内容
String? text; String? text;
/// Redirect link /// 跳转链接
String? externalUrl; String? externalUrl;
/// 0: Text-only notification /// 0:纯文字通知 1文字+图片通知 2文字+视频通知 3文字+文件通知
/// 1: Text + Image notification
/// 2: Text + Video notification
/// 3: Text + File notification
int? mixType; int? mixType;
/// Image information /// 图片信息
PictureElem? pictureElem; PictureElem? pictureElem;
/// Sound information /// 语音信息
SoundElem? soundElem; SoundElem? soundElem;
/// Video information /// 视频信息
VideoElem? videoElem; VideoElem? videoElem;
/// File information /// 文件信息
FileElem? fileElem; FileElem? fileElem;
/// Additional field /// 扩展字段
String? ex; String? ex;
OANotification( OANotification(

View File

@@ -0,0 +1,381 @@
/// 部门信息
class DeptInfo {
/// 部门id
String? departmentID;
/// 头像
String? faceURL;
/// 显示名
String? name;
/// 上一级部门id
String? parentID;
/// 排序方式
int? order;
/// 部门类型
int? departmentType;
/// 创建时间
int? createTime;
/// 子部门数量
int? subDepartmentNum;
/// 成员数量
int? memberNum;
/// 扩展字段
String? ex;
/// 附加信息
String? attachedInfo;
String? relatedGroupID;
DeptInfo(
{this.departmentID,
this.faceURL,
this.name,
this.parentID,
this.order,
this.departmentType,
this.createTime,
this.subDepartmentNum,
this.memberNum,
this.ex,
this.attachedInfo,
this.relatedGroupID});
DeptInfo.fromJson(Map<String, dynamic> json) {
departmentID = json['departmentID'];
faceURL = json['faceURL'];
name = json['name'];
parentID = json['parentID'];
order = json['order'];
departmentType = json['departmentType'];
createTime = json['createTime'];
subDepartmentNum = json['subDepartmentNum'];
memberNum = json['memberNum'];
ex = json['ex'];
attachedInfo = json['attachedInfo'];
relatedGroupID = json['relatedGroupID'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['departmentID'] = this.departmentID;
data['faceURL'] = this.faceURL;
data['name'] = this.name;
data['parentID'] = this.parentID;
data['order'] = this.order;
data['departmentType'] = this.departmentType;
data['createTime'] = this.createTime;
data['subDepartmentNum'] = this.subDepartmentNum;
data['memberNum'] = this.memberNum;
data['ex'] = this.ex;
data['attachedInfo'] = this.attachedInfo;
data['relatedGroupID'] = this.relatedGroupID;
return data;
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DeptInfo &&
runtimeType == other.runtimeType &&
departmentID == other.departmentID;
@override
int get hashCode => departmentID.hashCode;
}
/// 部门成员信息
class DeptMemberInfo {
/// 用户id
String? userID;
/// 用户昵称
String? nickname;
/// 英文名
String? englishName;
/// 头像
String? faceURL;
/// 性别
int? gender;
/// 手机号
String? mobile;
/// 座机
String? telephone;
/// 出生时间
int? birth;
/// 邮箱
String? email;
/// 所在部门的id
String? departmentID;
/// 排序方式
int? order;
/// 职位
String? position;
/// 是否是领导
int? leader;
/// 状态
int? status;
/// 创建时间
int? createTime;
/// 入职时间
int? entryTime;
/// 离职时间
int? terminationTime;
/// 扩展字段
String? ex;
/// 附加信息
String? attachedInfo;
/// 搜索时使用
String? departmentName;
/// 所在部门的所有上级部门
List<DeptInfo>? parentDepartmentList;
/// 当前部门信息
DeptInfo? department;
DeptMemberInfo({
this.userID,
this.nickname,
this.englishName,
this.faceURL,
this.gender,
this.mobile,
this.telephone,
this.birth,
this.email,
this.departmentID,
this.order,
this.position,
this.leader,
this.status,
this.createTime,
this.ex,
this.attachedInfo,
this.departmentName,
this.parentDepartmentList,
this.department,
});
DeptMemberInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
nickname = json['nickname'];
englishName = json['englishName'];
faceURL = json['faceURL'];
gender = json['gender'];
mobile = json['mobile'];
telephone = json['telephone'];
birth = json['birth'];
email = json['email'];
departmentID = json['departmentID'];
order = json['order'];
position = json['position'];
leader = json['leader'];
status = json['status'];
createTime = json['createTime'];
ex = json['ex'];
attachedInfo = json['attachedInfo'];
departmentName = json['departmentName'];
if (json['parentDepartmentList'] != null) {
parentDepartmentList = <DeptInfo>[];
json['parentDepartmentList'].forEach((v) {
parentDepartmentList!.add(DeptInfo.fromJson(v));
});
}
department = json['department'] == null
? null
: DeptInfo.fromJson(json['department']);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['userID'] = this.userID;
data['nickname'] = this.nickname;
data['englishName'] = this.englishName;
data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['mobile'] = this.mobile;
data['telephone'] = this.telephone;
data['birth'] = this.birth;
data['email'] = this.email;
data['departmentID'] = this.departmentID;
data['order'] = this.order;
data['position'] = this.position;
data['leader'] = this.leader;
data['status'] = this.status;
data['createTime'] = this.createTime;
data['ex'] = this.ex;
data['attachedInfo'] = this.attachedInfo;
data['departmentName'] = this.departmentName;
if (this.parentDepartmentList != null) {
data['parentDepartmentList'] =
this.parentDepartmentList!.map((v) => v.toJson()).toList();
}
data['department'] = this.department?.toJson();
return data;
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DeptMemberInfo &&
runtimeType == other.runtimeType &&
userID == other.userID;
@override
int get hashCode => userID.hashCode;
}
/// 用户所在的部门
class UserInDept {
/// 部门信息
DeptInfo? department;
/// 所在部门自己的信息
DeptMemberInfo? member;
UserInDept({this.department, this.member});
UserInDept.fromJson(Map<String, dynamic> json) {
department = json['department'] != null
? DeptInfo.fromJson(json['department'])
: null;
member =
json['member'] != null ? DeptMemberInfo.fromJson(json['member']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.department != null) {
data['department'] = this.department!.toJson();
}
if (this.member != null) {
data['member'] = this.member!.toJson();
}
return data;
}
}
/// 部门下的一级子部门跟员工
class DeptMemberAndSubDept {
/// 一级子部门
List<DeptInfo>? departmentList;
/// 一级成员
List<DeptMemberInfo>? departmentMemberList;
/// 当前部门的所有上一级部门
List<DeptInfo>? parentDepartmentList;
DeptMemberAndSubDept({
this.departmentList,
this.departmentMemberList,
this.parentDepartmentList,
});
DeptMemberAndSubDept.fromJson(Map<String, dynamic> json) {
if (json['departmentList'] != null) {
departmentList = <DeptInfo>[];
json['departmentList'].forEach((v) {
departmentList!.add(DeptInfo.fromJson(v));
});
}
if (json['departmentMemberList'] != null) {
departmentMemberList = <DeptMemberInfo>[];
json['departmentMemberList'].forEach((v) {
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
});
}
if (json['parentDepartmentList'] != null) {
parentDepartmentList = <DeptInfo>[];
json['parentDepartmentList'].forEach((v) {
parentDepartmentList!.add(DeptInfo.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.departmentList != null) {
data['departmentList'] =
this.departmentList!.map((v) => v.toJson()).toList();
}
if (this.departmentMemberList != null) {
data['departmentMemberList'] =
this.departmentMemberList!.map((v) => v.toJson()).toList();
}
if (this.parentDepartmentList != null) {
data['parentDepartmentList'] =
this.parentDepartmentList!.map((v) => v.toJson()).toList();
}
return data;
}
}
/// 搜索结果
class OrganizationSearchResult {
/// 部门列表
List<DeptInfo>? departmentList;
/// 部门成员列表
List<DeptMemberInfo>? departmentMemberList;
OrganizationSearchResult({
this.departmentList,
this.departmentMemberList,
});
OrganizationSearchResult.fromJson(Map<String, dynamic> json) {
if (json['departmentList'] != null) {
departmentList = <DeptInfo>[];
json['departmentList'].forEach((v) {
departmentList!.add(DeptInfo.fromJson(v));
});
}
if (json['departmentMemberList'] != null) {
departmentMemberList = <DeptMemberInfo>[];
json['departmentMemberList'].forEach((v) {
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.departmentList != null) {
data['departmentList'] =
this.departmentList!.map((v) => v.toJson()).toList();
}
if (this.departmentMemberList != null) {
data['departmentMemberList'] =
this.departmentMemberList!.map((v) => v.toJson()).toList();
}
return data;
}
}

View File

@@ -1,10 +1,10 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class SearchResult { class SearchResult {
/// Total number of messages obtained /// 获取到的总的消息数量
int? totalCount; int? totalCount;
/// Specific search results /// 搜索到的具体内容
List<SearchResultItems>? searchResultItems; List<SearchResultItems>? searchResultItems;
List<SearchResultItems>? findResultItems; List<SearchResultItems>? findResultItems;
@@ -31,32 +31,34 @@ class SearchResult {
final data = Map<String, dynamic>(); final data = Map<String, dynamic>();
data['totalCount'] = this.totalCount; data['totalCount'] = this.totalCount;
if (this.searchResultItems != null) { if (this.searchResultItems != null) {
data['searchResultItems'] = this.searchResultItems!.map((v) => v.toJson()).toList(); data['searchResultItems'] =
this.searchResultItems!.map((v) => v.toJson()).toList();
} }
if (this.findResultItems != null) { if (this.findResultItems != null) {
data['findResultItems'] = this.findResultItems!.map((v) => v.toJson()).toList(); data['findResultItems'] =
this.findResultItems!.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class SearchResultItems { class SearchResultItems {
/// Conversation ID /// 会话ID
String? conversationID; String? conversationID;
/// Conversation type: 1 for single chat, 2 for group chat, 3 for supergroup, 4 for notification conversation /// 会话类型1单聊2群聊3超级大群4通知会话
int? conversationType; int? conversationType;
/// Display name /// 显示名
String? showName; String? showName;
/// Profile picture /// 头像
String? faceURL; String? faceURL;
/// Number of messages found in this conversation /// 搜索到的这个会话下的消息数量
int? messageCount; int? messageCount;
/// List of [Message]s /// [Message]的列表
List<Message>? messageList; List<Message>? messageList;
SearchResultItems({this.conversationID, this.messageCount, this.messageList}); SearchResultItems({this.conversationID, this.messageCount, this.messageList});
@@ -112,18 +114,3 @@ class SearchParams {
return data; return data;
} }
} }
class SearchFriendsInfo extends FriendInfo {
late int relationship;
SearchFriendsInfo({required this.relationship}) : super();
SearchFriendsInfo.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
relationship = json['relationship'];
}
Map<String, dynamic> toJson() {
final data = super.toJson();
data['relationship'] = this.relationship;
return data ?? {};
}
}

View File

@@ -0,0 +1,245 @@
import 'dart:io';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class SignalingInfo {
/// 操作者
String? userID;
/// 邀请信息
InvitationInfo? invitation;
/// 离线显示内容
OfflinePushInfo? offlinePushInfo;
SignalingInfo({
this.userID,
this.invitation,
this.offlinePushInfo,
});
SignalingInfo.fromJson(Map<String, dynamic> json) {
invitation = json['invitation'] == null
? null
: InvitationInfo.fromJson(json['invitation']);
offlinePushInfo = json['offlinePushInfo'] == null
? null
: OfflinePushInfo.fromJson(json['offlinePushInfo']);
userID = json['userID'] ?? invitation?.inviterUserID;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['userID'] = this.userID;
data['invitation'] = this.invitation?.toJson();
data['offlinePushInfo'] = this.offlinePushInfo?.toJson();
return data;
}
}
class InvitationInfo {
/// 邀请者UserID
String? inviterUserID;
/// 被邀请者UserID列表如果是单聊只有一个元素
List<String>? inviteeUserIDList;
/// 如果是单聊,为""
String? groupID;
/// 房间ID必须唯一可以不设置。
String? roomID;
/// 邀请超时时间(秒)
int? timeout;
/// 发起时间
int? initiateTime;
/// video 或者 audio
String? mediaType;
/// [ConversationType]1为单聊2为群聊
int? sessionType;
/// 平台[Platform]
int? platformID;
InvitationInfo(
{this.inviterUserID,
this.inviteeUserIDList,
this.groupID,
this.roomID,
this.timeout,
this.initiateTime,
this.mediaType,
this.sessionType,
this.platformID});
InvitationInfo.fromJson(Map<String, dynamic> json) {
inviterUserID = json['inviterUserID'];
inviteeUserIDList = json['inviteeUserIDList']?.cast<String>();
groupID = json['groupID'];
roomID = json['roomID'];
timeout = json['timeout'];
initiateTime = json['initiateTime'];
mediaType = json['mediaType'];
sessionType = json['sessionType'];
platformID = json['platformID'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['inviterUserID'] = this.inviterUserID;
data['inviteeUserIDList'] = this.inviteeUserIDList;
data['groupID'] = this.groupID;
data['roomID'] = this.roomID;
data['timeout'] = this.timeout;
data['initiateTime'] = this.initiateTime;
data['mediaType'] = this.mediaType;
data['sessionType'] = this.sessionType;
data['platformID'] = this.platformID;
return data;
}
}
/// 信令凭证
class SignalingCertificate {
/// 登录token
String? token;
/// 房间id
String? roomID;
/// 服务器地址
String? liveURL;
/// 占线列表
List<String>? busyLineUserIDList;
SignalingCertificate({
this.token,
this.roomID,
this.liveURL,
this.busyLineUserIDList,
});
SignalingCertificate.fromJson(Map<String, dynamic> json) {
token = json['token'];
roomID = json['roomID'];
liveURL = json['liveURL'];
busyLineUserIDList = null == json['busyLineUserIDList']
? null
: json['busyLineUserIDList'].cast<String>();
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['token'] = this.token;
data['roomID'] = this.roomID;
data['liveURL'] = this.liveURL;
data['busyLineUserIDList'] = this.busyLineUserIDList;
return data;
}
}
class RoomCallingInfo {
InvitationInfo? invitation;
List<Participant>? participant;
String? roomID;
String? token;
String? liveURL;
String? groupID;
RoomCallingInfo({
this.invitation,
this.participant,
this.roomID,
this.token,
this.liveURL,
this.groupID,
});
RoomCallingInfo.fromJson(Map<String, dynamic> json) {
invitation = json['invitation'] != null
? InvitationInfo.fromJson(json['invitation'])
: null;
if (json['participant'] != null) {
participant = <Participant>[];
json['participant'].forEach((v) {
participant!.add(Participant.fromJson(v));
});
}
roomID = json['roomID'] ?? invitation?.roomID;
token = json['token'];
liveURL = json['liveURL'];
groupID = json['groupID'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.invitation != null) {
data['invitation'] = this.invitation!.toJson();
}
if (this.participant != null) {
data['participant'] = this.participant!.map((v) => v.toJson()).toList();
}
data['roomID'] = this.roomID;
data['token'] = this.token;
data['liveURL'] = this.liveURL;
data['groupID'] = this.groupID;
return data;
}
}
class Participant {
GroupInfo? groupInfo;
GroupMembersInfo? groupMemberInfo;
UserInfo? userInfo;
Participant({this.groupInfo, this.groupMemberInfo, this.userInfo});
Participant.fromJson(Map<String, dynamic> json) {
groupInfo = json['groupInfo'] != null
? GroupInfo.fromJson(json['groupInfo'])
: null;
groupMemberInfo = json['groupMemberInfo'] != null
? GroupMembersInfo.fromJson(json['groupMemberInfo'])
: null;
userInfo =
json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.groupInfo != null) {
data['groupInfo'] = this.groupInfo!.toJson();
}
if (this.groupMemberInfo != null) {
data['groupMemberInfo'] = this.groupMemberInfo!.toJson();
}
if (this.userInfo != null) {
data['userInfo'] = this.userInfo!.toJson();
}
return data;
}
}
class CustomSignaling {
String? roomID;
String? customInfo;
CustomSignaling({this.roomID, this.customInfo});
CustomSignaling.fromJson(Map<String, dynamic> json) {
roomID = json['roomID'];
customInfo = json['customInfo'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['roomID'] = roomID;
data['customInfo'] = customInfo;
return data;
}
}

View File

@@ -1,65 +1,199 @@
/// Is a friend not in the blacklist
/// 是好友不在黑名单
/// Not a friend on the blacklist
/// 不是好友在黑名单
/// Not a friend is not on the blacklist
/// 不是好友不在黑名单
class UserInfo { class UserInfo {
/// User ID /// 用户id
String? userID; String? userID;
/// User nickname /// 用户昵称
String? nickname; String? nickname;
/// Profile picture /// 头像
String? faceURL; String? faceURL;
/// Additional information /// 性别
int? gender;
/// 手机号
String? phoneNumber;
/// 出生时间
int? birth;
/// 邮箱
String? email;
/// 扩展字段
String? ex; String? ex;
/// Creation time /// 创建时间
int? createTime; int? createTime;
/// Remark /// 备注
String? remark; String? remark;
/// Global do not disturb setting: /// 全局免打扰 0正常1不接受消息2接受在线消息不接受离线消息
/// 0: Normal
/// 1: Do not accept messages
/// 2: Accept online messages but not offline messages
int? globalRecvMsgOpt; int? globalRecvMsgOpt;
int? appMangerLevel; /// 是允许添加为好友 1允许2
int? allowAddFriend;
/// 新消息铃声 1允许2
int? allowBeep;
/// 新消息震动 1允许2
int? allowVibration;
/// 禁止登录
int? forbidden;
/// 用户公开的资料
PublicUserInfo? publicInfo;
/// 好友才能查看的资料
FriendInfo? friendInfo;
/// 黑名单资料
BlacklistInfo? blackInfo;
/// 是否好友关系
bool? isFriendship;
/// 是否黑名单
bool? isBlacklist;
UserInfo({ UserInfo({
this.publicInfo,
this.friendInfo,
this.blackInfo,
this.isFriendship,
this.isBlacklist,
//
this.userID, this.userID,
this.nickname, this.nickname,
this.faceURL, this.faceURL,
this.appMangerLevel, this.phoneNumber,
this.birth,
this.gender,
this.email,
this.ex, this.ex,
this.createTime, this.createTime,
this.remark, this.remark,
this.globalRecvMsgOpt, this.globalRecvMsgOpt,
this.allowAddFriend,
this.allowBeep,
this.allowVibration,
this.forbidden,
}); });
// UserInfo.self(Map<String, dynamic> json) {
// userID = json['userID'];
// nickname = json['nickname'];
// faceURL = json['faceURL'];
// gender = json['gender'];
// phoneNumber = json['phoneNumber'];
// birth = json['birth'];
// email = json['email'];
// ex = json['ex'];
// createTime = json['createTime'];
// }
UserInfo.fromJson(Map<String, dynamic> json) { UserInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'] ?? userID; publicInfo = json['publicInfo'] != null
nickname = json['nickname'] ?? nickname; ? PublicUserInfo.fromJson(json['publicInfo'])
faceURL = json['faceURL'] ?? faceURL; : null;
remark = json['remark'] ?? remark; friendInfo = json['friendInfo'] != null
ex = json['ex'] ?? ex; ? FriendInfo.fromJson(json['friendInfo'])
: null;
blackInfo = json['blackInfo'] != null
? BlacklistInfo.fromJson(json['blackInfo'])
: null;
//
isFriendship = friendInfo != null;
isBlacklist = blackInfo != null;
userID = json['userID'] ?? _userID;
nickname = json['nickname'] ?? _nickname;
faceURL = json['faceURL'] ?? _faceUrl;
gender = json['gender'] ?? _gender;
phoneNumber = json['phoneNumber'] ?? _phoneNumber;
birth = json['birth'] ?? _birth;
email = json['email'] ?? _email;
remark = json['remark'] ?? _remark;
ex = json['ex'] ?? _ex;
createTime = json['createTime']; createTime = json['createTime'];
globalRecvMsgOpt = json['globalRecvMsgOpt']; globalRecvMsgOpt = json['globalRecvMsgOpt'];
appMangerLevel = json['appMangerLevel']; allowAddFriend = json['allowAddFriend'];
allowBeep = json['allowBeep'];
allowVibration = json['allowVibration'];
forbidden = json['forbidden'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final data = Map<String, dynamic>(); final data = Map<String, dynamic>();
data['appMangerLevel'] = this.appMangerLevel; data['publicInfo'] = this.publicInfo?.toJson();
data['friendInfo'] = this.friendInfo?.toJson();
data['blackInfo'] = this.blackInfo?.toJson();
//
data['isFriendship'] = this.isFriendship;
data['isBlacklist'] = this.isBlacklist;
data['userID'] = this.userID; data['userID'] = this.userID;
data['nickname'] = this.nickname; data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL; data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['email'] = this.email;
data['ex'] = this.ex; data['ex'] = this.ex;
data['createTime'] = this.createTime; data['createTime'] = this.createTime;
data['remark'] = this.remark; data['remark'] = this.remark;
data['globalRecvMsgOpt'] = this.globalRecvMsgOpt; data['globalRecvMsgOpt'] = this.globalRecvMsgOpt;
data['allowAddFriend'] = this.allowAddFriend;
data['allowBeep'] = this.allowBeep;
data['allowVibration'] = this.allowVibration;
data['forbidden'] = this.forbidden;
return data; return data;
} }
// bool get isFriendship => null != friendInfo;
//
// bool get isBlacklist => null != blackInfo;
bool get isMale => gender == 1;
String get _userID => isFriendship!
? friendInfo!.userID!
: (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!);
String? get _nickname => isFriendship!
? friendInfo?.nickname
: (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname);
String? get _faceUrl => isFriendship!
? friendInfo?.faceURL
: (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL);
int? get _gender => isFriendship!
? friendInfo?.gender
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
String? get _ex => isFriendship!
? friendInfo?.ex
: (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
String? get _phoneNumber => friendInfo?.phoneNumber;
int? get _birth => friendInfo?.birth;
String? get _birthTime => friendInfo?.birthTime;
String? get _email => friendInfo?.email;
String? get _remark => friendInfo?.remark;
String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!; String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!;
static String? _isNull(String? value) { static String? _isNull(String? value) {
@@ -68,77 +202,42 @@ class UserInfo {
} }
@override @override
bool operator ==(Object other) => identical(this, other) || other is UserInfo && runtimeType == other.runtimeType && userID == other.userID; bool operator ==(Object other) =>
identical(this, other) ||
other is UserInfo &&
runtimeType == other.runtimeType &&
userID == other.userID;
@override @override
int get hashCode => userID.hashCode; int get hashCode => userID.hashCode;
} }
class FullUserInfo { /// 公开的资料
/// User's public information
PublicUserInfo? publicInfo;
/// Information visible only to friends
FriendInfo? friendInfo;
/// Blacklist information
BlacklistInfo? blackInfo;
FullUserInfo.fromJson(Map<String, dynamic> json) {
publicInfo = json['publicInfo'] != null ? PublicUserInfo.fromJson(json['publicInfo']) : null;
friendInfo = json['friendInfo'] != null ? FriendInfo.fromJson(json['friendInfo']) : null;
blackInfo = json['blackInfo'] != null ? BlacklistInfo.fromJson(json['blackInfo']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['publicInfo'] = this.publicInfo?.toJson();
data['friendInfo'] = this.friendInfo?.toJson();
data['blackInfo'] = this.blackInfo?.toJson();
return data;
}
String get userID {
return publicInfo?.userID ?? friendInfo?.userID ?? blackInfo?.userID ?? '';
}
String get nickname {
return publicInfo?.nickname ?? friendInfo?.nickname ?? blackInfo?.nickname ?? '';
}
String get faceURL {
return publicInfo?.faceURL ?? friendInfo?.faceURL ?? blackInfo?.faceURL ?? '';
}
String get showName {
return friendInfo?.nickname ?? nickname;
}
}
class PublicUserInfo { class PublicUserInfo {
/// User ID /// 用户id
String? userID; String? userID;
/// Nickname /// 昵称
String? nickname; String? nickname;
/// Profile picture /// 头像
String? faceURL; String? faceURL;
/// App Manager Level: /// 性别
/// 1: AppOrdinaryUsers int? gender;
/// 2: AppAdmin
int? appManagerLevel;
/// Additional information /// AppOrdinaryUsers = 1 AppAdmin = 2
int? appMangerLevel;
/// 扩展信息
String? ex; String? ex;
PublicUserInfo({ PublicUserInfo({
this.userID, this.userID,
this.nickname, this.nickname,
this.faceURL, this.faceURL,
this.appManagerLevel, this.gender,
this.appMangerLevel,
this.ex, this.ex,
}); });
@@ -146,7 +245,8 @@ class PublicUserInfo {
userID = json['userID']; userID = json['userID'];
nickname = json['nickname']; nickname = json['nickname'];
faceURL = json['faceURL']; faceURL = json['faceURL'];
appManagerLevel = json['appManagerLevel']; gender = json['gender'];
appMangerLevel = json['appMangerLevel'];
ex = json['ex']; ex = json['ex'];
} }
@@ -155,49 +255,63 @@ class PublicUserInfo {
data['userID'] = this.userID; data['userID'] = this.userID;
data['nickname'] = this.nickname; data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL; data['faceURL'] = this.faceURL;
data['appMangerLevel'] = this.appManagerLevel; data['gender'] = this.gender;
data['appMangerLevel'] = this.appMangerLevel;
data['ex'] = this.ex; data['ex'] = this.ex;
return data; return data;
} }
} }
/// 好友信息
class FriendInfo { class FriendInfo {
/// owner User ID /// 用户id
String? ownerUserID;
/// User ID
String? userID; String? userID;
/// Nickname /// 昵称
String? nickname; String? nickname;
/// Profile picture /// 头像
String? faceURL; String? faceURL;
/// friend User ID /// 性别
String? friendUserID; int? gender;
/// Remark /// 手机号
String? phoneNumber;
/// 出生日期
String? birthTime;
/// 使用[birthTime]
int? birth;
/// 邮箱
String? email;
/// 备注
String? remark; String? remark;
/// Additional information /// 扩展字段
String? ex; String? ex;
/// Creation time /// 创建时间
int? createTime; int? createTime;
/// Add source /// 添加方式
int? addSource; int? addSource;
/// Operator User ID /// 操作者id
String? operatorUserID; String? operatorUserID;
FriendInfo({ FriendInfo({
this.ownerUserID,
this.userID, this.userID,
this.nickname, this.nickname,
this.faceURL, this.faceURL,
this.friendUserID, this.gender,
this.phoneNumber,
this.birth,
this.birthTime,
this.email,
this.remark, this.remark,
this.ex, this.ex,
this.createTime, this.createTime,
@@ -206,7 +320,7 @@ class FriendInfo {
}); });
FriendInfo.fromJson(Map<String, dynamic> json) { FriendInfo.fromJson(Map<String, dynamic> json) {
ownerUserID = json['ownerUserID']; // ownerUserID = json['ownerUserID'];
userID = json['userID']; userID = json['userID'];
remark = json['remark']; remark = json['remark'];
createTime = json['createTime']; createTime = json['createTime'];
@@ -214,13 +328,17 @@ class FriendInfo {
operatorUserID = json['operatorUserID']; operatorUserID = json['operatorUserID'];
nickname = json['nickname']; nickname = json['nickname'];
faceURL = json['faceURL']; faceURL = json['faceURL'];
friendUserID = json['friendUserID']; gender = json['gender'];
phoneNumber = json['phoneNumber'];
birth = json['birth'];
birthTime = json['birthTime'];
email = json['email'];
ex = json['ex']; ex = json['ex'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final data = Map<String, dynamic>(); final data = Map<String, dynamic>();
data['ownerUserID'] = this.ownerUserID; // data['ownerUserID'] = this.ownerUserID;
data['userID'] = this.userID; data['userID'] = this.userID;
data['remark'] = this.remark; data['remark'] = this.remark;
data['createTime'] = this.createTime; data['createTime'] = this.createTime;
@@ -228,7 +346,11 @@ class FriendInfo {
data['operatorUserID'] = this.operatorUserID; data['operatorUserID'] = this.operatorUserID;
data['nickname'] = this.nickname; data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL; data['faceURL'] = this.faceURL;
data['friendUserID'] = this.friendUserID; data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['birthTime'] = this.birthTime;
data['email'] = this.email;
data['ex'] = this.ex; data['ex'] = this.ex;
return data; return data;
} }
@@ -241,40 +363,33 @@ class FriendInfo {
} }
} }
/// 黑名单信息
class BlacklistInfo { class BlacklistInfo {
/// User ID /// 用户id
String? userID; String? userID;
/// Nickname /// 昵称
String? nickname; String? nickname;
/// owner User ID /// 头像
String? ownerUserID;
/// block User ID
String? blockUserID;
/// Profile picture
String? faceURL; String? faceURL;
/// Gender /// 性别
int? gender; int? gender;
/// Creation time /// 创建时间
int? createTime; int? createTime;
/// Add source /// 添加方式
int? addSource; int? addSource;
/// Operator User ID /// 操作者
String? operatorUserID; String? operatorUserID;
/// Additional information /// 扩展信息
String? ex; String? ex;
BlacklistInfo({ BlacklistInfo({
this.ownerUserID,
this.blockUserID,
this.userID, this.userID,
this.nickname, this.nickname,
this.faceURL, this.faceURL,
@@ -286,8 +401,6 @@ class BlacklistInfo {
}); });
BlacklistInfo.fromJson(Map<String, dynamic> json) { BlacklistInfo.fromJson(Map<String, dynamic> json) {
ownerUserID = json['ownerUserID'];
blockUserID = json['blockUserID'];
userID = json['userID']; userID = json['userID'];
nickname = json['nickname']; nickname = json['nickname'];
faceURL = json['faceURL']; faceURL = json['faceURL'];
@@ -300,8 +413,6 @@ class BlacklistInfo {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final data = Map<String, dynamic>(); final data = Map<String, dynamic>();
data['ownerUserID'] = this.ownerUserID;
data['blockUserID'] = this.blockUserID;
data['userID'] = this.userID; data['userID'] = this.userID;
data['nickname'] = this.nickname; data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL; data['faceURL'] = this.faceURL;
@@ -314,11 +425,12 @@ class BlacklistInfo {
} }
} }
/// 关系
class FriendshipInfo { class FriendshipInfo {
/// User ID /// 用户id
String? userID; String? userID;
/// 1 represents a friend (and not in the blacklist) /// 1表示好友(并且不是黑名单)
int? result; int? result;
FriendshipInfo({this.userID, this.result}); FriendshipInfo({this.userID, this.result});
@@ -336,53 +448,62 @@ class FriendshipInfo {
} }
} }
/// 好友申请信息
class FriendApplicationInfo { class FriendApplicationInfo {
/// Initiator user ID /// 发起者用户id
String? fromUserID; String? fromUserID;
/// Initiator user nickname /// 发起者用户昵称
String? fromNickname; String? fromNickname;
/// Initiator user profile picture /// 发起者用户头像
String? fromFaceURL; String? fromFaceURL;
/// Recipient user ID /// 发起者性别
int? fromGender;
/// 接收者用户id
String? toUserID; String? toUserID;
/// Recipient user nickname /// 接收者用户昵称
String? toNickname; String? toNickname;
/// Recipient user profile picture /// 接收者头像
String? toFaceURL; String? toFaceURL;
/// Handling result /// 接收者性别
int? toGender;
/// 处理结果
int? handleResult; int? handleResult;
/// Request message /// 请求消息
String? reqMsg; String? reqMsg;
/// Creation time /// 创建时间
int? createTime; int? createTime;
/// Handler user ID /// 处理者id
String? handlerUserID; String? handlerUserID;
/// Handling remark /// 处理备注
String? handleMsg; String? handleMsg;
/// Handling time /// 处理时间
int? handleTime; int? handleTime;
/// Additional information /// 扩展字段
String? ex; String? ex;
FriendApplicationInfo( FriendApplicationInfo(
{this.fromUserID, {this.fromUserID,
this.fromNickname, this.fromNickname,
this.fromFaceURL, this.fromFaceURL,
this.fromGender,
this.toUserID, this.toUserID,
this.toNickname, this.toNickname,
this.toFaceURL, this.toFaceURL,
this.toGender,
this.handleResult, this.handleResult,
this.reqMsg, this.reqMsg,
this.createTime, this.createTime,
@@ -395,9 +516,11 @@ class FriendApplicationInfo {
fromUserID = json['fromUserID']; fromUserID = json['fromUserID'];
fromNickname = json['fromNickname']; fromNickname = json['fromNickname'];
fromFaceURL = json['fromFaceURL']; fromFaceURL = json['fromFaceURL'];
fromGender = json['fromGender'];
toUserID = json['toUserID']; toUserID = json['toUserID'];
toNickname = json['toNickname']; toNickname = json['toNickname'];
toFaceURL = json['toFaceURL']; toFaceURL = json['toFaceURL'];
toGender = json['toGender'];
handleResult = json['handleResult']; handleResult = json['handleResult'];
reqMsg = json['reqMsg']; reqMsg = json['reqMsg'];
createTime = json['createTime']; createTime = json['createTime'];
@@ -412,9 +535,11 @@ class FriendApplicationInfo {
data['fromUserID'] = this.fromUserID; data['fromUserID'] = this.fromUserID;
data['fromNickname'] = this.fromNickname; data['fromNickname'] = this.fromNickname;
data['fromFaceURL'] = this.fromFaceURL; data['fromFaceURL'] = this.fromFaceURL;
data['fromGender'] = this.fromGender;
data['toUserID'] = this.toUserID; data['toUserID'] = this.toUserID;
data['toNickname'] = this.toNickname; data['toNickname'] = this.toNickname;
data['toFaceURL'] = this.toFaceURL; data['toFaceURL'] = this.toFaceURL;
data['toGender'] = this.toGender;
data['handleResult'] = this.handleResult; data['handleResult'] = this.handleResult;
data['reqMsg'] = this.reqMsg; data['reqMsg'] = this.reqMsg;
data['createTime'] = this.createTime; data['createTime'] = this.createTime;
@@ -425,43 +550,12 @@ class FriendApplicationInfo {
return data; return data;
} }
/// Waiting to be processed /// 等待处理
bool get isWaitingHandle => handleResult == 0; bool get isWaitingHandle => handleResult == 0;
/// Already agreed /// 已同意
bool get isAgreed => handleResult == 1; bool get isAgreed => handleResult == 1;
/// Already rejected /// 已拒绝
bool get isRejected => handleResult == -1; bool get isRejected => handleResult == -1;
} }
class UserStatusInfo {
/// User ID
String? userID;
/// Status
int? status;
/// Platform IDs
List<int>? platformIDs;
UserStatusInfo({
this.userID,
this.status,
this.platformIDs,
});
UserStatusInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
status = json['status'];
platformIDs = json["platformIDs"] == null ? [] : List<int>.from(json["platformIDs"].map((x) => x));
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['userID'] = this.userID;
data['status'] = this.status;
data['platformIDs'] = List<dynamic>.from(platformIDs!.map((x) => x));
return data;
}
}

View File

@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OpenIM { class OpenIM {
static const version = '3.8.0'; static const version = '3.1.0';
static const _channel = const MethodChannel('flutter_openim_sdk'); static const _channel = const MethodChannel('flutter_openim_sdk');

View File

@@ -5,48 +5,48 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.11.0" version: "2.10.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.2.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.18.0" version: "1.17.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
flutter: flutter:
@@ -59,62 +59,46 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
leak_tracker: js:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: js
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "10.0.4" version: "0.6.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.13"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.8.0" version: "0.2.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.12.0" version: "1.8.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.9.0" version: "1.8.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -124,32 +108,32 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.9.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.11.1" version: "1.11.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.2" version: "2.1.1"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
term_glyph: term_glyph:
@@ -157,33 +141,25 @@ packages:
description: description:
name: term_glyph name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.7.0" version: "0.4.16"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=2.18.0 <3.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=1.20.0"

View File

@@ -1,11 +1,11 @@
name: flutter_openim_sdk name: flutter_openim_sdk
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source. description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
version: 3.8.0 version: 3.0.0
homepage: https://www.openim.io homepage: https://www.rentsoft.cn
repository: https://github.com/openimsdk/open-im-sdk-flutter repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
environment: environment:
sdk: ">=3.0.0 <4.0.0" sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0" flutter: ">=1.20.0"
dependencies: dependencies: