Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0b28099bf | ||
|
|
d5d11af7ce | ||
|
|
9cd717c67c | ||
|
|
c7218cb94c | ||
|
|
e4c78e0106 | ||
|
|
7457f182f3 | ||
|
|
952cb82417 | ||
|
|
3cb2c6d514 | ||
|
|
90be2f74ac | ||
|
|
53ef6c2173 | ||
|
|
373171aded | ||
|
|
58702fcbaf | ||
|
|
8b8c9d5923 | ||
|
|
d5e3947878 | ||
|
|
6edf9b74fa | ||
|
|
fcc8373560 | ||
|
|
7e8d72929a | ||
|
|
03fa70c585 | ||
|
|
8b4a35e6b7 | ||
|
|
71897bcb4e | ||
|
|
57340e52a7 | ||
|
|
197f0b482f | ||
|
|
e009224256 | ||
|
|
ad0563aee4 | ||
|
|
d120312ac9 | ||
|
|
d64b426c90 | ||
|
|
3a845dc40b | ||
|
|
700265c685 | ||
|
|
73b9eb776f | ||
|
|
372e573ea0 | ||
|
|
8ea08f9ce6 | ||
|
|
40b65f52a5 | ||
|
|
6c0676fbe5 | ||
|
|
80152e2314 | ||
|
|
2381d26729 | ||
|
|
b25f0d8547 | ||
|
|
f4e7eaf50e | ||
|
|
f40d4148a8 |
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -3,4 +3,5 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<type id="android" />
|
<type id="android" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 25 Platform" project-jdk-type="Android SDK" />
|
||||||
</project>
|
</project>
|
||||||
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@@ -3,6 +3,7 @@
|
|||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/flutter_openim_sdk.iml" filepath="$PROJECT_DIR$/.idea/flutter_openim_sdk.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/flutter_openim_sdk.iml" filepath="$PROJECT_DIR$/.idea/flutter_openim_sdk.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/android/flutter_openim_sdk_android.iml" filepath="$PROJECT_DIR$/android/flutter_openim_sdk_android.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
58
CHANGELOG.md
58
CHANGELOG.md
@@ -1,3 +1,61 @@
|
|||||||
|
## 2.0.9
|
||||||
|
|
||||||
|
1.Fix bug </br>
|
||||||
|
2.New organization fuction</br>
|
||||||
|
3.New uploadImage method </br>
|
||||||
|
4.Fix login slow bug</br>
|
||||||
|
|
||||||
|
## 2.0.8
|
||||||
|
|
||||||
|
1.Fix bug </br>
|
||||||
|
2.Change the sdk maven address </br>
|
||||||
|
3.Sync go IM sdk version number </br>
|
||||||
|
|
||||||
|
## 2.0.0+6
|
||||||
|
|
||||||
|
1.Fix bug</br>
|
||||||
|
2.Adapter ios emulator</br>
|
||||||
|
3.New modify group nickname</br>
|
||||||
|
4.Update at message</br>
|
||||||
|
5.ConverstaionInfo new add isNotInGroup field</br>
|
||||||
|
6.New at type</br>
|
||||||
|
7.New work moments</br>
|
||||||
|
8.New global search</br>
|
||||||
|
9.New getHistoryMessageListReverse method</br>
|
||||||
|
10.New getAtAllTag method</br>
|
||||||
|
11.New resetConversationGroupAtType method</br>
|
||||||
|
12.New searchGroups method</br>
|
||||||
|
|
||||||
|
## 2.0.0+5
|
||||||
|
|
||||||
|
1.New notification parse </br>
|
||||||
|
2.New deleteConversationFromLocalAndSvr method </br>
|
||||||
|
3.New deleteMessageFromLocalAndSvr method </br>
|
||||||
|
4.New deleteAllMsgFromLocal method </br>
|
||||||
|
5.New deleteAllMsgFromLocalAndSvr method </br>
|
||||||
|
6.New clearC2CHistoryMessageFromLocalAndSvr method </br>
|
||||||
|
7.New clearGroupHistoryMessageFromLocalAndSvr method </br>
|
||||||
|
8.New markMessageAsReadByConID method </br>
|
||||||
|
9.New wakeUp method </br>
|
||||||
|
10.New deleteAllConversationFromLocal method </br>
|
||||||
|
|
||||||
|
## 2.0.0+4
|
||||||
|
|
||||||
|
1.New dismiss group </br>
|
||||||
|
2.New search local message </br>
|
||||||
|
3.New private chat </br>
|
||||||
|
4.New group mute
|
||||||
|
|
||||||
|
## 2.0.0+3
|
||||||
|
|
||||||
|
1.Fix bug </br>
|
||||||
|
|
||||||
|
## 2.0.0+2
|
||||||
|
|
||||||
|
1.Fix some one crash </br>
|
||||||
|
2.New add signaling function </br>
|
||||||
|
3.New add group have read receipt
|
||||||
|
|
||||||
## 2.0.0+1
|
## 2.0.0+1
|
||||||
|
|
||||||
1.Fix multi-terminal synchronization bug fix for retracted messages </br>
|
1.Fix multi-terminal synchronization bug fix for retracted messages </br>
|
||||||
|
|||||||
450
README.zh-cn.md
450
README.zh-cn.md
@@ -5,9 +5,11 @@
|
|||||||
```
|
```
|
||||||
OpenIM.iMManager.initSDK(
|
OpenIM.iMManager.initSDK(
|
||||||
platform: 0, // 平台,参照IMPlatform类,
|
platform: 0, // 平台,参照IMPlatform类,
|
||||||
apiAddr: "", // SDK的API接口地址。如:http:xxx:10000
|
apiAddr: "", // SDK的API接口地址。如:http://xxx:10000
|
||||||
wsAddr: "", // SDK的web socket地址。如: ws:xxx:17778
|
wsAddr: "", // SDK的web socket地址。如: ws://xxx:17778
|
||||||
dataDir: "", // 数据存储路径。如:var apath =(await getApplicationDocumentsDirectory()).path
|
dataDir: "", // 数据存储路径。如:var apath =(await getApplicationDocumentsDirectory()).path
|
||||||
|
objectStorage: 'cos', // 图片服务器默认'cos'
|
||||||
|
logLevel: 6, // 日志等级,默认值6
|
||||||
listener: OnConnectListener(
|
listener: OnConnectListener(
|
||||||
onConnectSuccess: () {
|
onConnectSuccess: () {
|
||||||
// 已经成功连接到服务器
|
// 已经成功连接到服务器
|
||||||
@@ -128,6 +130,23 @@ OpenIM.iMManager
|
|||||||
onGroupInfoChanged: (groupInfo) {
|
onGroupInfoChanged: (groupInfo) {
|
||||||
// 组资料变更
|
// 组资料变更
|
||||||
},
|
},
|
||||||
|
))
|
||||||
|
..signalingManager.setSignalingListener(OnSignalingListener(
|
||||||
|
onReceiveNewInvitation: (info) {
|
||||||
|
// 被邀请者收到:音视频通话邀请
|
||||||
|
},
|
||||||
|
onInviteeRejected: (info) {
|
||||||
|
// 邀请者收到:被邀请者拒绝音视频通话
|
||||||
|
},
|
||||||
|
onInviteeAccepted: (info) {
|
||||||
|
// 邀请者收到:被邀请者同意音视频通话
|
||||||
|
},
|
||||||
|
onInvitationTimeout: (info) {
|
||||||
|
// 邀请者收到:被邀请者超时未接通
|
||||||
|
},
|
||||||
|
onInvitationCancelled: (info) {
|
||||||
|
// 被邀请者收到:邀请者取消音视频通话
|
||||||
|
},
|
||||||
));
|
));
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -146,6 +165,8 @@ OpenIM.iMManager
|
|||||||
|
|
||||||
## 方法名、参数、返回值说明
|
## 方法名、参数、返回值说明
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### logout( 登出)
|
- ##### logout( 登出)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -154,6 +175,8 @@ OpenIM.iMManager
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getLoginUserInfo(获取当前登录用户的资料)
|
- ##### getLoginUserInfo(获取当前登录用户的资料)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -162,6 +185,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getLoginUserID(获取当前登录用户的ID)
|
- ##### getLoginUserID(获取当前登录用户的ID)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -170,6 +195,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getUsersInfo(根据用户ID批量获取用户信息)
|
- ##### getUsersInfo(根据用户ID批量获取用户信息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -180,6 +207,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getSelfUserInfo(获取当前登录用户的资料)
|
- ##### getSelfUserInfo(获取当前登录用户的资料)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -188,6 +217,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setSelfInfo(修改当前用登录户资料)
|
- ##### setSelfInfo(修改当前用登录户资料)
|
||||||
|
|
||||||
会触发当用户的onSelfInfoUpdated回调,以及好友的onFriendInfoChanged、onConversationChanged回调。
|
会触发当用户的onSelfInfoUpdated回调,以及好友的onFriendInfoChanged、onConversationChanged回调。
|
||||||
@@ -204,6 +235,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getAllConversationList(获取所有会话)
|
- ##### getAllConversationList(获取所有会话)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -212,6 +245,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getConversationListSplit(分页获取会话)
|
- ##### getConversationListSplit(分页获取会话)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -223,6 +258,8 @@ OpenIM.iMManager.conversationManager.getConversationListSplit(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getOneConversation(获取一个会话,如果不存在会自动创建)
|
- ##### getOneConversation(获取一个会话,如果不存在会自动创建)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -234,6 +271,8 @@ OpenIM.iMManager.conversationManager.getOneConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getMultipleConversation(根据会话id查询会话)
|
- ##### getMultipleConversation(根据会话id查询会话)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -244,6 +283,8 @@ OpenIM.iMManager.conversationManager.getOneConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### deleteConversation(根据会话id删除指定会话)
|
- ##### deleteConversation(根据会话id删除指定会话)
|
||||||
|
|
||||||
会触onTotalUnreadMessageCountChanged回调
|
会触onTotalUnreadMessageCountChanged回调
|
||||||
@@ -258,6 +299,8 @@ OpenIM.iMManager.conversationManager.deleteConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setConversationDraft(设置会话草稿)
|
- ##### setConversationDraft(设置会话草稿)
|
||||||
|
|
||||||
会触onConversationChanged回调
|
会触onConversationChanged回调
|
||||||
@@ -273,6 +316,8 @@ OpenIM.iMManager.conversationManager.setConversationDraft(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### pinConversation(置顶会话)
|
- ##### pinConversation(置顶会话)
|
||||||
|
|
||||||
会触onConversationChanged回调
|
会触onConversationChanged回调
|
||||||
@@ -288,6 +333,8 @@ OpenIM.iMManager.conversationManager.pinConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### markGroupMessageHasRead(标记群会话已读,清除未读数)
|
- ##### markGroupMessageHasRead(标记群会话已读,清除未读数)
|
||||||
|
|
||||||
会触onConversationChanged、onTotalUnreadMessageCountChanged回调
|
会触onConversationChanged、onTotalUnreadMessageCountChanged回调
|
||||||
@@ -298,6 +345,8 @@ OpenIM.iMManager.conversationManager.markGroupMessageHasRead(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getTotalUnreadMsgCount(获取未读消息总数)
|
- ##### getTotalUnreadMsgCount(获取未读消息总数)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -306,6 +355,8 @@ OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount().then((count){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getConversationIDBySessionType(查询会话id)
|
- ##### getConversationIDBySessionType(查询会话id)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -317,6 +368,8 @@ OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount().then((count){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setConversationRecvMessageOpt(设置免打扰模式)
|
- ##### setConversationRecvMessageOpt(设置免打扰模式)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -330,9 +383,12 @@ OpenIM.iMManager.conversationManager.setConversationRecvMessageOpt(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getConversationRecvMessageOpt(查询免打扰状态)
|
- ##### getConversationRecvMessageOpt(查询免打扰状态)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
/// 此方法已废弃,使用getOneConversation/getMultipleConversation方法替代
|
||||||
OpenIM.iMManager.conversationManager.getConversationRecvMessageOpt(
|
OpenIM.iMManager.conversationManager.getConversationRecvMessageOpt(
|
||||||
conversationIDList: [], // 会话id列表
|
conversationIDList: [], // 会话id列表
|
||||||
).then((list) {
|
).then((list) {
|
||||||
@@ -341,12 +397,80 @@ OpenIM.iMManager.conversationManager.getConversationRecvMessageOpt(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### setOneConversationPrivateChat(开启阅后即焚)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.conversationManager.setOneConversationPrivateChat(
|
||||||
|
conversationID:"", // 会话id
|
||||||
|
isPrivate:true,//true开启
|
||||||
|
).then((_) {
|
||||||
|
// 成功
|
||||||
|
}).catchError((_){
|
||||||
|
// 失败
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### deleteConversationFromLocalAndSvr(删除本地跟服务器端会话记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.conversationManager.deleteConversationFromLocalAndSvr(
|
||||||
|
conversationID:"", // 会话id
|
||||||
|
).then((_) {
|
||||||
|
// 成功
|
||||||
|
}).catchError((_){
|
||||||
|
// 失败
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### deleteAllConversationFromLocal(清空本地所有会话)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.conversationManager.deleteAllConversationFromLocal(
|
||||||
|
).then((_) {
|
||||||
|
// 成功
|
||||||
|
}).catchError((_){
|
||||||
|
// 失败
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### resetConversationGroupAtType
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.conversationManager.resetConversationGroupAtType(
|
||||||
|
conversationID:"", // 会话id
|
||||||
|
).then((_) {
|
||||||
|
// 成功
|
||||||
|
}).catchError((_){
|
||||||
|
// 失败
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### getAtAllTag
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.conversationManager.getAtAllTag();
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### simpleSort(自定义会话排序规则)
|
- ##### simpleSort(自定义会话排序规则)
|
||||||
|
|
||||||
```
|
```
|
||||||
var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序好的列表
|
var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序好的列表
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getFriendsInfo(根据userID查询好友资料)
|
- ##### getFriendsInfo(根据userID查询好友资料)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -357,6 +481,8 @@ var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### addFriend(发起好友申请)
|
- ##### addFriend(发起好友申请)
|
||||||
|
|
||||||
主动申请者收到OnFriendApplicationAdded
|
主动申请者收到OnFriendApplicationAdded
|
||||||
@@ -374,6 +500,8 @@ var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### checkFriend(检查是否是好友)
|
- ##### checkFriend(检查是否是好友)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -384,6 +512,8 @@ OpenIM.iMManager.friendshipManager.checkFriend(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### deleteFriend(删除好友)
|
- ##### deleteFriend(删除好友)
|
||||||
|
|
||||||
操作者收到OnFriendDeleted
|
操作者收到OnFriendDeleted
|
||||||
@@ -398,6 +528,8 @@ OpenIM.iMManager.friendshipManager.deleteFriend(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setFriendRemark(好友备注设置)
|
- ##### setFriendRemark(好友备注设置)
|
||||||
|
|
||||||
操作者收到OnFriendInfoChanged
|
操作者收到OnFriendInfoChanged
|
||||||
@@ -413,6 +545,8 @@ OpenIM.iMManager.friendshipManager.deleteFriend(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getFriendList(好友列表)
|
- ##### getFriendList(好友列表)
|
||||||
|
|
||||||
返回的数据里包含已拉入黑名单的好友,可以根据isBlacklist字段筛选。
|
返回的数据里包含已拉入黑名单的好友,可以根据isBlacklist字段筛选。
|
||||||
@@ -423,6 +557,8 @@ OpenIM.iMManager.friendshipManager.getFriendList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getRecvFriendApplicationList(收到的好友申请)
|
- ##### getRecvFriendApplicationList(收到的好友申请)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -431,6 +567,8 @@ OpenIM.iMManager.friendshipManager.getFriendList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getSendFriendApplicationList(发出的好友申请)
|
- ##### getSendFriendApplicationList(发出的好友申请)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -439,6 +577,8 @@ OpenIM.iMManager.friendshipManager.getSendFriendApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### addBlacklist(拉黑好友)
|
- ##### addBlacklist(拉黑好友)
|
||||||
|
|
||||||
操作者收到OnBlackAdded
|
操作者收到OnBlackAdded
|
||||||
@@ -453,6 +593,8 @@ OpenIM.iMManager.friendshipManager.getSendFriendApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getBlacklist(黑名单)
|
- ##### getBlacklist(黑名单)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -461,6 +603,8 @@ OpenIM.iMManager.friendshipManager.getBlacklist().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### removeBlacklist(移除黑名单)
|
- ##### removeBlacklist(移除黑名单)
|
||||||
|
|
||||||
操作者收到OnBlackDeleted
|
操作者收到OnBlackDeleted
|
||||||
@@ -475,6 +619,8 @@ OpenIM.iMManager.friendshipManager.removeBlacklist(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### acceptFriendApplication(接受好友申请)
|
- ##### acceptFriendApplication(接受好友申请)
|
||||||
|
|
||||||
操作者收到OnFriendApplicationAccepted、OnFriendAdded
|
操作者收到OnFriendApplicationAccepted、OnFriendAdded
|
||||||
@@ -492,6 +638,8 @@ OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### refuseFriendApplication(拒绝好友申请)
|
- ##### refuseFriendApplication(拒绝好友申请)
|
||||||
|
|
||||||
操作者收到OnFriendApplicationRejected
|
操作者收到OnFriendApplicationRejected
|
||||||
@@ -509,6 +657,8 @@ OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### inviteUserToGroup(邀请进组)
|
- ##### inviteUserToGroup(邀请进组)
|
||||||
|
|
||||||
直接进组无需同意。
|
直接进组无需同意。
|
||||||
@@ -528,6 +678,8 @@ OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### kickGroupMember(移除组成员)
|
- ##### kickGroupMember(移除组成员)
|
||||||
|
|
||||||
被踢者收到OnJoinedGroupDeleted
|
被踢者收到OnJoinedGroupDeleted
|
||||||
@@ -544,6 +696,8 @@ OpenIM.iMManager.groupManager.kickGroupMember(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getGroupMembersInfo(查询组成员信息)
|
- ##### getGroupMembersInfo(查询组成员信息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -555,6 +709,8 @@ OpenIM.iMManager.groupManager.getGroupMembersInfo(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getGroupMemberList(组成员列表)
|
- ##### getGroupMemberList(组成员列表)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -568,6 +724,8 @@ OpenIM.iMManager.groupManager.getGroupMemberList(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getJoinedGroupList(获取已加入的群组)
|
- ##### getJoinedGroupList(获取已加入的群组)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -576,6 +734,8 @@ OpenIM.iMManager.groupManager.getJoinedGroupList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### isJoinedGroup(检查是否已入群)
|
- ##### isJoinedGroup(检查是否已入群)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -586,6 +746,8 @@ OpenIM.iMManager.groupManager.isJoinedGroup(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createGroup(创建组)
|
- ##### createGroup(创建组)
|
||||||
|
|
||||||
初始成员收到OnJoinedGroupAdded
|
初始成员收到OnJoinedGroupAdded
|
||||||
@@ -604,6 +766,8 @@ OpenIM.iMManager.groupManager.createGroup(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setGroupInfo(修改组信息)
|
- ##### setGroupInfo(修改组信息)
|
||||||
|
|
||||||
群成员收到OnGroupInfoChanged
|
群成员收到OnGroupInfoChanged
|
||||||
@@ -619,6 +783,8 @@ OpenIM.iMManager.groupManager.setGroupInfo(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getGroupsInfo(根据id查询组信息)
|
- ##### getGroupsInfo(根据id查询组信息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -629,6 +795,8 @@ OpenIM.iMManager.groupManager.getGroupsInfo(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### joinGroup(申请入群组)
|
- ##### joinGroup(申请入群组)
|
||||||
|
|
||||||
需要通过管理员同意。
|
需要通过管理员同意。
|
||||||
@@ -644,6 +812,8 @@ OpenIM.iMManager.groupManager.joinGroup(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### quitGroup(退出组)
|
- ##### quitGroup(退出组)
|
||||||
|
|
||||||
退出者收到OnJoinedGroupDeleted
|
退出者收到OnJoinedGroupDeleted
|
||||||
@@ -660,6 +830,8 @@ OpenIM.iMManager.groupManager.quitGroup(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### transferGroupOwner(群转让)
|
- ##### transferGroupOwner(群转让)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -673,6 +845,8 @@ OpenIM.iMManager.groupManager.transferGroupOwner(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getRecvGroupApplicationList(收到的入群申请)
|
- ##### getRecvGroupApplicationList(收到的入群申请)
|
||||||
|
|
||||||
作为群主或者管理员,获取收到的群成员申请进群列表。
|
作为群主或者管理员,获取收到的群成员申请进群列表。
|
||||||
@@ -683,6 +857,8 @@ OpenIM.iMManager.groupManager.getRecvGroupApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getSendGroupApplicationList(发出的入群申请)
|
- ##### getSendGroupApplicationList(发出的入群申请)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -691,6 +867,8 @@ OpenIM.iMManager.groupManager.getSendGroupApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### acceptGroupApplication(接受入群申请)
|
- ##### acceptGroupApplication(接受入群申请)
|
||||||
|
|
||||||
申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
|
申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
|
||||||
@@ -707,6 +885,8 @@ OpenIM.iMManager.groupManager.acceptGroupApplication(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### refuseGroupApplication(拒绝入群申请)
|
- ##### refuseGroupApplication(拒绝入群申请)
|
||||||
|
|
||||||
申请者收到OnGroupApplicationRejected
|
申请者收到OnGroupApplicationRejected
|
||||||
@@ -721,6 +901,65 @@ OpenIM.iMManager.groupManager.refuseGroupApplication(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### dismissGroup(解散群)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.groupManager.dismissGroup(
|
||||||
|
groupID: '', // 组ID
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### changeGroupMute(开启群禁言)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.groupManager.changeGroupMute(
|
||||||
|
groupID: '', // 组ID
|
||||||
|
mute:true, // 禁言
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### changeGroupMemberMute(对群成员禁言)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.groupManager.changeGroupMemberMute(
|
||||||
|
groupID: '', // 组ID
|
||||||
|
userID:'', // 群成员userID
|
||||||
|
seconds:0, // 禁言时长s
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### setGroupMemberNickname(修改成员组昵称)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.groupManager.setGroupMemberNickname(
|
||||||
|
groupID: '', // 组ID
|
||||||
|
userID:'', // 群成员userID
|
||||||
|
groupNickname:'', // 群昵称
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### searchGroups(搜索群)
|
||||||
|
|
||||||
|
```
|
||||||
|
List<GroupInfo> list = await OpenIM.iMManager.groupManager.searchGroups(
|
||||||
|
keywordList: [], // 关键词
|
||||||
|
isSearchGroupID: true, // 以id搜索
|
||||||
|
isSearchGroupName: false, // 以群名搜索
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### sendMessage(发送消息)
|
- ##### sendMessage(发送消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -736,6 +975,8 @@ OpenIM.iMManager.messageManager.sendMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getHistoryMessageList(获取聊天记录)
|
- ##### getHistoryMessageList(获取聊天记录)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -753,6 +994,8 @@ OpenIM.iMManager.messageManager.getHistoryMessageList(
|
|||||||
|
|
||||||
下次就是list.first(index == 0),以此类推。
|
下次就是list.first(index == 0),以此类推。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### revokeMessage(撤回消息)
|
- ##### revokeMessage(撤回消息)
|
||||||
|
|
||||||
撤回成功需要当前用户从列表里移除Message然后更新ui,而另外一方通过撤回监听(onRecvMessageRevoked)移除。
|
撤回成功需要当前用户从列表里移除Message然后更新ui,而另外一方通过撤回监听(onRecvMessageRevoked)移除。
|
||||||
@@ -767,6 +1010,8 @@ OpenIM.iMManager.messageManager.revokeMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### deleteMessageFromLocalStorage(删除单条消息)
|
- ##### deleteMessageFromLocalStorage(删除单条消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -779,6 +1024,8 @@ OpenIM.iMManager.messageManager.deleteMessageFromLocalStorage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### insertSingleMessageToLocalStorage(向本地插入一条消息)
|
- ##### insertSingleMessageToLocalStorage(向本地插入一条消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -789,6 +1036,8 @@ OpenIM.iMManager.messageManager.insertSingleMessageToLocalStorage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### markC2CMessageAsRead(标记c2c消息已读)
|
- ##### markC2CMessageAsRead(标记c2c消息已读)
|
||||||
|
|
||||||
当调用此方法后,已读的消息会通过已读回执(onRecvC2CReadReceipt)告诉对方。
|
当调用此方法后,已读的消息会通过已读回执(onRecvC2CReadReceipt)告诉对方。
|
||||||
@@ -800,6 +1049,8 @@ OpenIM.iMManager.messageManager.markC2CMessageAsRead(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### typingStatusUpdate(正在输入提示)
|
- ##### typingStatusUpdate(正在输入提示)
|
||||||
|
|
||||||
会通过onRecvNewMessage回调
|
会通过onRecvNewMessage回调
|
||||||
@@ -811,6 +1062,8 @@ OpenIM.iMManager.messageManager.typingStatusUpdate(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### clearC2CHistoryMessage(清空c2c聊天记录)
|
- ##### clearC2CHistoryMessage(清空c2c聊天记录)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -823,6 +1076,8 @@ OpenIM.iMManager.messageManager.clearC2CHistoryMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### clearGroupHistoryMessage(清空群聊天记录)
|
- ##### clearGroupHistoryMessage(清空群聊天记录)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -835,6 +1090,8 @@ OpenIM.iMManager.messageManager.clearGroupHistoryMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createTextMessage(文本消息)
|
- ##### createTextMessage(文本消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -843,15 +1100,21 @@ var message = await OpenIM.iMManager.messageManager.createTextMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createTextAtMessage(@消息)
|
- ##### createTextAtMessage(@消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
var message = await OpenIM.iMManager.messageManager.createTextAtMessage(
|
var message = await OpenIM.iMManager.messageManager.createTextAtMessage(
|
||||||
text: '', // 发送的内容
|
text: '', // 发送的内容
|
||||||
atUidList: [], // 被@到的userID集合
|
atUserIDList: [], // 被@到的用户ID集合
|
||||||
|
atUserInfoList: [], // 被@到的用户Info集合
|
||||||
|
quoteMessage: null, //被引用的消息体
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createImageMessage(图片消息,相对路径)
|
- ##### createImageMessage(图片消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -862,6 +1125,8 @@ var message = await OpenIM.iMManager.messageManager.createImageMessage(
|
|||||||
|
|
||||||
注:initSDK时传入了数据缓存(dataDir)路径,如路径:A,这时需要你将图片复制到A路径下后,如 A/pic/a.png路径,imagePath的值:“/pic/a.png”。同以下其他消息的相对路径。
|
注:initSDK时传入了数据缓存(dataDir)路径,如路径:A,这时需要你将图片复制到A路径下后,如 A/pic/a.png路径,imagePath的值:“/pic/a.png”。同以下其他消息的相对路径。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createImageMessageFromFullPath(图片消息全路径)
|
- ##### createImageMessageFromFullPath(图片消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -870,6 +1135,8 @@ var message = await OpenIM.iMManager.messageManager.createImageMessageFromFullPa
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createSoundMessage(语音消息,相对路径)
|
- ##### createSoundMessage(语音消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -879,6 +1146,8 @@ var message = await OpenIM.iMManager.messageManager.createSoundMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createSoundMessageFromFullPath(语音消息全路径)
|
- ##### createSoundMessageFromFullPath(语音消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -888,6 +1157,8 @@ var message = await OpenIM.iMManager.messageManager.createSoundMessageFromFullPa
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createVideoMessage(视频消息,相对路径)
|
- ##### createVideoMessage(视频消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -899,6 +1170,8 @@ var message = await OpenIM.iMManager.messageManager.createVideoMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createVideoMessageFromFullPath(视频消息全路径)
|
- ##### createVideoMessageFromFullPath(视频消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -910,6 +1183,8 @@ var message = await OpenIM.iMManager.messageManager.createVideoMessageFromFullPa
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createFileMessage(文件消息,相对路径)
|
- ##### createFileMessage(文件消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -919,6 +1194,8 @@ var message = await OpenIM.iMManager.messageManager.createFileMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createFileMessageFromFullPath(文件消息全路径)
|
- ##### createFileMessageFromFullPath(文件消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -928,6 +1205,8 @@ var message = await OpenIM.iMManager.messageManager.createFileMessageFromFullPat
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createForwardMessage(转发消息)
|
- ##### createForwardMessage(转发消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -936,6 +1215,8 @@ var message = await OpenIM.iMManager.messageManager.createForwardMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createMergerMessage(合并消息)
|
- ##### createMergerMessage(合并消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -946,6 +1227,8 @@ var message = await OpenIM.iMManager.messageManager.createMergerMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createLocationMessage(位置消息)
|
- ##### createLocationMessage(位置消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -956,6 +1239,8 @@ var message = await OpenIM.iMManager.messageManager.createLocationMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createCustomMessage(自定义消息)
|
- ##### createCustomMessage(自定义消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -966,6 +1251,8 @@ var message = await OpenIM.iMManager.messageManager.createCustomMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createQuoteMessage(引用消息/消息回复)
|
- ##### createQuoteMessage(引用消息/消息回复)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -975,10 +1262,165 @@ var message = await OpenIM.iMManager.messageManager.createQuoteMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createCardMessage(名片消息)
|
- ##### createCardMessage(名片消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
OpenIM.iMManager.messageManager.createCardMessage(
|
OpenIM.iMManager.messageManager.createCardMessage(
|
||||||
data: {}, // 自定义内容
|
data: {}, // 自定义内容
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### searchLocalMessages(全局搜索)
|
||||||
|
|
||||||
|
```
|
||||||
|
SearchResult result = await OpenIM.iMManager.messageManager.searchLocalMessages(
|
||||||
|
conversationID: null, // 根据会话查询,如果是全局搜索传null
|
||||||
|
keywordList: [], // 搜索关键词列表,目前仅支持一个关键词搜索
|
||||||
|
keywordListMatchType: 0, // 关键词匹配模式,1代表与,2代表或,暂时未用
|
||||||
|
senderUserIDList: [], // 指定消息发送的uid列表 暂时未用
|
||||||
|
messageTypeList: [], // 消息类型列表
|
||||||
|
searchTimePosition: 0, // 搜索的起始时间点。默认为0即代表从现在开始搜索。UTC 时间戳,单位:秒
|
||||||
|
searchTimePeriod: 0, // 从起始时间点开始的过去时间范围,单位秒。默认为0即代表不限制时间范围,传24x60x60代表过去一天
|
||||||
|
pageIndex: 1, // 当前页数
|
||||||
|
count: 10, // 每页数量
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### deleteMessageFromLocalAndSvr(删除本地跟服务器聊天记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.createCardMessage(
|
||||||
|
message: null, // 消息体
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### deleteAllMsgFromLocal(清空所有本地聊天记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.deleteAllMsgFromLocal(
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### deleteAllMsgFromLocalAndSvr(清空本地跟服务器所有聊天记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.deleteAllMsgFromLocalAndSvr(
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### markMessageAsReadByConID(标记会话里某些消息为已读)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.markMessageAsReadByConID(
|
||||||
|
conversationID: null, // 会话ID
|
||||||
|
messageIDList: [], // 消息id列表
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### clearC2CHistoryMessageFromLocalAndSvr(清空单聊本地跟服务端聊天记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.clearC2CHistoryMessageFromLocalAndSvr(
|
||||||
|
uid: null, // 用户id
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### clearGroupHistoryMessageFromLocalAndSvr(清空群聊本地跟服务端聊天记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.clearGroupHistoryMessageFromLocalAndSvr(
|
||||||
|
gid: null, // 群组id
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### getHistoryMessageListReverse(获取新的聊天记录)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.messageManager.getHistoryMessageListReverse(
|
||||||
|
userID: '', // 单聊对象的userID
|
||||||
|
groupID: '', // 群聊的组id
|
||||||
|
startMsg: null, // 消息体
|
||||||
|
count: 0, // 每次拉取的数量
|
||||||
|
).then((list){
|
||||||
|
// List<Message>
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### signalingInvite(邀请个人加入音视频通话)
|
||||||
|
|
||||||
|
```
|
||||||
|
SignalingCertificate sc = await OpenIM.iMManager.signalingManager.signalingInvite(
|
||||||
|
info: null, // 信令对象SignalingInfo
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### signalingInviteInGroup(邀请群成员加入音视频通话)
|
||||||
|
|
||||||
|
```
|
||||||
|
SignalingCertificate sc = await OpenIM.iMManager.signalingManager.signalingInviteInGroup(
|
||||||
|
info: null, // 信令对象SignalingInfo
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### signalingAccept(接受邀请)
|
||||||
|
|
||||||
|
```
|
||||||
|
SignalingCertificate sc = await OpenIM.iMManager.signalingManager.signalingAccept(
|
||||||
|
info: null, // 信令对象SignalingInfo
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### signalingReject(拒绝邀请)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.signalingManager.signalingReject(
|
||||||
|
info: null, // 信令对象SignalingInfo
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### signalingCancel(取消)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.signalingManager.signalingCancel(
|
||||||
|
info: null, // 信令对象SignalingInfo
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- ##### signalingHungUp(挂断)
|
||||||
|
|
||||||
|
```
|
||||||
|
OpenIM.iMManager.signalingManager.signalingHungUp(
|
||||||
|
info: null, // 信令对象SignalingInfo
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ version '1.0'
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
url 'http://121.37.25.71:8081/repository/maven2/'
|
||||||
allowInsecureProtocol = true
|
allowInsecureProtocol = true
|
||||||
url 'http://121.37.25.71:8081/repository/maven-releases/'
|
|
||||||
}
|
}
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -19,8 +19,8 @@ buildscript {
|
|||||||
rootProject.allprojects {
|
rootProject.allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
url 'http://121.37.25.71:8081/repository/maven2/'
|
||||||
allowInsecureProtocol = true
|
allowInsecureProtocol = true
|
||||||
url 'http://121.37.25.71:8081/repository/maven-releases/'
|
|
||||||
}
|
}
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -41,5 +41,5 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.openim:client-sdk:2.0.4@aar'
|
implementation 'io.openim:core-sdk:2.0.9.6@aar'
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,10 @@ 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.OrganizationManager;
|
||||||
|
import io.openim.flutter_openim_sdk.manager.SignalingManager;
|
||||||
import io.openim.flutter_openim_sdk.manager.UserManager;
|
import io.openim.flutter_openim_sdk.manager.UserManager;
|
||||||
|
import io.openim.flutter_openim_sdk.manager.WorkMomentsManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,6 +40,9 @@ 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 WorkMomentsManager workMomentsManager;
|
||||||
|
private static OrganizationManager organizationManager;
|
||||||
|
|
||||||
public FlutterOpenimSdkPlugin() {
|
public FlutterOpenimSdkPlugin() {
|
||||||
}
|
}
|
||||||
@@ -48,6 +54,9 @@ 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();
|
||||||
|
FlutterOpenimSdkPlugin.workMomentsManager = new WorkMomentsManager();
|
||||||
|
FlutterOpenimSdkPlugin.organizationManager = new OrganizationManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -17,10 +17,18 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
|||||||
public void onRecvC2CReadReceipt(String s) {
|
public void onRecvC2CReadReceipt(String s) {
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
values.put("haveReadMessage", s);
|
values.put("c2cMessageReadReceipt", s);
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRecvGroupReadReceipt(String s) {
|
||||||
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
|
values.put("id", id);
|
||||||
|
values.put("groupMessageReadReceipt", s);
|
||||||
|
CommonUtil.emitEvent("advancedMsgListener", "onRecvGroupReadReceipt", values);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecvMessageRevoked(String s) {
|
public void onRecvMessageRevoked(String s) {
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package io.openim.flutter_openim_sdk.listener;
|
package io.openim.flutter_openim_sdk.listener;
|
||||||
|
|
||||||
|
|
||||||
|
import io.flutter.Log;
|
||||||
|
import io.flutter.plugin.common.MethodCall;
|
||||||
import io.flutter.plugin.common.MethodChannel;
|
import io.flutter.plugin.common.MethodChannel;
|
||||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||||
import open_im_sdk_callback.Base;
|
import open_im_sdk_callback.Base;
|
||||||
@@ -8,18 +10,22 @@ import open_im_sdk_callback.Base;
|
|||||||
public class OnBaseListener implements Base {
|
public class OnBaseListener implements Base {
|
||||||
|
|
||||||
MethodChannel.Result result;
|
MethodChannel.Result result;
|
||||||
|
MethodCall call;
|
||||||
|
|
||||||
public OnBaseListener(MethodChannel.Result result) {
|
public OnBaseListener(MethodChannel.Result result, MethodCall call) {
|
||||||
this.result = result;
|
this.result = result;
|
||||||
|
this.call = call;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int l, String s) {
|
public void onError(int l, String s) {
|
||||||
|
Log.i("F-OpenIMSDK(flutter call native)", "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(flutter call native)", "method: 【 " + call.method + " 】, onSuccess: " + s);
|
||||||
CommonUtil.runMainThreadReturn(result, s);
|
CommonUtil.runMainThreadReturn(result, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.openim.flutter_openim_sdk.listener;
|
||||||
|
|
||||||
|
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||||
|
|
||||||
|
public class OnOrganizationListener implements open_im_sdk_callback.OnOrganizationListener {
|
||||||
|
@Override
|
||||||
|
public void onOrganizationUpdated() {
|
||||||
|
CommonUtil.emitEvent("organizationListener", "onOrganizationUpdated", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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 onReceiveNewInvitation(String s) {
|
||||||
|
CommonUtil.emitEvent("signalingListener", "onReceiveNewInvitation", s);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHangUp(String s) {
|
||||||
|
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package io.openim.flutter_openim_sdk.listener;
|
||||||
|
|
||||||
|
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||||
|
|
||||||
|
public class OnWorkMomentsListener implements open_im_sdk_callback.OnWorkMomentsListener {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRecvNewNotification() {
|
||||||
|
CommonUtil.emitEvent("workMomentsListener", "OnRecvNewNotification", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,14 +16,14 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getAllConversationList(
|
Open_im_sdk.getAllConversationList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
|
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getConversationListSplit(
|
Open_im_sdk.getConversationListSplit(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
int2long(methodCall, "offset"),
|
int2long(methodCall, "offset"),
|
||||||
int2long(methodCall, "count")
|
int2long(methodCall, "count")
|
||||||
@@ -32,7 +32,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getOneConversation(
|
Open_im_sdk.getOneConversation(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
int2long(methodCall, "sessionType"),
|
int2long(methodCall, "sessionType"),
|
||||||
value(methodCall, "sourceID")
|
value(methodCall, "sourceID")
|
||||||
@@ -41,7 +41,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getMultipleConversation(
|
Open_im_sdk.getMultipleConversation(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "conversationIDList")
|
jsonValue(methodCall, "conversationIDList")
|
||||||
);
|
);
|
||||||
@@ -49,7 +49,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteConversation(
|
Open_im_sdk.deleteConversation(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "conversationID")
|
value(methodCall, "conversationID")
|
||||||
);
|
);
|
||||||
@@ -57,7 +57,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setConversationDraft(
|
Open_im_sdk.setConversationDraft(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "conversationID"),
|
value(methodCall, "conversationID"),
|
||||||
value(methodCall, "draftText")
|
value(methodCall, "draftText")
|
||||||
@@ -66,7 +66,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.pinConversation(
|
Open_im_sdk.pinConversation(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "conversationID"),
|
value(methodCall, "conversationID"),
|
||||||
value(methodCall, "isPinned")
|
value(methodCall, "isPinned")
|
||||||
@@ -75,7 +75,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.markSingleMessageHasRead(
|
// Open_im_sdk.markSingleMessageHasRead(
|
||||||
// new OnBaseListener(result),
|
// new OnBaseListener(result, methodCall),
|
||||||
// value(methodCall, "operationID"),
|
// value(methodCall, "operationID"),
|
||||||
// value(methodCall, "userID")
|
// value(methodCall, "userID")
|
||||||
// );
|
// );
|
||||||
@@ -83,7 +83,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.markGroupMessageHasRead(
|
Open_im_sdk.markGroupMessageHasRead(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "groupID")
|
value(methodCall, "groupID")
|
||||||
);
|
);
|
||||||
@@ -91,7 +91,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getTotalUnreadMsgCount(
|
Open_im_sdk.getTotalUnreadMsgCount(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setConversationRecvMessageOpt(
|
Open_im_sdk.setConversationRecvMessageOpt(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "conversationIDList"),
|
jsonValue(methodCall, "conversationIDList"),
|
||||||
int2long(methodCall, "status")
|
int2long(methodCall, "status")
|
||||||
@@ -113,9 +113,45 @@ public class ConversationManager extends BaseManager {
|
|||||||
|
|
||||||
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getConversationRecvMessageOpt(
|
Open_im_sdk.getConversationRecvMessageOpt(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "conversationIDList")
|
jsonValue(methodCall, "conversationIDList")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOneConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setOneConversationPrivateChat(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "conversationID"),
|
||||||
|
value(methodCall, "isPrivate")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteConversationFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.deleteConversationFromLocalAndSvr(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "conversationID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
Open_im_sdk.resetConversationGroupAtType(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "conversationID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAtAllTag(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getAtAllTag());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getDesignatedFriendsInfo(
|
Open_im_sdk.getDesignatedFriendsInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "uidList")
|
jsonValue(methodCall, "uidList")
|
||||||
);
|
);
|
||||||
@@ -23,7 +23,7 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.addFriend(
|
Open_im_sdk.addFriend(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
@@ -31,28 +31,28 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getRecvFriendApplicationList(
|
Open_im_sdk.getRecvFriendApplicationList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getSendFriendApplicationList(
|
Open_im_sdk.getSendFriendApplicationList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getFriendList(
|
Open_im_sdk.getFriendList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
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),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
@@ -60,7 +60,7 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.addBlack(
|
Open_im_sdk.addBlack(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "uid")
|
value(methodCall, "uid")
|
||||||
);
|
);
|
||||||
@@ -68,14 +68,14 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getBlackList(
|
Open_im_sdk.getBlackList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.removeBlack(
|
Open_im_sdk.removeBlack(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "uid")
|
value(methodCall, "uid")
|
||||||
);
|
);
|
||||||
@@ -83,7 +83,7 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.checkFriend(
|
Open_im_sdk.checkFriend(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "uidList")
|
jsonValue(methodCall, "uidList")
|
||||||
);
|
);
|
||||||
@@ -91,7 +91,7 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteFriend(
|
Open_im_sdk.deleteFriend(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "uid")
|
value(methodCall, "uid")
|
||||||
);
|
);
|
||||||
@@ -99,7 +99,7 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.acceptFriendApplication(
|
Open_im_sdk.acceptFriendApplication(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
@@ -107,21 +107,9 @@ public class FriendshipManager extends BaseManager {
|
|||||||
|
|
||||||
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.refuseFriendApplication(
|
Open_im_sdk.refuseFriendApplication(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
// Open_im_sdk.forceSyncFriendApplication();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void forceSyncFriend(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
// Open_im_sdk.forceSyncFriend();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void forceSyncBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
// Open_im_sdk.forceSyncBlackList();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.inviteUserToGroup(
|
Open_im_sdk.inviteUserToGroup(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "reason"),
|
value(methodCall, "reason"),
|
||||||
@@ -24,7 +24,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.kickGroupMember(
|
Open_im_sdk.kickGroupMember(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "reason"),
|
value(methodCall, "reason"),
|
||||||
@@ -34,7 +34,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupMembersInfo(
|
Open_im_sdk.getGroupMembersInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
jsonValue(methodCall, "uidList")
|
jsonValue(methodCall, "uidList")
|
||||||
@@ -43,7 +43,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupMemberList(
|
Open_im_sdk.getGroupMemberList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "filter"),
|
value(methodCall, "filter"),
|
||||||
@@ -55,14 +55,14 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getJoinedGroupList(
|
Open_im_sdk.getJoinedGroupList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
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),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "gInfo"),
|
jsonValue(methodCall, "gInfo"),
|
||||||
jsonValue(methodCall, "memberList")
|
jsonValue(methodCall, "memberList")
|
||||||
@@ -71,7 +71,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setGroupInfo(
|
Open_im_sdk.setGroupInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
jsonValue(methodCall, "gInfo")
|
jsonValue(methodCall, "gInfo")
|
||||||
@@ -80,7 +80,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupsInfo(
|
Open_im_sdk.getGroupsInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "gidList")
|
jsonValue(methodCall, "gidList")
|
||||||
);
|
);
|
||||||
@@ -88,7 +88,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.joinGroup(
|
Open_im_sdk.joinGroup(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "reason")
|
value(methodCall, "reason")
|
||||||
@@ -97,7 +97,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.quitGroup(
|
Open_im_sdk.quitGroup(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid")
|
value(methodCall, "gid")
|
||||||
);
|
);
|
||||||
@@ -105,7 +105,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.transferGroupOwner(
|
Open_im_sdk.transferGroupOwner(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "uid")
|
value(methodCall, "uid")
|
||||||
@@ -114,21 +114,21 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getRecvGroupApplicationList(
|
Open_im_sdk.getRecvGroupApplicationList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getSendGroupApplicationList(
|
Open_im_sdk.getSendGroupApplicationList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.acceptGroupApplication(
|
Open_im_sdk.acceptGroupApplication(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "uid"),
|
value(methodCall, "uid"),
|
||||||
@@ -139,7 +139,7 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.refuseGroupApplication(
|
Open_im_sdk.refuseGroupApplication(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "gid"),
|
value(methodCall, "gid"),
|
||||||
value(methodCall, "uid"),
|
value(methodCall, "uid"),
|
||||||
@@ -148,19 +148,46 @@ public class GroupManager extends BaseManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void forceSyncApplyGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
|
public void dismissGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.forceSyncApplyGroupRequest();
|
Open_im_sdk.dismissGroup(
|
||||||
// }
|
new OnBaseListener(result, methodCall),
|
||||||
//
|
value(methodCall, "operationID"),
|
||||||
// public void forceSyncGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
|
value(methodCall, "gid")
|
||||||
// Open_im_sdk.forceSyncGroupRequest();
|
);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public void forceSyncJoinedGroup(MethodCall methodCall, MethodChannel.Result result) {
|
public void changeGroupMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.forceSyncJoinedGroup();
|
Open_im_sdk.changeGroupMute(
|
||||||
// }
|
new OnBaseListener(result, methodCall),
|
||||||
//
|
value(methodCall, "operationID"),
|
||||||
// public void forceSyncJoinedGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
value(methodCall, "gid"),
|
||||||
// Open_im_sdk.forceSyncJoinedGroupMember();
|
value(methodCall, "mute")
|
||||||
// }
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void changeGroupMemberMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.changeGroupMemberMute(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "gid"),
|
||||||
|
value(methodCall, "uid"),
|
||||||
|
int2long(methodCall, "seconds")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupMemberNickname(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setGroupMemberNickname(new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "gid"),
|
||||||
|
value(methodCall, "uid"),
|
||||||
|
value(methodCall, "groupNickname")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void searchGroups(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.searchGroups(new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall, "searchParam")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ public class IMManager extends BaseManager {
|
|||||||
|
|
||||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.login(
|
Open_im_sdk.login(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "uid"),
|
value(methodCall, "uid"),
|
||||||
value(methodCall, "token")
|
value(methodCall, "token")
|
||||||
@@ -28,7 +28,7 @@ public class IMManager extends BaseManager {
|
|||||||
|
|
||||||
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.logout(
|
Open_im_sdk.logout(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -37,29 +37,20 @@ public class IMManager extends BaseManager {
|
|||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void getLoginUid(MethodCall methodCall, MethodChannel.Result result) {
|
public void wakeUp(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
|
Open_im_sdk.wakeUp(
|
||||||
// }
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void uploadImage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.getUsersInfo(
|
Open_im_sdk.uploadImage(
|
||||||
// jsonValue(methodCall, "uidList"), new BaseListener(result));
|
new OnBaseListener(result, methodCall),
|
||||||
// }
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "path"),
|
||||||
// public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
value(methodCall, "token"),
|
||||||
// Open_im_sdk.setSelfInfo(
|
value(methodCall, "obj")
|
||||||
// jsonValue(methodCall), new BaseListener(result));
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
// Open_im_sdk.forceSyncLoginUerInfo();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public void forceReConn(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
// Open_im_sdk.forceReConn();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
// Open_im_sdk.setSdkLog(value(methodCall, "sdkLog"));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class MessageManager extends BaseManager {
|
|||||||
|
|
||||||
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getHistoryMessageList(
|
Open_im_sdk.getHistoryMessageList(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
@@ -105,7 +105,7 @@ public class MessageManager extends BaseManager {
|
|||||||
|
|
||||||
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.revokeMessage(
|
Open_im_sdk.revokeMessage(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
@@ -113,19 +113,19 @@ public class MessageManager extends BaseManager {
|
|||||||
|
|
||||||
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.deleteMessageFromLocalStorage(
|
Open_im_sdk.deleteMessageFromLocalStorage(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.deleteMessages(new OnBaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
// Open_im_sdk.deleteMessages(new OnBaseListener(result, methodCall), CommonUtil.getSDKJsonParam(methodCall));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.insertSingleMessageToLocalStorage(
|
Open_im_sdk.insertSingleMessageToLocalStorage(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "message"),
|
jsonValue(methodCall, "message"),
|
||||||
value(methodCall, "receiverID"),
|
value(methodCall, "receiverID"),
|
||||||
@@ -133,22 +133,37 @@ public class MessageManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
|
public void insertGroupMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.findMessages(new OnBaseListener(result), jsonValue(methodCall, "messageIDList"));
|
Open_im_sdk.insertGroupMessageToLocalStorage(
|
||||||
// }
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall, "message"),
|
||||||
|
value(methodCall, "groupID"),
|
||||||
|
value(methodCall, "senderID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.markC2CMessageAsRead(
|
Open_im_sdk.markC2CMessageAsRead(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "userID"),
|
value(methodCall, "userID"),
|
||||||
jsonValue(methodCall, "messageIDList")
|
jsonValue(methodCall, "messageIDList")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void markGroupMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.markGroupMessageAsRead(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "groupID"),
|
||||||
|
jsonValue(methodCall, "messageIDList")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.typingStatusUpdate(
|
Open_im_sdk.typingStatusUpdate(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "userID"),
|
value(methodCall, "userID"),
|
||||||
value(methodCall, "msgTip")
|
value(methodCall, "msgTip")
|
||||||
@@ -167,7 +182,10 @@ public class MessageManager extends BaseManager {
|
|||||||
Open_im_sdk.createTextAtMessage(
|
Open_im_sdk.createTextAtMessage(
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "text"),
|
value(methodCall, "text"),
|
||||||
jsonValue(methodCall, "atUserList")));
|
jsonValue(methodCall, "atUserIDList"),
|
||||||
|
jsonValue(methodCall, "atUserInfoList"),
|
||||||
|
jsonValue(methodCall, "quoteMessage")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
@@ -285,13 +303,17 @@ public class MessageManager extends BaseManager {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
public void createFaceMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.forceSyncMsg();
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFaceMessage(
|
||||||
// }
|
value(methodCall, "operationID"),
|
||||||
|
int2long(methodCall, "index"),
|
||||||
|
value(methodCall, "data")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.clearC2CHistoryMessage(
|
Open_im_sdk.clearC2CHistoryMessage(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "userID")
|
value(methodCall, "userID")
|
||||||
);
|
);
|
||||||
@@ -299,9 +321,72 @@ public class MessageManager extends BaseManager {
|
|||||||
|
|
||||||
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.clearGroupHistoryMessage(
|
Open_im_sdk.clearGroupHistoryMessage(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "groupID")
|
value(methodCall, "groupID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void searchLocalMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.searchLocalMessages(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall, "filter")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.deleteMessageFromLocalAndSvr(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteAllMsgFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.deleteAllMsgFromLocal(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteAllMsgFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.deleteAllMsgFromLocalAndSvr(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void markMessageAsReadByConID(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.markMessageAsReadByConID(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "conversationID"),
|
||||||
|
jsonValue(methodCall, "messageIDList")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearC2CHistoryMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.clearC2CHistoryMessageFromLocalAndSvr(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "userID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearGroupHistoryMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.clearGroupHistoryMessageFromLocalAndSvr(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "groupID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getHistoryMessageListReverse(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getHistoryMessageListReverse(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
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.OnOrganizationListener;
|
||||||
|
import open_im_sdk.Open_im_sdk;
|
||||||
|
|
||||||
|
public class OrganizationManager extends BaseManager {
|
||||||
|
|
||||||
|
public void setOrganizationListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setOrganizationListener(new OnOrganizationListener());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getSubDepartment(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getSubDepartment(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "departmentID"),
|
||||||
|
int2long(methodCall, "offset"),
|
||||||
|
int2long(methodCall, "count")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getDepartmentMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getDepartmentMember(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "departmentID"),
|
||||||
|
int2long(methodCall, "offset"),
|
||||||
|
int2long(methodCall, "count")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getUserInDepartment(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getUserInDepartment(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "userID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getDepartmentMemberAndSubDepartment(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getDepartmentMemberAndSubDepartment(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "departmentID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,21 +14,21 @@ public class UserManager extends BaseManager {
|
|||||||
|
|
||||||
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getUsersInfo(
|
Open_im_sdk.getUsersInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "uidList"));
|
jsonValue(methodCall, "uidList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setSelfInfo(
|
Open_im_sdk.setSelfInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall));
|
jsonValue(methodCall));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getSelfUserInfo(
|
Open_im_sdk.getSelfUserInfo(
|
||||||
new OnBaseListener(result),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
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.OnWorkMomentsListener;
|
||||||
|
import open_im_sdk.Open_im_sdk;
|
||||||
|
|
||||||
|
public class WorkMomentsManager extends BaseManager {
|
||||||
|
|
||||||
|
public void setWorkMomentsListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setWorkMomentsListener(new OnWorkMomentsListener());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getWorkMomentsUnReadCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getWorkMomentsUnReadCount(new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getWorkMomentsNotification(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getWorkMomentsNotification(new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
int2long(methodCall, "offset"),
|
||||||
|
int2long(methodCall, "count"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearWorkMomentsNotification(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.clearWorkMomentsNotification(new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,8 +4,9 @@ import org.json.JSONObject;
|
|||||||
|
|
||||||
public class JsonUtil {
|
public class JsonUtil {
|
||||||
public static String toString(Object o) {
|
public static String toString(Object o) {
|
||||||
|
if (o == null) return null;
|
||||||
if (o instanceof String) {
|
if (o instanceof String) {
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuilder buffer = new StringBuilder();
|
||||||
buffer.append("\"");
|
buffer.append("\"");
|
||||||
buffer.append(o);
|
buffer.append(o);
|
||||||
buffer.append("\"");
|
buffer.append("\"");
|
||||||
|
|||||||
@@ -138,7 +138,6 @@
|
|||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -197,23 +196,6 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Embed Pods Frameworks";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -302,6 +284,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ARCHS = arm64;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
@@ -375,6 +358,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ARCHS = arm64;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
@@ -430,6 +414,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ARCHS = arm64;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
@@ -32,520 +31,4 @@ class _MyAppState extends State<MyApp> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initSDK() {
|
|
||||||
OpenIM.iMManager
|
|
||||||
.initSDK(
|
|
||||||
// "当前平台,参照IMPlatform类",
|
|
||||||
platform: 0,
|
|
||||||
// SDK的API接口地址。如:http:xxx:10000
|
|
||||||
apiAddr: "",
|
|
||||||
// SDK的web socket地址。如: ws:xxx:17778
|
|
||||||
wsAddr: "",
|
|
||||||
// 数据存储路径。如:var apath =(await getApplicationDocumentsDirectory()).path
|
|
||||||
dataDir: "",
|
|
||||||
listener: OnConnectListener(
|
|
||||||
onConnectSuccess: () {
|
|
||||||
// 已经成功连接到服务器
|
|
||||||
},
|
|
||||||
onConnecting: () {
|
|
||||||
// 正在连接到服务器,适合在 UI 上展示“正在连接”状态。
|
|
||||||
},
|
|
||||||
onConnectFailed: (code, errorMsg) {
|
|
||||||
// 连接服务器失败,可以提示用户当前网络连接不可用
|
|
||||||
},
|
|
||||||
onUserSigExpired: () {
|
|
||||||
// 登录票据已经过期,请使用新签发的 UserSig 进行登录。
|
|
||||||
},
|
|
||||||
onKickedOffline: () {
|
|
||||||
// 当前用户被踢下线,此时可以 UI 提示用户“您已经在其他端登录了当前账号,是否重新登录?”
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.then((value) {
|
|
||||||
if (value == true) {
|
|
||||||
// 初始化成功
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLisenter() {
|
|
||||||
OpenIM.iMManager
|
|
||||||
..userManager.setUserListener(OnUserListener(
|
|
||||||
onSelfInfoUpdated: (userInfo) {
|
|
||||||
// 当前登录用户资料变更回调
|
|
||||||
},
|
|
||||||
))
|
|
||||||
..messageManager.setAdvancedMsgListener(OnAdvancedMsgListener(
|
|
||||||
onRecvNewMessage: (message) {
|
|
||||||
// 收到新消息,界面添加新消息
|
|
||||||
},
|
|
||||||
onRecvMessageRevoked: (messageID) {
|
|
||||||
// 消息成功撤回,从界面移除消息
|
|
||||||
},
|
|
||||||
onRecvC2CReadReceipt: (list) {
|
|
||||||
// 消息被阅读回执,将消息标记为已读
|
|
||||||
},
|
|
||||||
))
|
|
||||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
|
||||||
onProgress: (messageID, progress) {
|
|
||||||
// 消息发送进度回调
|
|
||||||
},
|
|
||||||
))
|
|
||||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
|
||||||
onFriendApplicationRejected: (applicationInfo) {
|
|
||||||
// 发出或收到的好友申请被拒绝
|
|
||||||
},
|
|
||||||
onFriendApplicationDeleted: (applicationInfo) {
|
|
||||||
// 发出或收到的好友申请被删除
|
|
||||||
},
|
|
||||||
onFriendApplicationAdded: (applicationInfo) {
|
|
||||||
// 发出或收到的好友申请被添加
|
|
||||||
},
|
|
||||||
onFriendApplicationAccepted: (applicationInfo) {
|
|
||||||
// 发出或收到的好友申请已同意
|
|
||||||
},
|
|
||||||
onFriendAdded: (frinedInfo) {
|
|
||||||
// 好友被添加
|
|
||||||
},
|
|
||||||
onFriendDeleted: (frinedInfo) {
|
|
||||||
// 好友被删除
|
|
||||||
},
|
|
||||||
onFriendInfoChanged: (frinedInfo) {
|
|
||||||
// 朋友的资料发生变化
|
|
||||||
},
|
|
||||||
onBlacklistDeleted: (blackInfo) {
|
|
||||||
// 从黑名单删除
|
|
||||||
},
|
|
||||||
onBlacklistAdded: (blackInfo) {
|
|
||||||
// 拉入黑名单
|
|
||||||
},
|
|
||||||
))
|
|
||||||
..conversationManager.setConversationListener(OnConversationListener(
|
|
||||||
onNewConversation: (list) {
|
|
||||||
// 新增会话
|
|
||||||
},
|
|
||||||
onConversationChanged: (list) {
|
|
||||||
// 已添加的会话发送改变
|
|
||||||
},
|
|
||||||
onTotalUnreadMessageCountChanged: (count) {
|
|
||||||
// 未读消息数发送变化
|
|
||||||
},
|
|
||||||
))
|
|
||||||
..groupManager.setGroupListener(OnGroupListener(
|
|
||||||
onGroupMemberInfoChanged: (memberInfo) {
|
|
||||||
// 组成员信息发生变化
|
|
||||||
},
|
|
||||||
onGroupMemberDeleted: (memberInfo) {
|
|
||||||
// 组成员退出
|
|
||||||
},
|
|
||||||
onGroupMemberAdded: (memberInfo) {
|
|
||||||
// 组成员进入
|
|
||||||
},
|
|
||||||
onGroupApplicationRejected: (applicationInfo) {
|
|
||||||
// 发出或收到的组申请被拒绝
|
|
||||||
},
|
|
||||||
onGroupApplicationDeleted: (applicationInfo) {
|
|
||||||
// 发出或收到的组申请被删除
|
|
||||||
},
|
|
||||||
onGroupApplicationAdded: (applicationInfo) {
|
|
||||||
// 发出或收到的组申请有新增
|
|
||||||
},
|
|
||||||
onGroupApplicationAccepted: (applicationInfo) {
|
|
||||||
// 发出或收到的组申请被接受
|
|
||||||
},
|
|
||||||
onJoinedGroupDeleted: (groupInfo) {
|
|
||||||
// 退出群:退出者收到;踢出群:被踢者收到
|
|
||||||
},
|
|
||||||
onJoinedGroupAdded: (groupInfo) {
|
|
||||||
// 创建群: 初始成员收到;邀请进群:被邀请者收到
|
|
||||||
},
|
|
||||||
onGroupInfoChanged: (groupInfo) {
|
|
||||||
// 组资料变更
|
|
||||||
},
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
void login() {
|
|
||||||
OpenIM.iMManager
|
|
||||||
.login(
|
|
||||||
uid: "", // uid来自于自身业务服务器
|
|
||||||
token: "", // token需要业务服务器根据secret向OpenIM服务端交换获取
|
|
||||||
)
|
|
||||||
.then((value) {
|
|
||||||
// 返回当前登录用户的资料
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void imMager() {
|
|
||||||
OpenIM.iMManager.logout().then((_) {
|
|
||||||
// 退出成功
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.getLoginUserInfo().then((userInfo) {
|
|
||||||
// 当前登录用户的信息
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.getLoginUserID().then((userID) {
|
|
||||||
// 当前登录用户的ID
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void userManager() {
|
|
||||||
OpenIM.iMManager.userManager.getUsersInfo(
|
|
||||||
uidList: [], // 用户ID集合
|
|
||||||
).then((userInfoList) {
|
|
||||||
// 用户信息列表
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.userManager.getSelfUserInfo().then((userInfo) {
|
|
||||||
// 返回当前登录用户的资料
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.userManager
|
|
||||||
.setSelfInfo(
|
|
||||||
nickname: '',
|
|
||||||
// 昵称
|
|
||||||
faceURL: '',
|
|
||||||
// 头像
|
|
||||||
gender: 0,
|
|
||||||
// 性别: 男1,女0
|
|
||||||
phoneNumber: '',
|
|
||||||
// 手机号
|
|
||||||
email: '',
|
|
||||||
//邮箱
|
|
||||||
birth: 0,
|
|
||||||
//生日
|
|
||||||
ex: '', // 其他信息
|
|
||||||
)
|
|
||||||
.then((_) {});
|
|
||||||
}
|
|
||||||
|
|
||||||
void conversationManager() {
|
|
||||||
OpenIM.iMManager.conversationManager.getAllConversationList().then((list) {
|
|
||||||
// List<ConversationInfo> 会话列表
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.conversationManager.getConversationListSplit(
|
|
||||||
offset: 0, // 偏移量,如:第1页,offet:0,count:20;第2页:offset:20;
|
|
||||||
count: 0, // 每页数量
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.getOneConversation(
|
|
||||||
sourceID: "", // 如果是单聊值传userID,如果是群聊groupID
|
|
||||||
sessionType: 1, // 如果是单聊值传1,如果是群聊值传2
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.getMultipleConversation(
|
|
||||||
conversationIDList: [], // 会话ID集合
|
|
||||||
).then((list) {
|
|
||||||
// 返回与id匹配的会话列表
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.conversationManager
|
|
||||||
.deleteConversation(
|
|
||||||
conversationID: "", // 会话id
|
|
||||||
)
|
|
||||||
.then((_) => null)
|
|
||||||
.catchError((_) {});
|
|
||||||
OpenIM.iMManager.conversationManager.setConversationDraft(
|
|
||||||
conversationID: "", // 会话id
|
|
||||||
draftText: "", // 草稿
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.pinConversation(
|
|
||||||
conversationID: "", // 会话id
|
|
||||||
isPinned: true, // true:置顶;false:取消置顶
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.markGroupMessageHasRead(
|
|
||||||
groupID: "", // 组id
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount();
|
|
||||||
OpenIM.iMManager.conversationManager.getConversationIDBySessionType(
|
|
||||||
sourceID: "", // 如果是单聊值传userID,如果是群聊groupID
|
|
||||||
sessionType: 1, // 如果是单聊值传1,如果是群聊值传2
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.setConversationRecvMessageOpt(
|
|
||||||
conversationIDList: [], // 会话id列表
|
|
||||||
status: 1, // 1:不接受消息;2:接受在线消息不接受离线消息;0:正常
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.getConversationRecvMessageOpt(
|
|
||||||
conversationIDList: [], // 会话id列表
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.conversationManager.simpleSort([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void friendManager() {
|
|
||||||
OpenIM.iMManager.friendshipManager.getFriendsInfo(
|
|
||||||
uidList: [], // userId列表
|
|
||||||
).then((list) {
|
|
||||||
// List<UserInfo>
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.friendshipManager.addFriend(
|
|
||||||
uid: "", // 用户id
|
|
||||||
reason: '', // 发起好友申请的描述信息
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.friendshipManager
|
|
||||||
.getRecvFriendApplicationList()
|
|
||||||
.then((value) {
|
|
||||||
// List<FriendApplicationInfo> 申请列表
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.friendshipManager
|
|
||||||
.getSendFriendApplicationList()
|
|
||||||
.then((list) {
|
|
||||||
// List<FriendApplicationInfo> 申请列表
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.friendshipManager.getFriendList().then((list) {
|
|
||||||
// List<UserInfo> 好友信息列表
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.friendshipManager.setFriendRemark(
|
|
||||||
uid: '', // 好友userID
|
|
||||||
remark: '', // 备注名
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.friendshipManager.addBlacklist(
|
|
||||||
uid: "", // 好友userID
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.friendshipManager.getBlacklist().then((list) {
|
|
||||||
// List<UserInfo>
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.friendshipManager.removeBlacklist(
|
|
||||||
uid: "", // userID
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.friendshipManager.checkFriend(
|
|
||||||
uidList: [], // userID 列表
|
|
||||||
).then((value) {
|
|
||||||
// List<FriendshipInfo>
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.friendshipManager.deleteFriend(
|
|
||||||
uid: '', // userID
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|
||||||
uid: "", // userID
|
|
||||||
handleMsg: '', // 备注信息
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.friendshipManager.refuseFriendApplication(
|
|
||||||
uid: "", // userID
|
|
||||||
handleMsg: '', // 备注信息
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void groupManager() {
|
|
||||||
OpenIM.iMManager.groupManager
|
|
||||||
.inviteUserToGroup(
|
|
||||||
groupId: '', // 组ID
|
|
||||||
uidList: [], // 成员 userID 列表
|
|
||||||
reason: '', // 备注信息
|
|
||||||
)
|
|
||||||
.then((list) {
|
|
||||||
// List<GroupInviteResult>
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.kickGroupMember(
|
|
||||||
groupId: '', // 组ID
|
|
||||||
uidList: [], // userID 列表
|
|
||||||
reason: '', // 备注信息
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.groupManager.getGroupMembersInfo(
|
|
||||||
groupId: '', // 组ID
|
|
||||||
uidList: [], // 成员 userID 列表
|
|
||||||
).then((list) {
|
|
||||||
// List<GroupMembersInfo>
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager
|
|
||||||
.getGroupMemberList(
|
|
||||||
groupId: '', // 组ID
|
|
||||||
filter: 0, // 1普通成员, 2群主,3管理员
|
|
||||||
offset: 0, // 偏移量,每次开始的index值
|
|
||||||
count: 0, // 每次拉取的数量
|
|
||||||
)
|
|
||||||
.then((list) {
|
|
||||||
// List<GroupMembersInfo>
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.getJoinedGroupList().then((list) {
|
|
||||||
// List<GroupInfo>
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager
|
|
||||||
.isJoinedGroup(
|
|
||||||
gid: '', // 组ID
|
|
||||||
)
|
|
||||||
.then((joned) {
|
|
||||||
// true已加入;false未加入
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.createGroup(
|
|
||||||
groupName: '',
|
|
||||||
// 组名
|
|
||||||
faceUrl: '',
|
|
||||||
// 头像
|
|
||||||
notification: '',
|
|
||||||
// 群公告
|
|
||||||
introduction: '',
|
|
||||||
// 群简介
|
|
||||||
groupType: 0,
|
|
||||||
// 类型
|
|
||||||
ex: '',
|
|
||||||
// 扩展信息
|
|
||||||
list: [], // 成员角色集合 List<GroupMemberRole>
|
|
||||||
).then((groupInfo) {
|
|
||||||
// 返回组信息 GroupInfo
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.setGroupInfo(
|
|
||||||
groupID: '',
|
|
||||||
groupName: '',
|
|
||||||
// 组名
|
|
||||||
faceUrl: '',
|
|
||||||
// 头像
|
|
||||||
notification: '',
|
|
||||||
// 群公告
|
|
||||||
introduction: '',
|
|
||||||
// 群简介
|
|
||||||
ex: '', // 扩展信息
|
|
||||||
);
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.getGroupsInfo(
|
|
||||||
gidList: [], // 组id集合
|
|
||||||
).then((list) {
|
|
||||||
// List<GroupInfo>
|
|
||||||
});
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.joinGroup(
|
|
||||||
gid: '', // 组id
|
|
||||||
reason: '', // 入群备注信息
|
|
||||||
);
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.quitGroup(
|
|
||||||
gid: '', // 组id
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.groupManager.transferGroupOwner(
|
|
||||||
gid: '', // 组ID
|
|
||||||
uid: '', // 新 owner userID
|
|
||||||
);
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.getRecvGroupApplicationList().then((list) {
|
|
||||||
// List<GroupApplicationInfo>
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.groupManager.getSendGroupApplicationList().then((list) {
|
|
||||||
// List<GroupApplicationInfo>
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.groupManager.acceptGroupApplication(
|
|
||||||
gid: '', // 组ID
|
|
||||||
uid: '', // 申请人userID
|
|
||||||
handleMsg: '', // 备注信息
|
|
||||||
);
|
|
||||||
|
|
||||||
OpenIM.iMManager.groupManager.refuseGroupApplication(
|
|
||||||
gid: '', // 组ID
|
|
||||||
uid: '', // 申请人userID
|
|
||||||
handleMsg: '', // 备注信息
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void messageManager() {
|
|
||||||
OpenIM.iMManager.messageManager.sendMessage(
|
|
||||||
message: Message(), // 消息体
|
|
||||||
userID: '', // 接受消息的userID
|
|
||||||
groupID: '', // 接受消息的群ID
|
|
||||||
offlinePushInfo: OfflinePushInfo(), // 离线推送消息备注
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager
|
|
||||||
.getHistoryMessageList(
|
|
||||||
userID: '', // 单聊对象的userID
|
|
||||||
groupID: '', // 群聊的组id
|
|
||||||
startMsg: null, // 消息体
|
|
||||||
count: 0, // 每次拉取的数量
|
|
||||||
)
|
|
||||||
.then((list) {
|
|
||||||
// List<Message>
|
|
||||||
});
|
|
||||||
OpenIM.iMManager.messageManager.revokeMessage(
|
|
||||||
message: Message(), // 消息体
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.deleteMessageFromLocalStorage(
|
|
||||||
message: Message(), // 消息体
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.insertSingleMessageToLocalStorage(
|
|
||||||
receiverID: '', // 接收者userID
|
|
||||||
senderID: '', // 发送者userID
|
|
||||||
message: Message(), // 消息体
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.markC2CMessageAsRead(
|
|
||||||
userID: '', // 接收者 userID
|
|
||||||
messageIDList: [], // 已读的消息id列表
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.typingStatusUpdate(
|
|
||||||
userID: '', // 接收者 userID
|
|
||||||
msgTip: '', // 自定义提示内容
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createTextMessage(
|
|
||||||
text: '',
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createTextAtMessage(
|
|
||||||
text: '', // 发送的内容
|
|
||||||
atUidList: [], // 被@到的userID集合
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createImageMessage(
|
|
||||||
imagePath: '', // 图片相对路径
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createImageMessageFromFullPath(
|
|
||||||
imagePath: '', // 图片的绝对路径
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createSoundMessage(
|
|
||||||
soundPath: '', // 相对路径
|
|
||||||
duration: 0, // 时长
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createSoundMessageFromFullPath(
|
|
||||||
soundPath: '', // 绝对路径
|
|
||||||
duration: 0, // 时长
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createVideoMessage(
|
|
||||||
videoPath: '', // 相对路径
|
|
||||||
videoType: '', // minetype
|
|
||||||
duration: 0, // 时长s
|
|
||||||
snapshotPath: '', // 站位缩略图
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createVideoMessageFromFullPath(
|
|
||||||
videoPath: '', // 相对路径
|
|
||||||
videoType: '', // minetype
|
|
||||||
duration: 0, // 时长s
|
|
||||||
snapshotPath: '', // 站位缩略图
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createFileMessage(
|
|
||||||
filePath: '', // 相对路径
|
|
||||||
fileName: '', // 文件名
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createFileMessageFromFullPath(
|
|
||||||
filePath: '', // 相对路径
|
|
||||||
fileName: '', // 文件名
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createForwardMessage(
|
|
||||||
message: Message(), // 转发消息体
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createMergerMessage(
|
|
||||||
messageList: [], // 被转发的消息列表
|
|
||||||
title: '', // 标题
|
|
||||||
summaryList: [], // 每一条消息摘要
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createLocationMessage(
|
|
||||||
latitude: 0, // 纬度
|
|
||||||
longitude: 0, // 经度
|
|
||||||
description: '', // 位置描述信息
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createCustomMessage(
|
|
||||||
data: '', // 自定义内容
|
|
||||||
extension: '', // 扩展信息
|
|
||||||
description: '', // 描述消息
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createQuoteMessage(
|
|
||||||
text: '', // 回复内容
|
|
||||||
quoteMsg: Message(), // 被回复的消息体
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.createCardMessage(
|
|
||||||
data: {}, // 自定义内容
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.clearC2CHistoryMessage(
|
|
||||||
uid: "", // 清空聊天记录
|
|
||||||
);
|
|
||||||
OpenIM.iMManager.messageManager.clearGroupHistoryMessage(
|
|
||||||
gid: '', // 群ID
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "1.1.1"
|
version: "2.0.9"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ import Foundation
|
|||||||
public class JsonUtil {
|
public class JsonUtil {
|
||||||
|
|
||||||
public static func toString(object: AnyObject?)->String {
|
public static func toString(object: AnyObject?)->String {
|
||||||
|
|
||||||
|
if object is NSNull {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
if object == nil {
|
if object == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if object is String{
|
if object is String{
|
||||||
let s = object as! String
|
let s = object as! String
|
||||||
let b = s.replacingOccurrences(of: "\"", with: "\\\"")
|
let b = s.replacingOccurrences(of: "\"", with: "\\\"")
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||||
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
||||||
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
||||||
|
self["setOneConversationPrivateChat"] = setOneConversationPrivateChat
|
||||||
|
self["deleteConversationFromLocalAndSvr"] = deleteConversationFromLocalAndSvr
|
||||||
|
self["deleteAllConversationFromLocal"] = deleteAllConversationFromLocal
|
||||||
|
self["resetConversationGroupAtType"] = resetConversationGroupAtType
|
||||||
|
self["getAtAllTag"] = getAtAllTag
|
||||||
}
|
}
|
||||||
|
|
||||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -78,6 +83,26 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setOneConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkSetOneConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteConversationFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkDeleteConversationFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkDeleteAllConversationFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func resetConversationGroupAtType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkResetConversationGroupAtType(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
callBack(result, Open_im_sdkGetAtAllTag())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,11 @@ public class GroupManager: BaseServiceManager {
|
|||||||
self["getSendGroupApplicationList"] = getSendGroupApplicationList
|
self["getSendGroupApplicationList"] = getSendGroupApplicationList
|
||||||
self["acceptGroupApplication"] = acceptGroupApplication
|
self["acceptGroupApplication"] = acceptGroupApplication
|
||||||
self["refuseGroupApplication"] = refuseGroupApplication
|
self["refuseGroupApplication"] = refuseGroupApplication
|
||||||
// self["forceSyncApplyGroupRequest"] = forceSyncApplyGroupRequest
|
self["dismissGroup"] = dismissGroup
|
||||||
// self["forceSyncGroupRequest"] = forceSyncGroupRequest
|
self["changeGroupMute"] = changeGroupMute
|
||||||
// self["forceSyncJoinedGroup"] = forceSyncJoinedGroup
|
self["changeGroupMemberMute"] = changeGroupMemberMute
|
||||||
// self["forceSyncJoinedGroupMember"] = forceSyncJoinedGroupMember
|
self["setGroupMemberNickname"] = setGroupMemberNickname
|
||||||
|
self["searchGroups"] = searchGroups
|
||||||
}
|
}
|
||||||
|
|
||||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -95,27 +96,27 @@ public class GroupManager: BaseServiceManager {
|
|||||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||||
}
|
}
|
||||||
|
|
||||||
// func forceSyncApplyGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// Open_im_sdkForceSyncApplyGroupRequest()
|
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||||
// callBack(result)
|
}
|
||||||
// }
|
|
||||||
//
|
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// func forceSyncGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[bool: "mute"])
|
||||||
// Open_im_sdkForceSyncGroupRequest()
|
}
|
||||||
// callBack(result)
|
|
||||||
// }
|
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
//
|
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[int:"seconds"])
|
||||||
// func forceSyncJoinedGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
}
|
||||||
// Open_im_sdkForceSyncJoinedGroup()
|
|
||||||
// callBack(result)
|
func setGroupMemberNickname(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// }
|
Open_im_sdkSetGroupMemberNickname(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[string:"groupNickname"])
|
||||||
//
|
}
|
||||||
// func forceSyncJoinedGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
||||||
// Open_im_sdkForceSyncJoinedGroupMember()
|
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// callBack(result)
|
Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||||
|
|
||||||
private let channel:FlutterMethodChannel
|
private let channel:FlutterMethodChannel
|
||||||
|
|||||||
@@ -9,17 +9,11 @@ public class IMMananger: BaseServiceManager {
|
|||||||
self["login"] = login
|
self["login"] = login
|
||||||
self["logout"] = logout
|
self["logout"] = logout
|
||||||
self["getLoginStatus"] = getLoginStatus
|
self["getLoginStatus"] = getLoginStatus
|
||||||
// self["getLoginUid"] = getLoginUid
|
self["wakeUp"] = wakeUp
|
||||||
// self["getUsersInfo"] = getUsersInfo
|
|
||||||
// self["setSelfInfo"] = setSelfInfo
|
|
||||||
// self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo
|
|
||||||
// self["forceReConn"] = forceReConn
|
|
||||||
// self["setSdkLog"] = setSdkLog
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString())
|
callBack(result,Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||||
callBack(result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
@@ -34,30 +28,13 @@ public class IMMananger: BaseServiceManager {
|
|||||||
callBack(result, Open_im_sdkGetLoginStatus())
|
callBack(result, Open_im_sdkGetLoginStatus())
|
||||||
}
|
}
|
||||||
|
|
||||||
// func getLoginUid(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func wakeUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
// callBack(result, Open_im_sdkGetLoginUser())
|
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
// }
|
}
|
||||||
|
|
||||||
// func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func uploadImage(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
// Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
Open_im_sdkUploadImage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "path"], methodCall[string: "token"], methodCall[string: "obj"])
|
||||||
// }
|
}
|
||||||
|
|
||||||
// func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
||||||
// Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result))
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
||||||
// Open_im_sdkForceSyncLoginUerInfo()
|
|
||||||
// callBack(result)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
||||||
// Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"])
|
|
||||||
// }
|
|
||||||
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
||||||
// Open_im_sdkForceReConn()
|
|
||||||
// callBack(result)
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ public class MessageManager: BaseServiceManager {
|
|||||||
self["getHistoryMessageList"] = getHistoryMessageList
|
self["getHistoryMessageList"] = getHistoryMessageList
|
||||||
self["revokeMessage"] = revokeMessage
|
self["revokeMessage"] = revokeMessage
|
||||||
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
|
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
|
||||||
self["deleteMessages"] = deleteMessages
|
|
||||||
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
|
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
|
||||||
// self["findMessages"] = findMessages
|
self["insertGroupMessageToLocalStorage"] = insertGroupMessageToLocalStorage
|
||||||
self["markC2CMessageAsRead"] = markC2CMessageAsRead
|
self["markC2CMessageAsRead"] = markC2CMessageAsRead
|
||||||
|
self["markGroupMessageAsRead"] = markGroupMessageAsRead
|
||||||
self["typingStatusUpdate"] = typingStatusUpdate
|
self["typingStatusUpdate"] = typingStatusUpdate
|
||||||
self["createTextMessage"] = createTextMessage
|
self["createTextMessage"] = createTextMessage
|
||||||
self["createTextAtMessage"] = createTextAtMessage
|
self["createTextAtMessage"] = createTextAtMessage
|
||||||
@@ -33,9 +33,17 @@ public class MessageManager: BaseServiceManager {
|
|||||||
self["createCustomMessage"] = createCustomMessage
|
self["createCustomMessage"] = createCustomMessage
|
||||||
self["createQuoteMessage"] = createQuoteMessage
|
self["createQuoteMessage"] = createQuoteMessage
|
||||||
self["createCardMessage"] = createCardMessage
|
self["createCardMessage"] = createCardMessage
|
||||||
// self["forceSyncMsg"] = forceSyncMsg
|
self["createFaceMessage"] = createFaceMessage
|
||||||
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
||||||
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
||||||
|
self["searchLocalMessages"] = searchLocalMessages
|
||||||
|
self["deleteMessageFromLocalAndSvr"] = deleteMessageFromLocalAndSvr
|
||||||
|
self["deleteAllMsgFromLocal"] = deleteAllMsgFromLocal
|
||||||
|
self["deleteAllMsgFromLocalAndSvr"] = deleteAllMsgFromLocalAndSvr
|
||||||
|
self["markMessageAsReadByConID"] = markMessageAsReadByConID
|
||||||
|
self["clearC2CHistoryMessageFromLocalAndSvr"] = clearC2CHistoryMessageFromLocalAndSvr
|
||||||
|
self["clearGroupHistoryMessageFromLocalAndSvr"] = clearGroupHistoryMessageFromLocalAndSvr
|
||||||
|
self["getHistoryMessageListReverse"] = getHistoryMessageListReverse
|
||||||
}
|
}
|
||||||
|
|
||||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -63,33 +71,36 @@ public class MessageManager: BaseServiceManager {
|
|||||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
}
|
}
|
||||||
|
|
||||||
// deprecated
|
|
||||||
func deleteMessages(methodCall: FlutterMethodCall, result: FlutterResult){
|
|
||||||
}
|
|
||||||
|
|
||||||
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
|
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
|
||||||
methodCall[string: "receiverID"], methodCall[string: "senderID"])
|
methodCall[string: "receiverID"], methodCall[string: "senderID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
// func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func insertGroupMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"])
|
Open_im_sdkInsertGroupMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
|
||||||
// }
|
methodCall[string: "groupID"], methodCall[string: "senderID"])
|
||||||
|
}
|
||||||
|
|
||||||
func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"])
|
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func markGroupMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkMarkGroupMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "messageIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"])
|
Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"]))
|
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"], methodCall[jsonString: "atUserList"]))
|
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"],
|
||||||
|
methodCall[jsonString: "atUserIDList"], methodCall[jsonString: "atUserInfoList"], methodCall[jsonString: "quoteMessage"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@@ -116,18 +127,18 @@ public class MessageManager: BaseServiceManager {
|
|||||||
|
|
||||||
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||||
callBack(result, prama)
|
callBack(result, prama)
|
||||||
}
|
}
|
||||||
|
|
||||||
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
||||||
methodCall[jsonString: "summaryList"])
|
methodCall[jsonString: "summaryList"])
|
||||||
@@ -158,35 +169,66 @@ public class MessageManager: BaseServiceManager {
|
|||||||
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
|
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
// func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createFaceMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// Open_im_sdkForceSyncMsg()
|
callBack(result, Open_im_sdkCreateFaceMessage(methodCall[string: "operationID"], methodCall[int: "index"], methodCall[string: "data"]))
|
||||||
// callBack(result)
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func searchLocalMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkSearchLocalMessages(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "filter"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkDeleteMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteAllMsgFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkDeleteAllMsgFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteAllMsgFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkDeleteAllMsgFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func markMessageAsReadByConID(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkMarkMessageAsReadByConID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "messageIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func clearC2CHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkClearC2CHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func clearGroupHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkClearGroupHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getHistoryMessageListReverse(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
|
}
|
||||||
|
|
||||||
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
||||||
private let channel: FlutterMethodChannel
|
private let channel: FlutterMethodChannel
|
||||||
private let result: FlutterResult
|
private let result: FlutterResult
|
||||||
private let call: FlutterMethodCall
|
private let call: FlutterMethodCall
|
||||||
|
|
||||||
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
|
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
self.result = result
|
self.result = result
|
||||||
self.call = methodCall
|
self.call = methodCall
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onError(_ errCode: Int32, errMsg: String?) {
|
public func onError(_ errCode: Int32, errMsg: String?) {
|
||||||
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onProgress(_ progress: Int) {
|
public func onProgress(_ progress: Int) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
let message = call[dict: "message"]
|
let message = call[dict: "message"]
|
||||||
@@ -194,36 +236,43 @@ public class MessageManager: BaseServiceManager {
|
|||||||
values["progress"] = progress
|
values["progress"] = progress
|
||||||
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onSuccess(_ data: String?) {
|
public func onSuccess(_ data: String?) {
|
||||||
DispatchQueue.main.async { self.result(data) }
|
DispatchQueue.main.async { self.result(data) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
|
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["haveReadMessage"] = msgReceiptList
|
values["c2cMessageReadReceipt"] = msgReceiptList
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func onRecvGroupReadReceipt(_ groupMsgReceiptList: String?) {
|
||||||
|
var values: [String: Any] = [:]
|
||||||
|
values["id"] = id
|
||||||
|
values["groupMessageReadReceipt"] = groupMsgReceiptList
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||||
|
}
|
||||||
|
|
||||||
public func onRecvMessageRevoked(_ msgId: String?) {
|
public func onRecvMessageRevoked(_ msgId: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["revokedMessage"] = msgId
|
values["revokedMessage"] = msgId
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onRecvNewMessage(_ message: String?) {
|
public func onRecvNewMessage(_ message: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
|
|||||||
49
ios/Classes/Module/OrganizationManager.swift
Normal file
49
ios/Classes/Module/OrganizationManager.swift
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
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"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
86
ios/Classes/Module/SignalingManager.swift
Normal file
86
ios/Classes/Module/SignalingManager.swift
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
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"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
44
ios/Classes/Module/WorkMomentsManager.swift
Normal file
44
ios/Classes/Module/WorkMomentsManager.swift
Normal 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
// Objective-C API for talking to the following Go packages
|
|
||||||
//
|
|
||||||
// open_im_sdk/open_im_sdk
|
|
||||||
// open_im_sdk/open_im_sdk_callback
|
|
||||||
//
|
|
||||||
// File is generated by gomobile bind. Do not edit.
|
|
||||||
#ifndef __OpenIMCore_FRAMEWORK_H__
|
|
||||||
#define __OpenIMCore_FRAMEWORK_H__
|
|
||||||
|
|
||||||
#include "Open_im_sdk.objc.h"
|
|
||||||
#include "Open_im_sdk_callback.objc.h"
|
|
||||||
#include "Universe.objc.h"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
|
|
||||||
// gobind -lang=objc open_im_sdk/open_im_sdk
|
|
||||||
//
|
|
||||||
// File is generated by gobind. Do not edit.
|
|
||||||
|
|
||||||
#ifndef __Open_im_sdk_H__
|
|
||||||
#define __Open_im_sdk_H__
|
|
||||||
|
|
||||||
@import Foundation;
|
|
||||||
#include "ref.h"
|
|
||||||
#include "Universe.objc.h"
|
|
||||||
|
|
||||||
#include "Open_im_sdk_callback.objc.h"
|
|
||||||
|
|
||||||
@interface Open_im_sdk : NSObject
|
|
||||||
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
|
|
||||||
|
|
||||||
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
// skipped function GetUserWorker with unsupported parameter or return types
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* /////////////////////user/////////////////////
|
|
||||||
*/
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
|
||||||
|
|
||||||
// skipped function InitOnce with unsupported parameter or return types
|
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkInsertGroupMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable groupID, NSString* _Nullable sendID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSearchLocalMessages(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable searchParam);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ////////////////////////group//////////////////////////////////////////
|
|
||||||
*/
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
// Objective-C API for talking to open_im_sdk/open_im_sdk_callback Go package.
|
|
||||||
// gobind -lang=objc open_im_sdk/open_im_sdk_callback
|
|
||||||
//
|
|
||||||
// File is generated by gobind. Do not edit.
|
|
||||||
|
|
||||||
#ifndef __Open_im_sdk_callback_H__
|
|
||||||
#define __Open_im_sdk_callback_H__
|
|
||||||
|
|
||||||
@import Foundation;
|
|
||||||
#include "ref.h"
|
|
||||||
#include "Universe.objc.h"
|
|
||||||
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackBase;
|
|
||||||
@class Open_im_sdk_callbackBase;
|
|
||||||
@protocol Open_im_sdk_callbackOnAdvancedMsgListener;
|
|
||||||
@class Open_im_sdk_callbackOnAdvancedMsgListener;
|
|
||||||
@protocol Open_im_sdk_callbackOnConnListener;
|
|
||||||
@class Open_im_sdk_callbackOnConnListener;
|
|
||||||
@protocol Open_im_sdk_callbackOnConversationListener;
|
|
||||||
@class Open_im_sdk_callbackOnConversationListener;
|
|
||||||
@protocol Open_im_sdk_callbackOnFriendshipListener;
|
|
||||||
@class Open_im_sdk_callbackOnFriendshipListener;
|
|
||||||
@protocol Open_im_sdk_callbackOnGroupListener;
|
|
||||||
@class Open_im_sdk_callbackOnGroupListener;
|
|
||||||
@protocol Open_im_sdk_callbackOnUserListener;
|
|
||||||
@class Open_im_sdk_callbackOnUserListener;
|
|
||||||
@protocol Open_im_sdk_callbackSendMsgCallBack;
|
|
||||||
@class Open_im_sdk_callbackSendMsgCallBack;
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackBase <NSObject>
|
|
||||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
|
||||||
- (void)onSuccess:(NSString* _Nullable)data;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackOnAdvancedMsgListener <NSObject>
|
|
||||||
- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList;
|
|
||||||
- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId;
|
|
||||||
- (void)onRecvNewMessage:(NSString* _Nullable)message;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackOnConnListener <NSObject>
|
|
||||||
- (void)onConnectFailed:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
|
||||||
- (void)onConnectSuccess;
|
|
||||||
- (void)onConnecting;
|
|
||||||
- (void)onKickedOffline;
|
|
||||||
- (void)onUserTokenExpired;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackOnConversationListener <NSObject>
|
|
||||||
- (void)onConversationChanged:(NSString* _Nullable)conversationList;
|
|
||||||
- (void)onNewConversation:(NSString* _Nullable)conversationList;
|
|
||||||
- (void)onSyncServerFailed;
|
|
||||||
- (void)onSyncServerFinish;
|
|
||||||
- (void)onSyncServerStart;
|
|
||||||
- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackOnFriendshipListener <NSObject>
|
|
||||||
- (void)onBlackAdded:(NSString* _Nullable)blackInfo;
|
|
||||||
- (void)onBlackDeleted:(NSString* _Nullable)blackInfo;
|
|
||||||
- (void)onFriendAdded:(NSString* _Nullable)friendInfo;
|
|
||||||
- (void)onFriendApplicationAccepted:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onFriendApplicationAdded:(NSString* _Nullable)friendApplication;
|
|
||||||
- (void)onFriendApplicationDeleted:(NSString* _Nullable)friendApplication;
|
|
||||||
- (void)onFriendApplicationRejected:(NSString* _Nullable)friendApplication;
|
|
||||||
- (void)onFriendDeleted:(NSString* _Nullable)friendInfo;
|
|
||||||
- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackOnGroupListener <NSObject>
|
|
||||||
- (void)onGroupApplicationAccepted:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupApplicationAdded:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupApplicationDeleted:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupApplicationRejected:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupInfoChanged:(NSString* _Nullable)groupInfo;
|
|
||||||
- (void)onGroupMemberAdded:(NSString* _Nullable)groupMemberInfo;
|
|
||||||
- (void)onGroupMemberDeleted:(NSString* _Nullable)groupMemberInfo;
|
|
||||||
- (void)onGroupMemberInfoChanged:(NSString* _Nullable)groupMemberInfo;
|
|
||||||
- (void)onJoinedGroupAdded:(NSString* _Nullable)groupInfo;
|
|
||||||
- (void)onJoinedGroupDeleted:(NSString* _Nullable)groupInfo;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackOnUserListener <NSObject>
|
|
||||||
- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol Open_im_sdk_callbackSendMsgCallBack <NSObject>
|
|
||||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
|
||||||
- (void)onProgress:(long)progress;
|
|
||||||
- (void)onSuccess:(NSString* _Nullable)data;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackBase;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackOnAdvancedMsgListener;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackOnConnListener;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackOnConversationListener;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackOnFriendshipListener;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackOnGroupListener;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackOnUserListener;
|
|
||||||
|
|
||||||
@class Open_im_sdk_callbackSendMsgCallBack;
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackBase : NSObject <goSeqRefInterface, Open_im_sdk_callbackBase> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
|
||||||
- (void)onSuccess:(NSString* _Nullable)data;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackOnAdvancedMsgListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnAdvancedMsgListener> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList;
|
|
||||||
- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId;
|
|
||||||
- (void)onRecvNewMessage:(NSString* _Nullable)message;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackOnConnListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnConnListener> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onConnectFailed:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
|
||||||
- (void)onConnectSuccess;
|
|
||||||
- (void)onConnecting;
|
|
||||||
- (void)onKickedOffline;
|
|
||||||
- (void)onUserTokenExpired;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackOnConversationListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnConversationListener> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onConversationChanged:(NSString* _Nullable)conversationList;
|
|
||||||
- (void)onNewConversation:(NSString* _Nullable)conversationList;
|
|
||||||
- (void)onSyncServerFailed;
|
|
||||||
- (void)onSyncServerFinish;
|
|
||||||
- (void)onSyncServerStart;
|
|
||||||
- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackOnFriendshipListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnFriendshipListener> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onBlackAdded:(NSString* _Nullable)blackInfo;
|
|
||||||
- (void)onBlackDeleted:(NSString* _Nullable)blackInfo;
|
|
||||||
- (void)onFriendAdded:(NSString* _Nullable)friendInfo;
|
|
||||||
- (void)onFriendApplicationAccepted:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onFriendApplicationAdded:(NSString* _Nullable)friendApplication;
|
|
||||||
- (void)onFriendApplicationDeleted:(NSString* _Nullable)friendApplication;
|
|
||||||
- (void)onFriendApplicationRejected:(NSString* _Nullable)friendApplication;
|
|
||||||
- (void)onFriendDeleted:(NSString* _Nullable)friendInfo;
|
|
||||||
- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackOnGroupListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnGroupListener> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onGroupApplicationAccepted:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupApplicationAdded:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupApplicationDeleted:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupApplicationRejected:(NSString* _Nullable)groupApplication;
|
|
||||||
- (void)onGroupInfoChanged:(NSString* _Nullable)groupInfo;
|
|
||||||
- (void)onGroupMemberAdded:(NSString* _Nullable)groupMemberInfo;
|
|
||||||
- (void)onGroupMemberDeleted:(NSString* _Nullable)groupMemberInfo;
|
|
||||||
- (void)onGroupMemberInfoChanged:(NSString* _Nullable)groupMemberInfo;
|
|
||||||
- (void)onJoinedGroupAdded:(NSString* _Nullable)groupInfo;
|
|
||||||
- (void)onJoinedGroupDeleted:(NSString* _Nullable)groupInfo;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackOnUserListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnUserListener> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface Open_im_sdk_callbackSendMsgCallBack : NSObject <goSeqRefInterface, Open_im_sdk_callbackSendMsgCallBack> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
|
||||||
- (void)onProgress:(long)progress;
|
|
||||||
- (void)onSuccess:(NSString* _Nullable)data;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
// Objective-C API for talking to Go package.
|
|
||||||
// gobind -lang=objc
|
|
||||||
//
|
|
||||||
// File is generated by gobind. Do not edit.
|
|
||||||
|
|
||||||
#ifndef __Universe_H__
|
|
||||||
#define __Universe_H__
|
|
||||||
|
|
||||||
@import Foundation;
|
|
||||||
#include "ref.h"
|
|
||||||
|
|
||||||
@protocol Universeerror;
|
|
||||||
@class Universeerror;
|
|
||||||
|
|
||||||
@protocol Universeerror <NSObject>
|
|
||||||
- (NSString* _Nonnull)error;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@class Universeerror;
|
|
||||||
|
|
||||||
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
|
|
||||||
}
|
|
||||||
@property(strong, readonly) _Nonnull id _ref;
|
|
||||||
|
|
||||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
||||||
- (NSString* _Nonnull)error;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
// Copyright 2015 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef __GO_REF_HDR__
|
|
||||||
#define __GO_REF_HDR__
|
|
||||||
|
|
||||||
#include <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
// GoSeqRef is an object tagged with an integer for passing back and
|
|
||||||
// forth across the language boundary. A GoSeqRef may represent either
|
|
||||||
// an instance of a Go object, or an Objective-C object passed to Go.
|
|
||||||
// The explicit allocation of a GoSeqRef is used to pin a Go object
|
|
||||||
// when it is passed to Objective-C. The Go seq package maintains a
|
|
||||||
// reference to the Go object in a map keyed by the refnum along with
|
|
||||||
// a reference count. When the reference count reaches zero, the Go
|
|
||||||
// seq package will clear the corresponding entry in the map.
|
|
||||||
@interface GoSeqRef : NSObject {
|
|
||||||
}
|
|
||||||
@property(readonly) int32_t refnum;
|
|
||||||
@property(strong) id obj; // NULL when representing a Go object.
|
|
||||||
|
|
||||||
// new GoSeqRef object to proxy a Go object. The refnum must be
|
|
||||||
// provided from Go side.
|
|
||||||
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
|
|
||||||
|
|
||||||
- (int32_t)incNum;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol goSeqRefInterface
|
|
||||||
-(GoSeqRef*) _ref;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
framework module "OpenIMCore" {
|
|
||||||
header "ref.h"
|
|
||||||
header "Open_im_sdk.objc.h"
|
|
||||||
header "Open_im_sdk_callback.objc.h"
|
|
||||||
header "Universe.objc.h"
|
|
||||||
header "OpenIMCore.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -17,7 +17,9 @@ A new Flutter project.
|
|||||||
s.dependency 'Flutter'
|
s.dependency 'Flutter'
|
||||||
s.platform = :ios, '8.0'
|
s.platform = :ios, '8.0'
|
||||||
|
|
||||||
s.vendored_frameworks = 'Framework/*.framework'
|
s.dependency 'OpenIMSDKCore','2.0.9'
|
||||||
|
s.static_framework = true
|
||||||
|
# s.vendored_frameworks = 'Framework/*.framework'
|
||||||
# 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'
|
||||||
|
|||||||
@@ -1,35 +1,40 @@
|
|||||||
library flutter_openim_sdk;
|
library flutter_openim_sdk;
|
||||||
|
|
||||||
export 'src/enum/conversation_type.dart';
|
export 'src/enum/conversation_type.dart';
|
||||||
|
export 'src/enum/group_at_type.dart';
|
||||||
export 'src/enum/group_role_level.dart';
|
export 'src/enum/group_role_level.dart';
|
||||||
export 'src/enum/im_platform.dart';
|
export 'src/enum/im_platform.dart';
|
||||||
export 'src/enum/listener_type.dart';
|
export 'src/enum/listener_type.dart';
|
||||||
export 'src/enum/message_status.dart';
|
export 'src/enum/message_status.dart';
|
||||||
export 'src/enum/message_type.dart';
|
export 'src/enum/message_type.dart';
|
||||||
export 'src/listener/advanced_msg_listener.dart';
|
export 'src/listener/advanced_msg_listener.dart';
|
||||||
export 'src/listener/advanced_msg_listener.dart';
|
|
||||||
export 'src/listener/connect_listener.dart';
|
|
||||||
export 'src/listener/connect_listener.dart';
|
export 'src/listener/connect_listener.dart';
|
||||||
export 'src/listener/conversation_listener.dart';
|
export 'src/listener/conversation_listener.dart';
|
||||||
export 'src/listener/friendship_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/group_listener.dart';
|
||||||
export 'src/listener/msg_send_progress_listener.dart';
|
export 'src/listener/msg_send_progress_listener.dart';
|
||||||
export 'src/listener/msg_send_progress_listener.dart';
|
export 'src/listener/organization_listener.dart';
|
||||||
export 'src/listener/user_listener.dart';
|
export 'src/listener/signaling_listener.dart';
|
||||||
export 'src/listener/user_listener.dart';
|
export 'src/listener/user_listener.dart';
|
||||||
|
export 'src/listener/workmoments_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_offline_push_manager.dart';
|
export 'src/manager/im_offline_push_manager.dart';
|
||||||
|
export 'src/manager/im_organization_manager.dart';
|
||||||
export 'src/manager/im_signaling_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/manager/im_workmoments_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/message.dart';
|
export 'src/models/message.dart';
|
||||||
|
export 'src/models/notification_info.dart';
|
||||||
|
export 'src/models/organization_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/models/workmoments_info.dart';
|
||||||
export 'src/openim.dart';
|
export 'src/openim.dart';
|
||||||
export 'src/utils.dart';
|
export 'src/utils.dart';
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
class ConversationType {
|
class ConversationType {
|
||||||
static const single = 1;
|
static const single = 1;
|
||||||
static const group = 2;
|
static const group = 2;
|
||||||
|
static const notification = 4;
|
||||||
}
|
}
|
||||||
|
|||||||
6
lib/src/enum/group_at_type.dart
Normal file
6
lib/src/enum/group_at_type.dart
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class GroupAtType {
|
||||||
|
static const atNormal = 0;
|
||||||
|
static const atMe = 1;
|
||||||
|
static const atAll = 2;
|
||||||
|
static const atAllAtMe = 3;
|
||||||
|
}
|
||||||
@@ -8,4 +8,6 @@ class ListenerType {
|
|||||||
static final friendListener = 'friendListener';
|
static final friendListener = 'friendListener';
|
||||||
static final signalingListener = 'signalingListener';
|
static final signalingListener = 'signalingListener';
|
||||||
static final msgSendProgressListener = "msgSendProgressListener";
|
static final msgSendProgressListener = "msgSendProgressListener";
|
||||||
|
static final workMomentsListener = "workMomentsListener";
|
||||||
|
static final organizationListener = "organizationListener";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ class MessageType {
|
|||||||
static const file = 105;
|
static const file = 105;
|
||||||
static const at_text = 106;
|
static const at_text = 106;
|
||||||
static const merger = 107;
|
static const merger = 107;
|
||||||
// static const forward = 108;
|
|
||||||
static const card = 108;
|
static const card = 108;
|
||||||
static const location = 109;
|
static const location = 109;
|
||||||
static const custom = 110;
|
static const custom = 110;
|
||||||
@@ -15,26 +14,55 @@ class MessageType {
|
|||||||
static const has_read_receipt = 112;
|
static const has_read_receipt = 112;
|
||||||
static const typing = 113;
|
static const typing = 113;
|
||||||
static const quote = 114;
|
static const quote = 114;
|
||||||
|
static const custom_face = 115;
|
||||||
|
|
||||||
///
|
///
|
||||||
static const accept_friend = 201;
|
static const notificationBegin = 1000;
|
||||||
static const add_friend = 202;
|
|
||||||
static const refuse_friend_application = 203;
|
|
||||||
static const set_self_info = 204;
|
|
||||||
static const revoke_message = 205;
|
|
||||||
static const c2c_message_as_read = 206;
|
|
||||||
|
|
||||||
static const kick_online = 303;
|
static const friendNotificationBegin = 1200;
|
||||||
|
static const friendApplicationApprovedNotification = 1201;
|
||||||
|
static const friendApplicationRejectedNotification = 1202;
|
||||||
|
static const friendApplicationNotification = 1203;
|
||||||
|
static const friendAddedNotification = 1204;
|
||||||
|
static const friendDeletedNotification = 1205;
|
||||||
|
static const friendRemarkSetNotification = 1206;
|
||||||
|
static const blackAddedNotification = 1207;
|
||||||
|
static const blackDeletedNotification = 1208;
|
||||||
|
static const friendNotificationEnd = 1299;
|
||||||
|
|
||||||
///
|
static const conversationChangeNotification = 1300;
|
||||||
static const transfer_group_owner = 501;
|
|
||||||
static const create_group = 502;
|
static const userNotificationBegin = 1301;
|
||||||
// static const create_group = 503;
|
static const userInfoUpdatedNotification = 1303;
|
||||||
static const join_group = 504;
|
static const userNotificationEnd = 1399;
|
||||||
static const quit_group = 505;
|
|
||||||
static const set_group_info = 506;
|
static const oaNotification = 1400;
|
||||||
static const accept_group_application = 507;
|
|
||||||
static const refuse_group_application = 508;
|
static const groupNotificationBegin = 1500;
|
||||||
static const kick_group_member = 509;
|
static const groupCreatedNotification = 1501;
|
||||||
static const invited_user_to_group = 510;
|
static const groupInfoSetNotification = 1502;
|
||||||
|
static const joinGroupApplicationNotification = 1503;
|
||||||
|
static const memberQuitNotification = 1504;
|
||||||
|
static const groupApplicationAcceptedNotification = 1505;
|
||||||
|
static const groupApplicationRejectedNotification = 1506;
|
||||||
|
static const groupOwnerTransferredNotification = 1507;
|
||||||
|
static const memberKickedNotification = 1508;
|
||||||
|
static const memberInvitedNotification = 1509;
|
||||||
|
static const memberEnterNotification = 1510;
|
||||||
|
static const dismissGroupNotification = 1511;
|
||||||
|
static const groupNotificationEnd = 1599;
|
||||||
|
|
||||||
|
static const groupMemberMutedNotification = 1512;
|
||||||
|
static const groupMemberCancelMutedNotification = 1513;
|
||||||
|
static const groupMutedNotification = 1514;
|
||||||
|
static const groupCancelMutedNotification = 1515;
|
||||||
|
static const groupMemberInfoChangedNotification = 1516;
|
||||||
|
|
||||||
|
static const signalingNotificationBegin = 1600;
|
||||||
|
static const signalingNotification = 1601;
|
||||||
|
static const signalingNotificationEnd = 1699;
|
||||||
|
|
||||||
|
static const burnAfterReadingNotification = 1701;
|
||||||
|
|
||||||
|
static const notificationEnd = 2000;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|||||||
|
|
||||||
class OnAdvancedMsgListener {
|
class OnAdvancedMsgListener {
|
||||||
/// Message read receipt
|
/// Message read receipt
|
||||||
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
Function(List<ReadReceiptInfo> list)? onRecvC2CMessageReadReceipt;
|
||||||
|
|
||||||
|
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
|
||||||
|
|
||||||
/// A friend revoked a message
|
/// A friend revoked a message
|
||||||
Function(String msgId)? onRecvMessageRevoked;
|
Function(String msgId)? onRecvMessageRevoked;
|
||||||
@@ -14,20 +16,25 @@ class OnAdvancedMsgListener {
|
|||||||
String id;
|
String id;
|
||||||
|
|
||||||
OnAdvancedMsgListener({
|
OnAdvancedMsgListener({
|
||||||
this.onRecvC2CReadReceipt,
|
this.onRecvC2CMessageReadReceipt,
|
||||||
|
this.onRecvGroupMessageReadReceipt,
|
||||||
this.onRecvMessageRevoked,
|
this.onRecvMessageRevoked,
|
||||||
this.onRecvNewMessage,
|
this.onRecvNewMessage,
|
||||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||||
|
|
||||||
void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
|
void recvC2CMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||||
if (null != onRecvC2CReadReceipt) onRecvC2CReadReceipt!(list);
|
onRecvC2CMessageReadReceipt?.call(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
void recvGroupMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||||
|
onRecvGroupMessageReadReceipt?.call(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void recvMessageRevoked(String msgId) {
|
void recvMessageRevoked(String msgId) {
|
||||||
if (null != onRecvMessageRevoked) onRecvMessageRevoked!(msgId);
|
onRecvMessageRevoked?.call(msgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void recvNewMessage(Message msg) {
|
void recvNewMessage(Message msg) {
|
||||||
if (null != onRecvNewMessage) onRecvNewMessage!(msg);
|
onRecvNewMessage?.call(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
lib/src/listener/organization_listener.dart
Normal file
9
lib/src/listener/organization_listener.dart
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
class OnOrganizationListener {
|
||||||
|
Function()? onOrganizationUpdated;
|
||||||
|
|
||||||
|
OnOrganizationListener({this.onOrganizationUpdated});
|
||||||
|
|
||||||
|
void organizationUpdated() {
|
||||||
|
onOrganizationUpdated?.call();
|
||||||
|
}
|
||||||
|
}
|
||||||
63
lib/src/listener/signaling_listener.dart
Normal file
63
lib/src/listener/signaling_listener.dart
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import 'package:flutter_openim_sdk/src/models/signaling_info.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;
|
||||||
|
|
||||||
|
OnSignalingListener({
|
||||||
|
this.onInvitationCancelled,
|
||||||
|
this.onInvitationTimeout,
|
||||||
|
this.onInviteeAccepted,
|
||||||
|
this.onInviteeRejected,
|
||||||
|
this.onReceiveNewInvitation,
|
||||||
|
this.onInviteeAcceptedByOtherDevice,
|
||||||
|
this.onInviteeRejectedByOtherDevice,
|
||||||
|
this.onHangup,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// 被邀请者收到:邀请者取消音视频通话
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
lib/src/listener/workmoments_listener.dart
Normal file
9
lib/src/listener/workmoments_listener.dart
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
class OnWorkMomentsListener {
|
||||||
|
Function()? onRecvNewNotification;
|
||||||
|
|
||||||
|
OnWorkMomentsListener({this.onRecvNewNotification});
|
||||||
|
|
||||||
|
void recvNewNotification() {
|
||||||
|
onRecvNewNotification?.call();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,14 +3,14 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|||||||
|
|
||||||
class ConversationManager {
|
class ConversationManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
late OnConversationListener conversationListener;
|
late OnConversationListener listener;
|
||||||
|
|
||||||
ConversationManager(this._channel);
|
ConversationManager(this._channel);
|
||||||
|
|
||||||
/// Observe conversation changes
|
/// Observe conversation changes
|
||||||
/// 会话监听
|
/// 会话监听
|
||||||
Future setConversationListener(OnConversationListener listener) {
|
Future setConversationListener(OnConversationListener listener) {
|
||||||
this.conversationListener = listener;
|
this.listener = listener;
|
||||||
return _channel.invokeMethod('setConversationListener', _buildParam({}));
|
return _channel.invokeMethod('setConversationListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ class ConversationManager {
|
|||||||
// _channel.invokeMethod(
|
// _channel.invokeMethod(
|
||||||
// 'markSingleMessageHasRead', _buildParam({'userID': userID}));
|
// 'markSingleMessageHasRead', _buildParam({'userID': userID}));
|
||||||
|
|
||||||
/// Mark group chat messages as read
|
/// Mark group chat all messages as read
|
||||||
/// 标记群聊已读
|
/// 标记群聊会话已读
|
||||||
Future<dynamic> markGroupMessageHasRead({
|
Future<dynamic> markGroupMessageHasRead({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -204,6 +204,63 @@ class ConversationManager {
|
|||||||
}))
|
}))
|
||||||
.then((value) => Utils.toListMap(value));
|
.then((value) => Utils.toListMap(value));
|
||||||
|
|
||||||
|
/// burn after reading
|
||||||
|
/// 阅后即焚
|
||||||
|
Future<dynamic> setOneConversationPrivateChat({
|
||||||
|
required String conversationID,
|
||||||
|
required bool isPrivate,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'setOneConversationPrivateChat',
|
||||||
|
_buildParam({
|
||||||
|
"conversationID": conversationID,
|
||||||
|
"isPrivate": isPrivate,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Delete conversation from local and service
|
||||||
|
/// 删除会话
|
||||||
|
Future<dynamic> deleteConversationFromLocalAndSvr({
|
||||||
|
required String conversationID,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'deleteConversationFromLocalAndSvr',
|
||||||
|
_buildParam({
|
||||||
|
"conversationID": conversationID,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Delete conversation from local
|
||||||
|
/// 删除会话
|
||||||
|
Future<dynamic> deleteAllConversationFromLocal({
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'deleteAllConversationFromLocal',
|
||||||
|
_buildParam({
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Reset group converstaion at type
|
||||||
|
/// 重置at标准位
|
||||||
|
Future<dynamic> resetConversationGroupAtType({
|
||||||
|
required String conversationID,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'resetConversationGroupAtType',
|
||||||
|
_buildParam({
|
||||||
|
"conversationID": conversationID,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Get @ all member tag
|
||||||
|
/// 查询at所有人标识
|
||||||
|
Future<dynamic> getAtAllTag() =>
|
||||||
|
_channel.invokeMethod('getAtAllTag', _buildParam({}));
|
||||||
|
|
||||||
/// Custom sort for conversation list
|
/// Custom sort for conversation list
|
||||||
/// 会话列表自定义排序规则。
|
/// 会话列表自定义排序规则。
|
||||||
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||||
|
|||||||
@@ -3,19 +3,20 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|||||||
|
|
||||||
class FriendshipManager {
|
class FriendshipManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
late OnFriendshipListener friendshipListener;
|
late OnFriendshipListener listener;
|
||||||
|
|
||||||
FriendshipManager(this._channel);
|
FriendshipManager(this._channel);
|
||||||
|
|
||||||
/// Set up a friend relationship listener
|
/// Set up a friend relationship listener
|
||||||
/// 好友关系监听
|
/// 好友关系监听
|
||||||
Future setFriendshipListener(OnFriendshipListener listener) {
|
Future setFriendshipListener(OnFriendshipListener listener) {
|
||||||
this.friendshipListener = listener;
|
this.listener = listener;
|
||||||
return _channel.invokeMethod('setFriendListener', _buildParam({}));
|
return _channel.invokeMethod('setFriendListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get friend info by user id
|
/// Get friend info by user id
|
||||||
/// 查询好友信息
|
/// 查询好友信息
|
||||||
|
/// [uidList] 好友的userID集合
|
||||||
Future<List<UserInfo>> getFriendsInfo({
|
Future<List<UserInfo>> getFriendsInfo({
|
||||||
required List<String> uidList,
|
required List<String> uidList,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -30,7 +31,9 @@ class FriendshipManager {
|
|||||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||||
|
|
||||||
/// Send an friend application
|
/// Send an friend application
|
||||||
/// 发送一个好友请求
|
/// 发送一个好友请求,需要对方调用同意申请才能成为好友。
|
||||||
|
/// [uid] 被邀请的用户ID
|
||||||
|
/// [reason] 说明
|
||||||
Future<dynamic> addFriend({
|
Future<dynamic> addFriend({
|
||||||
required String uid,
|
required String uid,
|
||||||
String? reason,
|
String? reason,
|
||||||
@@ -92,6 +95,8 @@ class FriendshipManager {
|
|||||||
|
|
||||||
/// Modify friend remark name
|
/// Modify friend remark name
|
||||||
/// 设置好友备注
|
/// 设置好友备注
|
||||||
|
/// [uid] 好友的userID
|
||||||
|
/// [remark] 好友的备注
|
||||||
Future<dynamic> setFriendRemark({
|
Future<dynamic> setFriendRemark({
|
||||||
required String uid,
|
required String uid,
|
||||||
required String remark,
|
required String remark,
|
||||||
@@ -107,6 +112,7 @@ class FriendshipManager {
|
|||||||
|
|
||||||
/// Add friends to blacklist
|
/// Add friends to blacklist
|
||||||
/// 加入黑名单
|
/// 加入黑名单
|
||||||
|
/// [uid]被加入黑名单的好友ID
|
||||||
Future<dynamic> addBlacklist({
|
Future<dynamic> addBlacklist({
|
||||||
required String uid,
|
required String uid,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|||||||
|
|
||||||
class GroupManager {
|
class GroupManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
late OnGroupListener groupListener;
|
late OnGroupListener listener;
|
||||||
|
|
||||||
GroupManager(this._channel);
|
GroupManager(this._channel);
|
||||||
|
|
||||||
/// Set up group relationship monitoring
|
/// Set up group relationship monitoring
|
||||||
/// 组关系监听
|
/// 组关系监听
|
||||||
Future setGroupListener(OnGroupListener listener) {
|
Future setGroupListener(OnGroupListener listener) {
|
||||||
this.groupListener = listener;
|
this.listener = listener;
|
||||||
return _channel.invokeMethod('setGroupListener', _buildParam({}));
|
return _channel.invokeMethod('setGroupListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +74,10 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Get the list of group members
|
/// Get the list of group members
|
||||||
/// 分页获取组成员列表
|
/// 分页获取组成员列表
|
||||||
|
/// [groupId] 群ID
|
||||||
|
/// [filter] 过滤成员 1普通成员, 2群主,3管理员,0所有
|
||||||
|
/// [offset] 开始下标
|
||||||
|
/// [count] 总数
|
||||||
Future<List<GroupMembersInfo>> getGroupMemberList({
|
Future<List<GroupMembersInfo>> getGroupMemberList({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
int filter = 0,
|
int filter = 0,
|
||||||
@@ -96,6 +100,10 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Get the list of group members
|
/// Get the list of group members
|
||||||
/// 分页获取组成员列表
|
/// 分页获取组成员列表
|
||||||
|
/// [groupId] 群ID
|
||||||
|
/// [filter] 过滤成员 1普通成员, 2群主,3管理员,0所有
|
||||||
|
/// [offset] 开始下标
|
||||||
|
/// [count] 总数
|
||||||
Future<List<dynamic>> getGroupMemberListMap({
|
Future<List<dynamic>> getGroupMemberListMap({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
int filter = 0,
|
int filter = 0,
|
||||||
@@ -147,6 +155,12 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Create a group
|
/// Create a group
|
||||||
/// 创建一个组
|
/// 创建一个组
|
||||||
|
/// [groupName] 群名
|
||||||
|
/// [notification] 公告
|
||||||
|
/// [introduction] 群介绍
|
||||||
|
/// [faceUrl] 群头像
|
||||||
|
/// [ex] 额外信息
|
||||||
|
/// [list] 初创群成员以及其角色
|
||||||
Future<GroupInfo> createGroup({
|
Future<GroupInfo> createGroup({
|
||||||
String? groupName,
|
String? groupName,
|
||||||
String? notification,
|
String? notification,
|
||||||
@@ -177,6 +191,12 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Edit group information
|
/// Edit group information
|
||||||
/// 编辑组资料
|
/// 编辑组资料
|
||||||
|
/// [groupID] 被编辑的群ID
|
||||||
|
/// [groupName] 新的群名
|
||||||
|
/// [notification] 新的公告
|
||||||
|
/// [introduction] 新的群介绍
|
||||||
|
/// [faceUrl] 新的群头像
|
||||||
|
/// [ex] 新的额外信息
|
||||||
Future<dynamic> setGroupInfo({
|
Future<dynamic> setGroupInfo({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
String? groupName,
|
String? groupName,
|
||||||
@@ -218,7 +238,7 @@ class GroupManager {
|
|||||||
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||||
|
|
||||||
/// Apply to join the group
|
/// Apply to join the group
|
||||||
/// 申请加入组,需要通过管理员同意。
|
/// 申请加入组,需要通过管理员/群组同意。
|
||||||
Future<dynamic> joinGroup({
|
Future<dynamic> joinGroup({
|
||||||
required String gid,
|
required String gid,
|
||||||
String? reason,
|
String? reason,
|
||||||
@@ -260,8 +280,8 @@ class GroupManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
/// As the group owner or administrator, get the list of received group members' applications to join the group.
|
/// As the group owner or administrator, the group member's application to join the group received
|
||||||
/// 作为群主或者管理员,获取收到的群成员申请进群列表。
|
/// 作为群主或者管理员,收到的群成员入群申请
|
||||||
Future<List<GroupApplicationInfo>> getRecvGroupApplicationList(
|
Future<List<GroupApplicationInfo>> getRecvGroupApplicationList(
|
||||||
{String? operationID}) =>
|
{String? operationID}) =>
|
||||||
_channel
|
_channel
|
||||||
@@ -288,6 +308,7 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Accept group application
|
/// Accept group application
|
||||||
/// 管理员或者群主同意某人进入某群
|
/// 管理员或者群主同意某人进入某群
|
||||||
|
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
|
||||||
Future<dynamic> acceptGroupApplication({
|
Future<dynamic> acceptGroupApplication({
|
||||||
required String gid,
|
required String gid,
|
||||||
required String uid,
|
required String uid,
|
||||||
@@ -305,6 +326,7 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Refuse group application
|
/// Refuse group application
|
||||||
/// 管理员或者群主拒绝某人进入某群
|
/// 管理员或者群主拒绝某人进入某群
|
||||||
|
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
|
||||||
Future<dynamic> refuseGroupApplication({
|
Future<dynamic> refuseGroupApplication({
|
||||||
required String gid,
|
required String gid,
|
||||||
required String uid,
|
required String uid,
|
||||||
@@ -320,6 +342,101 @@ class GroupManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
/// Dissmiss group
|
||||||
|
/// 解散群
|
||||||
|
Future<dynamic> dismissGroup({
|
||||||
|
required String groupID,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'dismissGroup',
|
||||||
|
_buildParam({
|
||||||
|
'gid': groupID,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Enable group mute
|
||||||
|
/// 开启群禁言,所有群成员禁止发言
|
||||||
|
/// [groupID] 将开启群禁言的组ID
|
||||||
|
/// [mute] true:开启,false:关闭
|
||||||
|
Future<dynamic> changeGroupMute({
|
||||||
|
required String groupID,
|
||||||
|
required bool mute,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'changeGroupMute',
|
||||||
|
_buildParam({
|
||||||
|
'gid': groupID,
|
||||||
|
'mute': mute,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Mute group members
|
||||||
|
/// 禁言群成员
|
||||||
|
/// [groupID] 群ID
|
||||||
|
/// [userID] 将被禁言的成员ID
|
||||||
|
/// [seconds] 被禁言的时间s,设置为0则为接触禁言
|
||||||
|
Future<dynamic> changeGroupMemberMute({
|
||||||
|
required String groupID,
|
||||||
|
required String userID,
|
||||||
|
int seconds = 0,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'changeGroupMemberMute',
|
||||||
|
_buildParam({
|
||||||
|
'gid': groupID,
|
||||||
|
'uid': userID,
|
||||||
|
'seconds': seconds,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Set group user nickname
|
||||||
|
/// 设置群成员昵称
|
||||||
|
/// [groupID] 群ID
|
||||||
|
/// [userID] 群成员的用户ID
|
||||||
|
/// [groupNickname] 群昵称
|
||||||
|
Future<dynamic> setGroupMemberNickname({
|
||||||
|
required String groupID,
|
||||||
|
required String userID,
|
||||||
|
String? groupNickname,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'setGroupMemberNickname',
|
||||||
|
_buildParam({
|
||||||
|
'gid': groupID,
|
||||||
|
'uid': userID,
|
||||||
|
'groupNickname': groupNickname ?? '',
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Search group
|
||||||
|
/// 查询群
|
||||||
|
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
|
||||||
|
/// [isSearchGroupID] 是否以关键词搜索群ID(注:两个不可以同时为false),为空默认false
|
||||||
|
/// [isSearchGroupName] 是否以关键词搜索群名字,为空默认false
|
||||||
|
Future<List<GroupInfo>> searchGroups({
|
||||||
|
List<String> keywordList = const [],
|
||||||
|
bool isSearchGroupID = false,
|
||||||
|
bool isSearchGroupName = false,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'searchGroups',
|
||||||
|
_buildParam({
|
||||||
|
'searchParam': {
|
||||||
|
'keywordList': keywordList,
|
||||||
|
'isSearchGroupID': isSearchGroupID,
|
||||||
|
'isSearchGroupName': isSearchGroupName,
|
||||||
|
},
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then(
|
||||||
|
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "groupManager";
|
param["ManagerName"] = "groupManager";
|
||||||
return param;
|
return param;
|
||||||
|
|||||||
@@ -12,11 +12,16 @@ class IMManager {
|
|||||||
late UserManager userManager;
|
late UserManager userManager;
|
||||||
|
|
||||||
// late OfflinePushManager offlinePushManager;
|
// late OfflinePushManager offlinePushManager;
|
||||||
// late SignalingManager signalingManager;
|
late SignalingManager signalingManager;
|
||||||
|
late WorkMomentsManager workMomentsManager;
|
||||||
|
late OrganizationManager organizationManager;
|
||||||
|
|
||||||
late OnConnectListener _connectListener;
|
late OnConnectListener _connectListener;
|
||||||
late String uid;
|
late String uid;
|
||||||
late UserInfo uInfo;
|
late UserInfo uInfo;
|
||||||
bool isLogined = false;
|
bool isLogined = false;
|
||||||
|
String? token;
|
||||||
|
String? _objectStorage;
|
||||||
|
|
||||||
IMManager(this._channel) {
|
IMManager(this._channel) {
|
||||||
conversationManager = ConversationManager(_channel);
|
conversationManager = ConversationManager(_channel);
|
||||||
@@ -25,7 +30,9 @@ class IMManager {
|
|||||||
groupManager = GroupManager(_channel);
|
groupManager = GroupManager(_channel);
|
||||||
userManager = UserManager(_channel);
|
userManager = UserManager(_channel);
|
||||||
// offlinePushManager = OfflinePushManager(_channel);
|
// offlinePushManager = OfflinePushManager(_channel);
|
||||||
// signalingManager = SignalingManager(_channel);
|
signalingManager = SignalingManager(_channel);
|
||||||
|
workMomentsManager = WorkMomentsManager(_channel);
|
||||||
|
organizationManager = OrganizationManager(_channel);
|
||||||
_addNativeCallback(_channel);
|
_addNativeCallback(_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +67,7 @@ class IMManager {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onSelfInfoUpdated':
|
case 'onSelfInfoUpdated':
|
||||||
uInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
uInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
||||||
userManager.userListener.selfInfoUpdated(uInfo);
|
userManager.listener.selfInfoUpdated(uInfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.groupListener) {
|
} else if (call.method == ListenerType.groupListener) {
|
||||||
@@ -70,49 +77,49 @@ class IMManager {
|
|||||||
case 'onGroupApplicationAccepted':
|
case 'onGroupApplicationAccepted':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupApplicationAccepted(i);
|
groupManager.listener.groupApplicationAccepted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationAdded':
|
case 'onGroupApplicationAdded':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupApplicationAdded(i);
|
groupManager.listener.groupApplicationAdded(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationDeleted':
|
case 'onGroupApplicationDeleted':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupApplicationDeleted(i);
|
groupManager.listener.groupApplicationDeleted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationRejected':
|
case 'onGroupApplicationRejected':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupApplicationRejected(i);
|
groupManager.listener.groupApplicationRejected(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupInfoChanged':
|
case 'onGroupInfoChanged':
|
||||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupInfoChanged(i);
|
groupManager.listener.groupInfoChanged(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupMemberAdded':
|
case 'onGroupMemberAdded':
|
||||||
final i =
|
final i =
|
||||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupMemberAdded(i);
|
groupManager.listener.groupMemberAdded(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupMemberDeleted':
|
case 'onGroupMemberDeleted':
|
||||||
final i =
|
final i =
|
||||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupMemberDeleted(i);
|
groupManager.listener.groupMemberDeleted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupMemberInfoChanged':
|
case 'onGroupMemberInfoChanged':
|
||||||
final i =
|
final i =
|
||||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||||
groupManager.groupListener.groupMemberInfoChanged(i);
|
groupManager.listener.groupMemberInfoChanged(i);
|
||||||
break;
|
break;
|
||||||
case 'onJoinedGroupAdded':
|
case 'onJoinedGroupAdded':
|
||||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||||
groupManager.groupListener.joinedGroupAdded(i);
|
groupManager.listener.joinedGroupAdded(i);
|
||||||
break;
|
break;
|
||||||
case 'onJoinedGroupDeleted':
|
case 'onJoinedGroupDeleted':
|
||||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||||
groupManager.groupListener.joinedGroupDeleted(i);
|
groupManager.listener.joinedGroupDeleted(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.advancedMsgListener) {
|
} else if (call.method == ListenerType.advancedMsgListener) {
|
||||||
@@ -122,17 +129,23 @@ class IMManager {
|
|||||||
case 'onRecvNewMessage':
|
case 'onRecvNewMessage':
|
||||||
var value = call.arguments['data']['newMessage'];
|
var value = call.arguments['data']['newMessage'];
|
||||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||||
messageManager.advancedMsgListener.recvNewMessage(msg);
|
messageManager.msgListener.recvNewMessage(msg);
|
||||||
break;
|
break;
|
||||||
case 'onRecvMessageRevoked':
|
case 'onRecvMessageRevoked':
|
||||||
var value = call.arguments['data']['revokedMessage'];
|
var msgID = call.arguments['data']['revokedMessage'];
|
||||||
messageManager.advancedMsgListener.recvMessageRevoked(value);
|
messageManager.msgListener.recvMessageRevoked(msgID);
|
||||||
break;
|
break;
|
||||||
case 'onRecvC2CReadReceipt':
|
case 'onRecvC2CReadReceipt':
|
||||||
var value = call.arguments['data']['haveReadMessage'];
|
var value = call.arguments['data']['c2cMessageReadReceipt'];
|
||||||
var list =
|
var list =
|
||||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||||
messageManager.advancedMsgListener.recvC2CReadReceipt(list);
|
messageManager.msgListener.recvC2CMessageReadReceipt(list);
|
||||||
|
break;
|
||||||
|
case 'onRecvGroupReadReceipt':
|
||||||
|
var value = call.arguments['data']['groupMessageReadReceipt'];
|
||||||
|
var list =
|
||||||
|
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||||
|
messageManager.msgListener.recvGroupMessageReadReceipt(list);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.msgSendProgressListener) {
|
} else if (call.method == ListenerType.msgSendProgressListener) {
|
||||||
@@ -153,28 +166,27 @@ class IMManager {
|
|||||||
dynamic data = call.arguments['data'];
|
dynamic data = call.arguments['data'];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onSyncServerStart':
|
case 'onSyncServerStart':
|
||||||
conversationManager.conversationListener.syncServerStart();
|
conversationManager.listener.syncServerStart();
|
||||||
break;
|
break;
|
||||||
case 'onSyncServerFinish':
|
case 'onSyncServerFinish':
|
||||||
conversationManager.conversationListener.syncServerFinish();
|
conversationManager.listener.syncServerFinish();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'onSyncServerFailed':
|
case 'onSyncServerFailed':
|
||||||
conversationManager.conversationListener.syncServerFailed();
|
conversationManager.listener.syncServerFailed();
|
||||||
break;
|
break;
|
||||||
case 'onNewConversation':
|
case 'onNewConversation':
|
||||||
var list =
|
var list =
|
||||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||||
conversationManager.conversationListener.newConversation(list);
|
conversationManager.listener.newConversation(list);
|
||||||
break;
|
break;
|
||||||
case 'onConversationChanged':
|
case 'onConversationChanged':
|
||||||
var list =
|
var list =
|
||||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||||
conversationManager.conversationListener
|
conversationManager.listener.conversationChanged(list);
|
||||||
.conversationChanged(list);
|
|
||||||
break;
|
break;
|
||||||
case 'onTotalUnreadMessageCountChanged':
|
case 'onTotalUnreadMessageCountChanged':
|
||||||
conversationManager.conversationListener
|
conversationManager.listener
|
||||||
.totalUnreadMessageCountChanged(data ?? 0);
|
.totalUnreadMessageCountChanged(data ?? 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -185,43 +197,87 @@ class IMManager {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onBlacklistAdded':
|
case 'onBlacklistAdded':
|
||||||
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.blacklistAdded(u);
|
friendshipManager.listener.blacklistAdded(u);
|
||||||
break;
|
break;
|
||||||
case 'onBlacklistDeleted':
|
case 'onBlacklistDeleted':
|
||||||
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.blacklistDeleted(u);
|
friendshipManager.listener.blacklistDeleted(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationAccepted':
|
case 'onFriendApplicationAccepted':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendApplicationAccepted(u);
|
friendshipManager.listener.friendApplicationAccepted(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationAdded':
|
case 'onFriendApplicationAdded':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendApplicationAdded(u);
|
friendshipManager.listener.friendApplicationAdded(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationDeleted':
|
case 'onFriendApplicationDeleted':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendApplicationDeleted(u);
|
friendshipManager.listener.friendApplicationDeleted(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationListRejected':
|
case 'onFriendApplicationRejected':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendApplicationRejected(u);
|
friendshipManager.listener.friendApplicationRejected(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendInfoChanged':
|
case 'onFriendInfoChanged':
|
||||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendInfoChanged(u);
|
friendshipManager.listener.friendInfoChanged(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendAdded':
|
case 'onFriendAdded':
|
||||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendAdded(u);
|
friendshipManager.listener.friendAdded(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendDeleted':
|
case 'onFriendDeleted':
|
||||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||||
friendshipManager.friendshipListener.friendDeleted(u);
|
friendshipManager.listener.friendDeleted(u);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (call.method == ListenerType.signalingListener) {
|
||||||
|
String type = call.arguments['type'];
|
||||||
|
dynamic data = call.arguments['data'];
|
||||||
|
final u = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
|
||||||
|
switch (type) {
|
||||||
|
case 'onInvitationCancelled':
|
||||||
|
signalingManager.listener.invitationCancelled(u);
|
||||||
|
break;
|
||||||
|
case 'onInvitationTimeout':
|
||||||
|
signalingManager.listener.invitationTimeout(u);
|
||||||
|
break;
|
||||||
|
case 'onInviteeAccepted':
|
||||||
|
signalingManager.listener.inviteeAccepted(u);
|
||||||
|
break;
|
||||||
|
case 'onInviteeRejected':
|
||||||
|
signalingManager.listener.inviteeRejected(u);
|
||||||
|
break;
|
||||||
|
case 'onReceiveNewInvitation':
|
||||||
|
signalingManager.listener.receiveNewInvitation(u);
|
||||||
|
break;
|
||||||
|
case 'onInviteeAcceptedByOtherDevice':
|
||||||
|
signalingManager.listener.inviteeAcceptedByOtherDevice(u);
|
||||||
|
break;
|
||||||
|
case 'onInviteeRejectedByOtherDevice':
|
||||||
|
signalingManager.listener.inviteeRejectedByOtherDevice(u);
|
||||||
|
break;
|
||||||
|
case 'onHangUp':
|
||||||
|
signalingManager.listener.hangup(u);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (call.method == ListenerType.workMomentsListener) {
|
||||||
|
String type = call.arguments['type'];
|
||||||
|
switch (type) {
|
||||||
|
case 'OnRecvNewNotification':
|
||||||
|
workMomentsManager.listener.recvNewNotification();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (call.method == ListenerType.organizationListener) {
|
||||||
|
String type = call.arguments['type'];
|
||||||
|
switch (type) {
|
||||||
|
case 'onOrganizationUpdated':
|
||||||
|
organizationManager.listener.organizationUpdated();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,6 +295,8 @@ class IMManager {
|
|||||||
/// [apiAddr] api server ip address
|
/// [apiAddr] api server ip address
|
||||||
/// [wsAddr] webSocket ip address
|
/// [wsAddr] webSocket ip address
|
||||||
/// [dataDir] data storage directory
|
/// [dataDir] data storage directory
|
||||||
|
/// [objectStorage] storage object: cos/minio
|
||||||
|
/// [logLevel] log level: 1-not print
|
||||||
///
|
///
|
||||||
/// 初始化SDK
|
/// 初始化SDK
|
||||||
///
|
///
|
||||||
@@ -246,6 +304,8 @@ class IMManager {
|
|||||||
/// [apiAddr] SDK api地址
|
/// [apiAddr] SDK api地址
|
||||||
/// [wsAddr] SDK websocket地址
|
/// [wsAddr] SDK websocket地址
|
||||||
/// [dataDir] SDK数据库存储目录
|
/// [dataDir] SDK数据库存储目录
|
||||||
|
/// [objectStorage] 存储对象 cos/minio
|
||||||
|
/// [logLevel] 日志 1-不打印
|
||||||
Future<dynamic> initSDK({
|
Future<dynamic> initSDK({
|
||||||
required int platform,
|
required int platform,
|
||||||
required String apiAddr,
|
required String apiAddr,
|
||||||
@@ -256,7 +316,8 @@ class IMManager {
|
|||||||
String objectStorage = 'cos',
|
String objectStorage = 'cos',
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
_connectListener = listener;
|
this._connectListener = listener;
|
||||||
|
this._objectStorage = objectStorage;
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
'initSDK',
|
'initSDK',
|
||||||
_buildParam(
|
_buildParam(
|
||||||
@@ -279,6 +340,8 @@ class IMManager {
|
|||||||
|
|
||||||
/// Login sdk
|
/// Login sdk
|
||||||
/// 登录
|
/// 登录
|
||||||
|
/// [uid]用户id
|
||||||
|
/// [token]登录token,从业务服务器上获取
|
||||||
Future<UserInfo> login({
|
Future<UserInfo> login({
|
||||||
required String uid,
|
required String uid,
|
||||||
required String token,
|
required String token,
|
||||||
@@ -294,6 +357,7 @@ class IMManager {
|
|||||||
);
|
);
|
||||||
this.isLogined = true;
|
this.isLogined = true;
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
|
this.token = token;
|
||||||
this.uInfo = await userManager.getSelfUserInfo();
|
this.uInfo = await userManager.getSelfUserInfo();
|
||||||
return uInfo;
|
return uInfo;
|
||||||
}
|
}
|
||||||
@@ -307,6 +371,7 @@ class IMManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
this.isLogined = false;
|
this.isLogined = false;
|
||||||
|
this.token = null;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,6 +387,34 @@ class IMManager {
|
|||||||
/// 获取当前登录用户信息
|
/// 获取当前登录用户信息
|
||||||
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
||||||
|
|
||||||
|
/// wakeup
|
||||||
|
/// 从后台回到前台立刻唤醒
|
||||||
|
Future wakeUp({String? operationID}) => _channel.invokeMethod(
|
||||||
|
'wakeUp',
|
||||||
|
_buildParam({
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// upload image to server
|
||||||
|
/// 上传图片到服务器
|
||||||
|
/// [path]图片路径
|
||||||
|
/// [token] im token
|
||||||
|
/// [objectStorage] 存储对象 cos/minio
|
||||||
|
Future uploadImage({
|
||||||
|
required String path,
|
||||||
|
String? token,
|
||||||
|
String? objectStorage,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'uploadImage',
|
||||||
|
_buildParam({
|
||||||
|
'path': path,
|
||||||
|
'token': token ?? this.token,
|
||||||
|
'obj': objectStorage ?? this._objectStorage,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "imManager";
|
param["ManagerName"] = "imManager";
|
||||||
return param;
|
return param;
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ class MessageManager {
|
|||||||
|
|
||||||
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
|
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
|
||||||
OnMsgSendProgressListener? msgSendProgressListener;
|
OnMsgSendProgressListener? msgSendProgressListener;
|
||||||
late OnAdvancedMsgListener advancedMsgListener;
|
late OnAdvancedMsgListener msgListener;
|
||||||
|
|
||||||
MessageManager(this._channel);
|
MessageManager(this._channel);
|
||||||
|
|
||||||
/// Set a message listener
|
/// Set a message listener
|
||||||
/// 消息监听
|
/// 消息监听
|
||||||
Future setAdvancedMsgListener(OnAdvancedMsgListener listener) {
|
Future setAdvancedMsgListener(OnAdvancedMsgListener listener) {
|
||||||
this.advancedMsgListener = listener;
|
this.msgListener = listener;
|
||||||
// advancedMsgListeners.add(listener);
|
// advancedMsgListeners.add(listener);
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
'setAdvancedMsgListener',
|
'setAdvancedMsgListener',
|
||||||
@@ -54,12 +54,16 @@ class MessageManager {
|
|||||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
/// Find all history message
|
/// Find all history message
|
||||||
/// 获取聊天记录
|
/// 获取聊天记录(以startMsg为节点,以前的聊天记录)
|
||||||
/// [userID]接收消息的用户id
|
/// [userID] 接收消息的用户id
|
||||||
/// [groupID]接收消息的组id
|
/// [conversationID] 会话id,查询通知时可用
|
||||||
|
/// [groupID] 接收消息的组id
|
||||||
|
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.first
|
||||||
|
/// [count] 一次拉取的总数
|
||||||
Future<List<Message>> getHistoryMessageList({
|
Future<List<Message>> getHistoryMessageList({
|
||||||
String? userID,
|
String? userID,
|
||||||
String? groupID,
|
String? groupID,
|
||||||
|
String? conversationID,
|
||||||
Message? startMsg,
|
Message? startMsg,
|
||||||
int? count,
|
int? count,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -70,6 +74,7 @@ class MessageManager {
|
|||||||
_buildParam({
|
_buildParam({
|
||||||
'userID': userID ?? '',
|
'userID': userID ?? '',
|
||||||
'groupID': groupID ?? '',
|
'groupID': groupID ?? '',
|
||||||
|
'conversationID': conversationID ?? '',
|
||||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||||
'count': count ?? 10,
|
'count': count ?? 10,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
@@ -90,7 +95,7 @@ class MessageManager {
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
/// Delete message
|
/// Delete message
|
||||||
/// 删除消息
|
/// 删除本地消息
|
||||||
Future deleteMessageFromLocalStorage({
|
Future deleteMessageFromLocalStorage({
|
||||||
required Message message,
|
required Message message,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -107,29 +112,41 @@ class MessageManager {
|
|||||||
// _channel.invokeMethod('deleteMessages',
|
// _channel.invokeMethod('deleteMessages',
|
||||||
// _buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
|
// _buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
|
||||||
|
|
||||||
///
|
/// 插入单聊消息到本地
|
||||||
Future insertSingleMessageToLocalStorage({
|
Future<Message> insertSingleMessageToLocalStorage({
|
||||||
String? receiverID,
|
String? receiverID,
|
||||||
String? senderID,
|
String? senderID,
|
||||||
Message? message,
|
Message? message,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel
|
||||||
'insertSingleMessageToLocalStorage',
|
.invokeMethod(
|
||||||
_buildParam({
|
'insertSingleMessageToLocalStorage',
|
||||||
"message": message?.toJson(),
|
_buildParam({
|
||||||
"receiverID": receiverID,
|
"message": message?.toJson(),
|
||||||
"senderID": senderID,
|
"receiverID": receiverID,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"senderID": senderID,
|
||||||
}));
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
/// Query the message according to the message id
|
/// 插入群聊消息到本地
|
||||||
// Future findMessages({required List<String> messageIDList}) =>
|
Future<Message> insertGroupMessageToLocalStorage({
|
||||||
// _channel.invokeMethod(
|
String? groupID,
|
||||||
// 'findMessages',
|
String? senderID,
|
||||||
// _buildParam({
|
Message? message,
|
||||||
// "messageIDList": messageIDList,
|
String? operationID,
|
||||||
// }));
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'insertGroupMessageToLocalStorage',
|
||||||
|
_buildParam({
|
||||||
|
"message": message?.toJson(),
|
||||||
|
"groupID": groupID,
|
||||||
|
"senderID": senderID,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
/// Mark c2c message as read
|
/// Mark c2c message as read
|
||||||
/// 标记c2c消息已读
|
/// 标记c2c消息已读
|
||||||
@@ -146,8 +163,24 @@ class MessageManager {
|
|||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
/// Mark group message as read
|
||||||
|
/// 标记群聊消息已读
|
||||||
|
Future markGroupMessageAsRead({
|
||||||
|
required String groupID,
|
||||||
|
required List<String> messageIDList,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'markGroupMessageAsRead',
|
||||||
|
_buildParam({
|
||||||
|
"messageIDList": messageIDList,
|
||||||
|
"groupID": groupID,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
/// Typing
|
/// Typing
|
||||||
/// 正在输入提示
|
/// 正在输入提示
|
||||||
|
/// [msgTip] 自定义内容
|
||||||
Future typingStatusUpdate({
|
Future typingStatusUpdate({
|
||||||
required String userID,
|
required String userID,
|
||||||
String? msgTip,
|
String? msgTip,
|
||||||
@@ -178,9 +211,15 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create @ message
|
/// Create @ message
|
||||||
/// 创建@消息
|
/// 创建@消息
|
||||||
|
/// [text] 输入内容
|
||||||
|
/// [atUserIDList] 被@到的userID集合
|
||||||
|
/// [atUserInfoList] userID跟nickname映射关系,用在界面显示时将id替换为nickname
|
||||||
|
/// [quoteMessage] 引用消息(被回复的消息)
|
||||||
Future<Message> createTextAtMessage({
|
Future<Message> createTextAtMessage({
|
||||||
required String text,
|
required String text,
|
||||||
required List<String> atUidList,
|
required List<String> atUserIDList,
|
||||||
|
List<AtUserInfo> atUserInfoList = const [],
|
||||||
|
Message? quoteMessage,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel
|
_channel
|
||||||
@@ -188,7 +227,9 @@ class MessageManager {
|
|||||||
'createTextAtMessage',
|
'createTextAtMessage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'text': text,
|
'text': text,
|
||||||
'atUserList': atUidList,
|
'atUserIDList': atUserIDList,
|
||||||
|
'atUserInfoList': atUserInfoList.map((e) => e.toJson()).toList(),
|
||||||
|
'quoteMessage': quoteMessage?.toJson(),
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
@@ -212,6 +253,7 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create picture message
|
/// Create picture message
|
||||||
/// 创建图片消息
|
/// 创建图片消息
|
||||||
|
/// [imagePath] 路径
|
||||||
Future<Message> createImageMessageFromFullPath({
|
Future<Message> createImageMessageFromFullPath({
|
||||||
required String imagePath,
|
required String imagePath,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -246,6 +288,8 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create sound message
|
/// Create sound message
|
||||||
/// 创建语音消息
|
/// 创建语音消息
|
||||||
|
/// [soundPath] 路径
|
||||||
|
/// [duration] 时长s
|
||||||
Future<Message> createSoundMessageFromFullPath({
|
Future<Message> createSoundMessageFromFullPath({
|
||||||
required String soundPath,
|
required String soundPath,
|
||||||
required int duration,
|
required int duration,
|
||||||
@@ -285,6 +329,10 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create video message
|
/// Create video message
|
||||||
/// 创建视频消息
|
/// 创建视频消息
|
||||||
|
/// [videoPath] 路径
|
||||||
|
/// [videoType] 视频mime类型
|
||||||
|
/// [duration] 时长s
|
||||||
|
/// [snapshotPath] 默认站位图路径
|
||||||
Future<Message> createVideoMessageFromFullPath({
|
Future<Message> createVideoMessageFromFullPath({
|
||||||
required String videoPath,
|
required String videoPath,
|
||||||
required String videoType,
|
required String videoType,
|
||||||
@@ -324,6 +372,8 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create file message
|
/// Create file message
|
||||||
/// 创建文件消息
|
/// 创建文件消息
|
||||||
|
/// [filePath] 路径
|
||||||
|
/// [fileName] 文件名
|
||||||
Future<Message> createFileMessageFromFullPath({
|
Future<Message> createFileMessageFromFullPath({
|
||||||
required String filePath,
|
required String filePath,
|
||||||
required String fileName,
|
required String fileName,
|
||||||
@@ -341,6 +391,9 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create merger message
|
/// Create merger message
|
||||||
/// 创建合并消息
|
/// 创建合并消息
|
||||||
|
/// [messageList] 被选中的消息
|
||||||
|
/// [title] 摘要标题
|
||||||
|
/// [summaryList] 摘要内容
|
||||||
Future<Message> createMergerMessage({
|
Future<Message> createMergerMessage({
|
||||||
required List<Message> messageList,
|
required List<Message> messageList,
|
||||||
required String title,
|
required String title,
|
||||||
@@ -360,6 +413,7 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create forward message
|
/// Create forward message
|
||||||
/// 创建转发消息
|
/// 创建转发消息
|
||||||
|
/// [message] 被转发的消息
|
||||||
Future<Message> createForwardMessage({
|
Future<Message> createForwardMessage({
|
||||||
required Message message,
|
required Message message,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -376,6 +430,9 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create location message
|
/// Create location message
|
||||||
/// 创建位置消息
|
/// 创建位置消息
|
||||||
|
/// [latitude] 纬度
|
||||||
|
/// [longitude] 经度
|
||||||
|
/// [description] 自定义描述信息
|
||||||
Future<Message> createLocationMessage({
|
Future<Message> createLocationMessage({
|
||||||
required double latitude,
|
required double latitude,
|
||||||
required double longitude,
|
required double longitude,
|
||||||
@@ -414,6 +471,8 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Create quote message
|
/// Create quote message
|
||||||
/// 创建引用消息
|
/// 创建引用消息
|
||||||
|
/// [text] 回复的内容
|
||||||
|
/// [quoteMsg] 被回复的消息
|
||||||
Future<Message> createQuoteMessage({
|
Future<Message> createQuoteMessage({
|
||||||
required String text,
|
required String text,
|
||||||
required Message quoteMsg,
|
required Message quoteMsg,
|
||||||
@@ -444,6 +503,27 @@ class MessageManager {
|
|||||||
}))
|
}))
|
||||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
|
/// Create custom emoji message
|
||||||
|
/// [index] The position of the emoji, such as the position emoji
|
||||||
|
/// [data] Other data, such as url expressions
|
||||||
|
/// 创建自定义表情消息
|
||||||
|
/// [index] 位置表情,根据index匹配
|
||||||
|
/// [data] url表情,直接使用url显示
|
||||||
|
Future<Message> createFaceMessage({
|
||||||
|
int index = -1,
|
||||||
|
String? data,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'createFaceMessage',
|
||||||
|
_buildParam({
|
||||||
|
'index': index,
|
||||||
|
'data': data,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
/// Clear all c2c history message
|
/// Clear all c2c history message
|
||||||
/// 清空单聊消息记录
|
/// 清空单聊消息记录
|
||||||
Future<dynamic> clearC2CHistoryMessage({
|
Future<dynamic> clearC2CHistoryMessage({
|
||||||
@@ -470,6 +550,155 @@ class MessageManager {
|
|||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
/// Search local message
|
||||||
|
/// 搜索消息
|
||||||
|
/// [conversationID] 根据会话查询,如果是全局搜索传null
|
||||||
|
/// [keywordList]搜索关键词列表,目前仅支持一个关键词搜索
|
||||||
|
/// [keywordListMatchType]关键词匹配模式,1代表与,2代表或,暂时未用
|
||||||
|
/// [senderUserIDList]指定消息发送的uid列表 暂时未用
|
||||||
|
/// [messageTypeList]消息类型列表
|
||||||
|
/// [searchTimePosition]搜索的起始时间点。默认为0即代表从现在开始搜索。UTC 时间戳,单位:秒
|
||||||
|
/// [searchTimePeriod]从起始时间点开始的过去时间范围,单位秒。默认为0即代表不限制时间范围,传24x60x60代表过去一天
|
||||||
|
/// [pageIndex]当前页数
|
||||||
|
/// [count]每页数量
|
||||||
|
Future<SearchResult> searchLocalMessages({
|
||||||
|
String? conversationID,
|
||||||
|
List<String> keywordList = const [],
|
||||||
|
int keywordListMatchType = 0,
|
||||||
|
List<String> senderUserIDList = const [],
|
||||||
|
List<int> messageTypeList = const [],
|
||||||
|
int searchTimePosition = 0,
|
||||||
|
int searchTimePeriod = 0,
|
||||||
|
int pageIndex = 1,
|
||||||
|
int count = 40,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'searchLocalMessages',
|
||||||
|
_buildParam({
|
||||||
|
'filter': {
|
||||||
|
'conversationID': conversationID,
|
||||||
|
'keywordList': keywordList,
|
||||||
|
'keywordListMatchType': keywordListMatchType,
|
||||||
|
'senderUserIDList': senderUserIDList,
|
||||||
|
'messageTypeList': messageTypeList,
|
||||||
|
'searchTimePosition': searchTimePosition,
|
||||||
|
'searchTimePeriod': searchTimePeriod,
|
||||||
|
'pageIndex': pageIndex,
|
||||||
|
'count': count,
|
||||||
|
},
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||||
|
|
||||||
|
/// Delete message from local and service
|
||||||
|
/// 删除本地跟服务器的指定的消息
|
||||||
|
Future<dynamic> deleteMessageFromLocalAndSvr({
|
||||||
|
required Message message,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'deleteMessageFromLocalAndSvr',
|
||||||
|
_buildParam(message.toJson()
|
||||||
|
..addAll({
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
})));
|
||||||
|
|
||||||
|
/// Delete all message from local
|
||||||
|
/// 删除本地所有聊天记录
|
||||||
|
Future<dynamic> deleteAllMsgFromLocal({
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'deleteAllMsgFromLocal',
|
||||||
|
_buildParam({
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Delete all message from service
|
||||||
|
/// 删除本地跟服务器所有聊天记录
|
||||||
|
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'deleteAllMsgFromLocalAndSvr',
|
||||||
|
_buildParam({
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Mark conversation message as read
|
||||||
|
/// 标记消息已读
|
||||||
|
/// [conversationID] 会话ID
|
||||||
|
/// [messageIDList] 被标记的消息clientMsgID
|
||||||
|
Future markMessageAsReadByConID({
|
||||||
|
required String conversationID,
|
||||||
|
required List<String> messageIDList,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'markMessageAsReadByConID',
|
||||||
|
_buildParam({
|
||||||
|
"messageIDList": messageIDList,
|
||||||
|
"conversationID": conversationID,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Clear all c2c history message
|
||||||
|
/// 删除本地跟服务器的单聊聊天记录
|
||||||
|
Future<dynamic> clearC2CHistoryMessageFromLocalAndSvr({
|
||||||
|
required String uid,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'clearC2CHistoryMessageFromLocalAndSvr',
|
||||||
|
_buildParam({
|
||||||
|
"userID": uid,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Clear all group history
|
||||||
|
/// 删除本地跟服务器的群聊天记录
|
||||||
|
Future<dynamic> clearGroupHistoryMessageFromLocalAndSvr({
|
||||||
|
required String gid,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'clearGroupHistoryMessageFromLocalAndSvr',
|
||||||
|
_buildParam({
|
||||||
|
"groupID": gid,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// Find all history message
|
||||||
|
/// 获取聊天记录(以startMsg为节点,新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
|
||||||
|
/// [userID] 接收消息的用户id
|
||||||
|
/// [conversationID] 会话id,查询通知时可用
|
||||||
|
/// [groupID] 接收消息的组id
|
||||||
|
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.last
|
||||||
|
/// [count] 一次拉取的总数
|
||||||
|
Future<List<Message>> getHistoryMessageListReverse({
|
||||||
|
String? userID,
|
||||||
|
String? groupID,
|
||||||
|
String? conversationID,
|
||||||
|
Message? startMsg,
|
||||||
|
int? count,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getHistoryMessageListReverse',
|
||||||
|
_buildParam({
|
||||||
|
'userID': userID ?? '',
|
||||||
|
'groupID': groupID ?? '',
|
||||||
|
'conversationID': conversationID ?? '',
|
||||||
|
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||||
|
'count': count ?? 10,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
return param;
|
return param;
|
||||||
|
|||||||
99
lib/src/manager/im_organization_manager.dart
Normal file
99
lib/src/manager/im_organization_manager.dart
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
class OrganizationManager {
|
||||||
|
MethodChannel _channel;
|
||||||
|
late OnOrganizationListener listener;
|
||||||
|
|
||||||
|
OrganizationManager(this._channel);
|
||||||
|
|
||||||
|
/// Observe organization info changes
|
||||||
|
/// 组织架构发生变化回调
|
||||||
|
Future setOrganizationListener(OnOrganizationListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
return _channel.invokeMethod('setOrganizationListener', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Query sub department
|
||||||
|
/// 获取子部门列表
|
||||||
|
Future<List<DeptInfo>> getSubDept({
|
||||||
|
required String departmentID,
|
||||||
|
int offset = 0,
|
||||||
|
int count = 40,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getSubDepartment',
|
||||||
|
_buildParam({
|
||||||
|
'departmentID': departmentID,
|
||||||
|
'offset': offset,
|
||||||
|
'count': count,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (v) => DeptInfo.fromJson(v)));
|
||||||
|
|
||||||
|
/// Get member under a department
|
||||||
|
/// 获取部门下的成员列表
|
||||||
|
Future<List<DeptMemberInfo>> getDeptMember({
|
||||||
|
required String departmentID,
|
||||||
|
int offset = 0,
|
||||||
|
int count = 40,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getDepartmentMember',
|
||||||
|
_buildParam({
|
||||||
|
'departmentID': departmentID,
|
||||||
|
'offset': offset,
|
||||||
|
'count': count,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toList(value, (v) => DeptMemberInfo.fromJson(v)));
|
||||||
|
|
||||||
|
/// Get member's department
|
||||||
|
/// 获取成员所在的部门
|
||||||
|
Future<List<UserInDept>> getUserInDept({
|
||||||
|
required String userID,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getUserInDepartment',
|
||||||
|
_buildParam({
|
||||||
|
'userID': userID,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (v) => UserInDept.fromJson(v)));
|
||||||
|
|
||||||
|
/// Get the sub-departments and employees under the department
|
||||||
|
/// 获取部门下的子部门跟员工
|
||||||
|
Future<DeptMemberAndSubDept> getDeptMemberAndSubDept({
|
||||||
|
required String departmentID,
|
||||||
|
// int departmentOffset = 0,
|
||||||
|
// int departmentCount = 40,
|
||||||
|
// int memberOffset = 0,
|
||||||
|
// int memberCount = 40,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getDepartmentMemberAndSubDepartment',
|
||||||
|
_buildParam({
|
||||||
|
'departmentID': departmentID,
|
||||||
|
// 'departmentOffset': departmentOffset,
|
||||||
|
// 'departmentCount': departmentCount,
|
||||||
|
// 'memberOffset': memberOffset,
|
||||||
|
// 'memberCount': memberCount,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toObj(value, (v) => DeptMemberAndSubDept.fromJson(v)));
|
||||||
|
|
||||||
|
static Map _buildParam(Map param) {
|
||||||
|
param["ManagerName"] = "organizationManager";
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,102 @@
|
|||||||
// import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
//
|
|
||||||
// class SignalingManager {
|
import '../../flutter_openim_sdk.dart';
|
||||||
// MethodChannel _channel;
|
|
||||||
//
|
class SignalingManager {
|
||||||
// SignalingManager(this._channel);
|
MethodChannel _channel;
|
||||||
// }
|
late OnSignalingListener listener;
|
||||||
|
|
||||||
|
SignalingManager(this._channel);
|
||||||
|
|
||||||
|
/// 信令监听
|
||||||
|
Future setSignalingListener(OnSignalingListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
return _channel.invokeMethod('setSignalingListener', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 邀请个人加入音视频
|
||||||
|
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)));
|
||||||
|
|
||||||
|
/// 邀请群里某些人加入音视频
|
||||||
|
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)));
|
||||||
|
|
||||||
|
/// 同意某人音视频邀请
|
||||||
|
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)));
|
||||||
|
|
||||||
|
/// 拒绝某人音视频邀请
|
||||||
|
Future<dynamic> signalingReject({
|
||||||
|
required SignalingInfo info,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'signalingReject',
|
||||||
|
_buildParam({
|
||||||
|
'signalingInfo': info.toJson(),
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// 邀请者取消音视频通话
|
||||||
|
Future<dynamic> signalingCancel({
|
||||||
|
required SignalingInfo info,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'signalingCancel',
|
||||||
|
_buildParam({
|
||||||
|
'signalingInfo': info.toJson(),
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/// 挂断
|
||||||
|
Future<dynamic> signalingHungUp({
|
||||||
|
required SignalingInfo info,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'signalingHungUp',
|
||||||
|
_buildParam({
|
||||||
|
'signalingInfo': info.toJson(),
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
static Map _buildParam(Map param) {
|
||||||
|
param["ManagerName"] = "signalingManager";
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|||||||
|
|
||||||
class UserManager {
|
class UserManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
late OnUserListener userListener;
|
late OnUserListener listener;
|
||||||
|
|
||||||
UserManager(this._channel);
|
UserManager(this._channel);
|
||||||
|
|
||||||
/// Observe user info changes
|
/// Observe user info changes
|
||||||
/// 用户资料改变监听
|
/// 用户资料改变监听
|
||||||
Future setUserListener(OnUserListener listener) {
|
Future setUserListener(OnUserListener listener) {
|
||||||
this.userListener = listener;
|
this.listener = listener;
|
||||||
return _channel.invokeMethod('setUserListener', _buildParam({}));
|
return _channel.invokeMethod('setUserListener', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
59
lib/src/manager/im_workmoments_manager.dart
Normal file
59
lib/src/manager/im_workmoments_manager.dart
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
class WorkMomentsManager {
|
||||||
|
MethodChannel _channel;
|
||||||
|
late OnWorkMomentsListener listener;
|
||||||
|
|
||||||
|
WorkMomentsManager(this._channel);
|
||||||
|
|
||||||
|
/// Observe work moments changes
|
||||||
|
Future setWorkMomentsListener(OnWorkMomentsListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
return _channel.invokeMethod('setWorkMomentsListener', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get work moments unread count
|
||||||
|
Future<int> getWorkMomentsUnReadCount({
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getWorkMomentsUnReadCount',
|
||||||
|
_buildParam({
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => map['unreadCount']));
|
||||||
|
|
||||||
|
/// Get work moments notification list
|
||||||
|
Future<List<WorkMomentsInfo>> getWorkMomentsNotification({
|
||||||
|
required int offset,
|
||||||
|
required int count,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getWorkMomentsNotification',
|
||||||
|
_buildParam({
|
||||||
|
'offset': offset,
|
||||||
|
'count': count,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toList(value, (map) => WorkMomentsInfo.fromJson(map)));
|
||||||
|
|
||||||
|
/// Clear work moments notification
|
||||||
|
Future clearWorkMomentsNotification({
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'clearWorkMomentsNotification',
|
||||||
|
_buildParam({
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
|
static Map _buildParam(Map param) {
|
||||||
|
param["ManagerName"] = "workMomentsManager";
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,22 +19,27 @@ class ConversationInfo {
|
|||||||
String? draftText;
|
String? draftText;
|
||||||
int? draftTextTime;
|
int? draftTextTime;
|
||||||
bool? isPinned;
|
bool? isPinned;
|
||||||
|
bool? isPrivateChat;
|
||||||
String? ext;
|
String? ext;
|
||||||
|
bool? isNotInGroup;
|
||||||
|
|
||||||
ConversationInfo(
|
ConversationInfo({
|
||||||
{required this.conversationID,
|
required this.conversationID,
|
||||||
this.conversationType,
|
this.conversationType,
|
||||||
this.userID,
|
this.userID,
|
||||||
this.groupID,
|
this.groupID,
|
||||||
this.showName,
|
this.showName,
|
||||||
this.faceURL,
|
this.faceURL,
|
||||||
this.recvMsgOpt,
|
this.recvMsgOpt,
|
||||||
this.unreadCount,
|
this.unreadCount,
|
||||||
this.latestMsg,
|
this.latestMsg,
|
||||||
this.latestMsgSendTime,
|
this.latestMsgSendTime,
|
||||||
this.draftText,
|
this.draftText,
|
||||||
this.draftTextTime,
|
this.draftTextTime,
|
||||||
this.isPinned});
|
this.isPrivateChat,
|
||||||
|
this.isPinned,
|
||||||
|
this.isNotInGroup,
|
||||||
|
});
|
||||||
|
|
||||||
ConversationInfo.fromJson(Map<String, dynamic> json)
|
ConversationInfo.fromJson(Map<String, dynamic> json)
|
||||||
: conversationID = json['conversationID'] {
|
: conversationID = json['conversationID'] {
|
||||||
@@ -56,6 +61,9 @@ class ConversationInfo {
|
|||||||
draftText = json['draftText'];
|
draftText = json['draftText'];
|
||||||
draftTextTime = json['draftTextTime'];
|
draftTextTime = json['draftTextTime'];
|
||||||
isPinned = json['isPinned'];
|
isPinned = json['isPinned'];
|
||||||
|
isPrivateChat = json['isPrivateChat'];
|
||||||
|
isNotInGroup = json['isNotInGroup'];
|
||||||
|
groupAtType = json['groupAtType'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -73,6 +81,9 @@ class ConversationInfo {
|
|||||||
data['draftText'] = this.draftText;
|
data['draftText'] = this.draftText;
|
||||||
data['draftTextTime'] = this.draftTextTime;
|
data['draftTextTime'] = this.draftTextTime;
|
||||||
data['isPinned'] = this.isPinned;
|
data['isPinned'] = this.isPinned;
|
||||||
|
data['isPrivateChat'] = this.isPrivateChat;
|
||||||
|
data['isNotInGroup'] = this.isNotInGroup;
|
||||||
|
data['groupAtType'] = this.groupAtType;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ class GroupInfo {
|
|||||||
String? ownerUserID;
|
String? ownerUserID;
|
||||||
int? createTime;
|
int? createTime;
|
||||||
int? memberCount;
|
int? memberCount;
|
||||||
|
|
||||||
|
/// ok = 0 blocked = 1 Dismissed = 2 Muted = 3
|
||||||
int? status;
|
int? status;
|
||||||
String? creatorUserID;
|
String? creatorUserID;
|
||||||
int? groupType;
|
int? groupType;
|
||||||
@@ -70,6 +72,8 @@ class GroupMembersInfo {
|
|||||||
int? joinSource;
|
int? joinSource;
|
||||||
String? operatorUserID;
|
String? operatorUserID;
|
||||||
String? ext;
|
String? ext;
|
||||||
|
int? muteEndTime;
|
||||||
|
int? appMangerLevel;
|
||||||
|
|
||||||
GroupMembersInfo({
|
GroupMembersInfo({
|
||||||
this.groupID,
|
this.groupID,
|
||||||
@@ -81,6 +85,8 @@ class GroupMembersInfo {
|
|||||||
this.ext,
|
this.ext,
|
||||||
this.joinSource,
|
this.joinSource,
|
||||||
this.operatorUserID,
|
this.operatorUserID,
|
||||||
|
this.muteEndTime,
|
||||||
|
this.appMangerLevel,
|
||||||
});
|
});
|
||||||
|
|
||||||
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
|
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -93,6 +99,8 @@ class GroupMembersInfo {
|
|||||||
ext = json['ext'];
|
ext = json['ext'];
|
||||||
joinSource = json['joinSource'];
|
joinSource = json['joinSource'];
|
||||||
operatorUserID = json['operatorUserID'];
|
operatorUserID = json['operatorUserID'];
|
||||||
|
muteEndTime = json['muteEndTime'];
|
||||||
|
appMangerLevel = json['appMangerLevel'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -106,6 +114,8 @@ class GroupMembersInfo {
|
|||||||
data['ext'] = this.ext;
|
data['ext'] = this.ext;
|
||||||
data['joinSource'] = this.joinSource;
|
data['joinSource'] = this.joinSource;
|
||||||
data['operatorUserID'] = this.operatorUserID;
|
data['operatorUserID'] = this.operatorUserID;
|
||||||
|
data['muteEndTime'] = this.muteEndTime;
|
||||||
|
data['appMangerLevel'] = this.appMangerLevel;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class Message {
|
|||||||
String? content;
|
String? content;
|
||||||
int? seq;
|
int? seq;
|
||||||
bool? isRead;
|
bool? isRead;
|
||||||
|
int? hasReadTime;
|
||||||
|
|
||||||
/// [MessageStatus]
|
/// [MessageStatus]
|
||||||
int? status;
|
int? status;
|
||||||
@@ -36,6 +37,8 @@ class Message {
|
|||||||
QuoteElem? quoteElem;
|
QuoteElem? quoteElem;
|
||||||
MergeElem? mergeElem;
|
MergeElem? mergeElem;
|
||||||
NotificationElem? notificationElem;
|
NotificationElem? notificationElem;
|
||||||
|
FaceElem? faceElem;
|
||||||
|
AttachedInfoElem? attachedInfoElem;
|
||||||
|
|
||||||
Message({
|
Message({
|
||||||
this.clientMsgID,
|
this.clientMsgID,
|
||||||
@@ -54,6 +57,7 @@ class Message {
|
|||||||
this.content,
|
this.content,
|
||||||
this.seq,
|
this.seq,
|
||||||
this.isRead,
|
this.isRead,
|
||||||
|
this.hasReadTime,
|
||||||
this.status,
|
this.status,
|
||||||
this.offlinePush,
|
this.offlinePush,
|
||||||
this.attachedInfo,
|
this.attachedInfo,
|
||||||
@@ -69,6 +73,8 @@ class Message {
|
|||||||
this.quoteElem,
|
this.quoteElem,
|
||||||
this.mergeElem,
|
this.mergeElem,
|
||||||
this.notificationElem,
|
this.notificationElem,
|
||||||
|
this.faceElem,
|
||||||
|
this.attachedInfoElem,
|
||||||
});
|
});
|
||||||
|
|
||||||
Message.fromJson(Map<String, dynamic> json) {
|
Message.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -123,6 +129,12 @@ class Message {
|
|||||||
notificationElem = json['notificationElem'] != null
|
notificationElem = json['notificationElem'] != null
|
||||||
? NotificationElem.fromJson(json['notificationElem'])
|
? NotificationElem.fromJson(json['notificationElem'])
|
||||||
: null;
|
: null;
|
||||||
|
faceElem =
|
||||||
|
json['faceElem'] != null ? FaceElem.fromJson(json['faceElem']) : null;
|
||||||
|
attachedInfoElem = json['attachedInfoElem'] != null
|
||||||
|
? AttachedInfoElem.fromJson(json['attachedInfoElem'])
|
||||||
|
: null;
|
||||||
|
hasReadTime = json['hasReadTime'] ?? attachedInfoElem?.hasReadTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -142,6 +154,7 @@ class Message {
|
|||||||
data['content'] = this.content;
|
data['content'] = this.content;
|
||||||
data['seq'] = this.seq;
|
data['seq'] = this.seq;
|
||||||
data['isRead'] = this.isRead;
|
data['isRead'] = this.isRead;
|
||||||
|
data['hasReadTime'] = this.hasReadTime;
|
||||||
data['status'] = this.status;
|
data['status'] = this.status;
|
||||||
data['offlinePush'] = this.offlinePush?.toJson();
|
data['offlinePush'] = this.offlinePush?.toJson();
|
||||||
data['attachedInfo'] = this.attachedInfo;
|
data['attachedInfo'] = this.attachedInfo;
|
||||||
@@ -158,6 +171,8 @@ class Message {
|
|||||||
data['quoteElem'] = this.quoteElem?.toJson();
|
data['quoteElem'] = this.quoteElem?.toJson();
|
||||||
data['mergeElem'] = this.mergeElem?.toJson();
|
data['mergeElem'] = this.mergeElem?.toJson();
|
||||||
data['notificationElem'] = this.notificationElem?.toJson();
|
data['notificationElem'] = this.notificationElem?.toJson();
|
||||||
|
data['faceElem'] = this.faceElem?.toJson();
|
||||||
|
data['attachedInfoElem'] = this.attachedInfoElem?.toJson();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,8 +187,7 @@ class Message {
|
|||||||
int get hashCode => clientMsgID.hashCode;
|
int get hashCode => clientMsgID.hashCode;
|
||||||
|
|
||||||
void update(Message message) {
|
void update(Message message) {
|
||||||
if (clientMsgID != message.clientMsgID) return;
|
if (this != message) return;
|
||||||
// clientMsgID = message.clientMsgID;
|
|
||||||
serverMsgID = message.serverMsgID;
|
serverMsgID = message.serverMsgID;
|
||||||
createTime = message.createTime;
|
createTime = message.createTime;
|
||||||
sendTime = message.sendTime;
|
sendTime = message.sendTime;
|
||||||
@@ -188,6 +202,7 @@ class Message {
|
|||||||
content = message.content;
|
content = message.content;
|
||||||
seq = message.seq;
|
seq = message.seq;
|
||||||
isRead = message.isRead;
|
isRead = message.isRead;
|
||||||
|
hasReadTime = message.hasReadTime;
|
||||||
status = message.status;
|
status = message.status;
|
||||||
offlinePush = message.offlinePush;
|
offlinePush = message.offlinePush;
|
||||||
attachedInfo = message.attachedInfo;
|
attachedInfo = message.attachedInfo;
|
||||||
@@ -204,6 +219,8 @@ class Message {
|
|||||||
quoteElem = message.quoteElem;
|
quoteElem = message.quoteElem;
|
||||||
mergeElem = message.mergeElem;
|
mergeElem = message.mergeElem;
|
||||||
notificationElem = message.notificationElem;
|
notificationElem = message.notificationElem;
|
||||||
|
faceElem = message.faceElem;
|
||||||
|
attachedInfoElem = message.attachedInfoElem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,8 +424,16 @@ class AtElem {
|
|||||||
String? text;
|
String? text;
|
||||||
List<String>? atUserList;
|
List<String>? atUserList;
|
||||||
bool? isAtSelf;
|
bool? isAtSelf;
|
||||||
|
List<AtUserInfo>? atUsersInfo;
|
||||||
|
Message? quoteMessage;
|
||||||
|
|
||||||
AtElem({this.text, this.atUserList, this.isAtSelf});
|
AtElem({
|
||||||
|
this.text,
|
||||||
|
this.atUserList,
|
||||||
|
this.isAtSelf,
|
||||||
|
this.atUsersInfo,
|
||||||
|
this.quoteMessage,
|
||||||
|
});
|
||||||
|
|
||||||
AtElem.fromJson(Map<String, dynamic> json) {
|
AtElem.fromJson(Map<String, dynamic> json) {
|
||||||
text = json['text'];
|
text = json['text'];
|
||||||
@@ -416,6 +441,14 @@ class AtElem {
|
|||||||
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
|
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
|
||||||
}
|
}
|
||||||
isAtSelf = json['isAtSelf'];
|
isAtSelf = json['isAtSelf'];
|
||||||
|
if (json['atUsersInfo'] is List) {
|
||||||
|
atUsersInfo = (json['atUsersInfo'] as List)
|
||||||
|
.map((e) => AtUserInfo.fromJson(e))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
quoteMessage = null != json['quoteMessage']
|
||||||
|
? Message.fromJson(json['quoteMessage'])
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -423,6 +456,8 @@ class AtElem {
|
|||||||
data['text'] = this.text;
|
data['text'] = this.text;
|
||||||
data['atUserList'] = this.atUserList;
|
data['atUserList'] = this.atUserList;
|
||||||
data['isAtSelf'] = this.isAtSelf;
|
data['isAtSelf'] = this.isAtSelf;
|
||||||
|
data['atUsersInfo'] = this.atUsersInfo?.map((e) => e.toJson()).toList();
|
||||||
|
data['quoteMessage'] = this.quoteMessage?.toJson();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -548,8 +583,83 @@ class NotificationElem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class FaceElem {
|
||||||
|
int? index;
|
||||||
|
String? data;
|
||||||
|
|
||||||
|
FaceElem({this.index, this.data});
|
||||||
|
|
||||||
|
FaceElem.fromJson(Map<String, dynamic> json) {
|
||||||
|
index = json['index'];
|
||||||
|
data = json['data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['index'] = this.index;
|
||||||
|
data['data'] = this.data;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AttachedInfoElem {
|
||||||
|
GroupHasReadInfo? groupHasReadInfo;
|
||||||
|
|
||||||
|
/// 单聊有效
|
||||||
|
bool? isPrivateChat;
|
||||||
|
int? hasReadTime;
|
||||||
|
bool? notSenderNotificationPush;
|
||||||
|
|
||||||
|
AttachedInfoElem({
|
||||||
|
this.groupHasReadInfo,
|
||||||
|
this.isPrivateChat,
|
||||||
|
this.hasReadTime,
|
||||||
|
this.notSenderNotificationPush,
|
||||||
|
});
|
||||||
|
|
||||||
|
AttachedInfoElem.fromJson(Map<String, dynamic> json) {
|
||||||
|
groupHasReadInfo = json['groupHasReadInfo'] == null
|
||||||
|
? null
|
||||||
|
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
|
||||||
|
isPrivateChat = json['isPrivateChat'];
|
||||||
|
hasReadTime = json['hasReadTime'];
|
||||||
|
notSenderNotificationPush = json['notSenderNotificationPush'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson();
|
||||||
|
data['isPrivateChat'] = this.isPrivateChat;
|
||||||
|
data['hasReadTime'] = this.hasReadTime;
|
||||||
|
data['notSenderNotificationPush'] = this.notSenderNotificationPush;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GroupHasReadInfo {
|
||||||
|
List<String>? hasReadUserIDList;
|
||||||
|
int? hasReadCount;
|
||||||
|
|
||||||
|
GroupHasReadInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['hasReadUserIDList'] == null) {
|
||||||
|
hasReadUserIDList = <String>[];
|
||||||
|
} else {
|
||||||
|
hasReadUserIDList = (json['hasReadUserIDList'] as List).cast<String>();
|
||||||
|
}
|
||||||
|
hasReadCount = json['hasReadCount'] ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['hasReadUserIDList'] = this.hasReadUserIDList;
|
||||||
|
data['hasReadCount'] = this.hasReadCount;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ReadReceiptInfo {
|
class ReadReceiptInfo {
|
||||||
String? uid;
|
String? userID;
|
||||||
|
String? groupID;
|
||||||
List<String>? msgIDList;
|
List<String>? msgIDList;
|
||||||
int? readTime;
|
int? readTime;
|
||||||
int? msgFrom;
|
int? msgFrom;
|
||||||
@@ -557,7 +667,8 @@ class ReadReceiptInfo {
|
|||||||
int? sessionType;
|
int? sessionType;
|
||||||
|
|
||||||
ReadReceiptInfo(
|
ReadReceiptInfo(
|
||||||
{this.uid,
|
{this.userID,
|
||||||
|
this.groupID,
|
||||||
this.msgIDList,
|
this.msgIDList,
|
||||||
this.readTime,
|
this.readTime,
|
||||||
this.msgFrom,
|
this.msgFrom,
|
||||||
@@ -565,7 +676,8 @@ class ReadReceiptInfo {
|
|||||||
this.sessionType});
|
this.sessionType});
|
||||||
|
|
||||||
ReadReceiptInfo.fromJson(Map<String, dynamic> json) {
|
ReadReceiptInfo.fromJson(Map<String, dynamic> json) {
|
||||||
uid = json['uid'];
|
userID = json['uid'] ?? json['userID'];
|
||||||
|
groupID = json['groupID'];
|
||||||
if (json['msgIDList'] is List) {
|
if (json['msgIDList'] is List) {
|
||||||
msgIDList = (json['msgIDList'] as List).map((e) => '$e').toList();
|
msgIDList = (json['msgIDList'] as List).map((e) => '$e').toList();
|
||||||
}
|
}
|
||||||
@@ -577,7 +689,7 @@ class ReadReceiptInfo {
|
|||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final data = Map<String, dynamic>();
|
final data = Map<String, dynamic>();
|
||||||
data['uid'] = this.uid;
|
data['userID'] = this.userID;
|
||||||
data['msgIDList'] = this.msgIDList;
|
data['msgIDList'] = this.msgIDList;
|
||||||
data['readTime'] = this.readTime;
|
data['readTime'] = this.readTime;
|
||||||
data['msgFrom'] = this.msgFrom;
|
data['msgFrom'] = this.msgFrom;
|
||||||
@@ -615,3 +727,22 @@ class OfflinePushInfo {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AtUserInfo {
|
||||||
|
String? atUserID;
|
||||||
|
String? groupNickname;
|
||||||
|
|
||||||
|
AtUserInfo({this.atUserID, this.groupNickname});
|
||||||
|
|
||||||
|
AtUserInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
atUserID = json['atUserID'];
|
||||||
|
groupNickname = json['groupNickname'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['atUserID'] = this.atUserID;
|
||||||
|
data['groupNickname'] = this.groupNickname;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
403
lib/src/models/notification_info.dart
Normal file
403
lib/src/models/notification_info.dart
Normal file
@@ -0,0 +1,403 @@
|
|||||||
|
import '../../flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
/// OA notification
|
||||||
|
/// oa 通知
|
||||||
|
class OANotification {
|
||||||
|
String? notificationName;
|
||||||
|
String? notificationFaceURL;
|
||||||
|
int? notificationType;
|
||||||
|
String? text;
|
||||||
|
String? externalUrl;
|
||||||
|
|
||||||
|
/// Notification Mix Type
|
||||||
|
/// 0: Plain text notification
|
||||||
|
/// 1: Text+picture notification
|
||||||
|
/// 2: Text+video notification
|
||||||
|
/// 3: Text+file notification
|
||||||
|
/// 0:纯文字通知 1:文字+图片通知 2:文字+视频通知 3:文字+文件通知
|
||||||
|
int? mixType;
|
||||||
|
PictureElem? pictureElem;
|
||||||
|
SoundElem? soundElem;
|
||||||
|
VideoElem? videoElem;
|
||||||
|
FileElem? fileElem;
|
||||||
|
String? ex;
|
||||||
|
|
||||||
|
OANotification(
|
||||||
|
{this.notificationName,
|
||||||
|
this.notificationFaceURL,
|
||||||
|
this.notificationType,
|
||||||
|
this.text,
|
||||||
|
this.externalUrl,
|
||||||
|
this.mixType,
|
||||||
|
this.pictureElem,
|
||||||
|
this.soundElem,
|
||||||
|
this.videoElem,
|
||||||
|
this.fileElem,
|
||||||
|
this.ex});
|
||||||
|
|
||||||
|
OANotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
notificationName = json['notificationName'];
|
||||||
|
notificationFaceURL = json['notificationFaceURL'];
|
||||||
|
notificationType = json['notificationType'];
|
||||||
|
text = json['text'];
|
||||||
|
externalUrl = json['externalUrl'];
|
||||||
|
mixType = json['mixType'];
|
||||||
|
pictureElem = json['pictureElem'] != null
|
||||||
|
? PictureElem.fromJson(json['pictureElem'])
|
||||||
|
: null;
|
||||||
|
soundElem = json['soundElem'] != null
|
||||||
|
? SoundElem.fromJson(json['soundElem'])
|
||||||
|
: null;
|
||||||
|
videoElem = json['videoElem'] != null
|
||||||
|
? VideoElem.fromJson(json['videoElem'])
|
||||||
|
: null;
|
||||||
|
fileElem =
|
||||||
|
json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
|
||||||
|
ex = json['ex'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['notificationName'] = this.notificationName;
|
||||||
|
data['notificationFaceURL'] = this.notificationFaceURL;
|
||||||
|
data['notificationType'] = this.notificationType;
|
||||||
|
data['text'] = this.text;
|
||||||
|
data['externalUrl'] = this.externalUrl;
|
||||||
|
data['mixType'] = this.mixType;
|
||||||
|
if (this.pictureElem != null) {
|
||||||
|
data['pictureElem'] = this.pictureElem!.toJson();
|
||||||
|
}
|
||||||
|
if (this.soundElem != null) {
|
||||||
|
data['soundElem'] = this.soundElem!.toJson();
|
||||||
|
}
|
||||||
|
if (this.videoElem != null) {
|
||||||
|
data['videoElem'] = this.videoElem!.toJson();
|
||||||
|
}
|
||||||
|
if (this.fileElem != null) {
|
||||||
|
data['fileElem'] = this.fileElem!.toJson();
|
||||||
|
}
|
||||||
|
data['ex'] = this.ex;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Group common notification
|
||||||
|
class GroupNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? opUser;
|
||||||
|
GroupMembersInfo? groupOwnerUser;
|
||||||
|
List<GroupMembersInfo>? memberList;
|
||||||
|
|
||||||
|
GroupNotification({
|
||||||
|
this.group,
|
||||||
|
this.opUser,
|
||||||
|
this.groupOwnerUser,
|
||||||
|
this.memberList,
|
||||||
|
});
|
||||||
|
|
||||||
|
GroupNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
opUser = json['opUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['opUser'])
|
||||||
|
: null;
|
||||||
|
groupOwnerUser = json['groupOwnerUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['groupOwnerUser'])
|
||||||
|
: null;
|
||||||
|
if (json['memberList'] != null) {
|
||||||
|
memberList = <GroupMembersInfo>[];
|
||||||
|
json['memberList'].forEach((v) {
|
||||||
|
memberList!.add(GroupMembersInfo.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.opUser != null) {
|
||||||
|
data['opUser'] = this.opUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.groupOwnerUser != null) {
|
||||||
|
data['groupOwnerUser'] = this.groupOwnerUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.memberList != null) {
|
||||||
|
data['memberList'] = this.memberList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// User is invited to the group notification
|
||||||
|
/// 用户被邀请进群通知
|
||||||
|
class InvitedJoinGroupNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? opUser;
|
||||||
|
List<GroupMembersInfo>? invitedUserList;
|
||||||
|
|
||||||
|
InvitedJoinGroupNotification({this.group, this.opUser, this.invitedUserList});
|
||||||
|
|
||||||
|
InvitedJoinGroupNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
opUser = json['opUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['opUser'])
|
||||||
|
: null;
|
||||||
|
if (json['invitedUserList'] != null) {
|
||||||
|
invitedUserList = <GroupMembersInfo>[];
|
||||||
|
json['invitedUserList'].forEach((v) {
|
||||||
|
invitedUserList!.add(GroupMembersInfo.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.opUser != null) {
|
||||||
|
data['opUser'] = this.opUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.invitedUserList != null) {
|
||||||
|
data['invitedUserList'] =
|
||||||
|
this.invitedUserList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Group kicked member notification
|
||||||
|
/// 组踢出成员通知
|
||||||
|
class KickedGroupMemeberNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? opUser;
|
||||||
|
List<GroupMembersInfo>? kickedUserList;
|
||||||
|
|
||||||
|
KickedGroupMemeberNotification(
|
||||||
|
{this.group, this.opUser, this.kickedUserList});
|
||||||
|
|
||||||
|
KickedGroupMemeberNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
opUser = json['opUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['opUser'])
|
||||||
|
: null;
|
||||||
|
if (json['kickedUserList'] != null) {
|
||||||
|
kickedUserList = <GroupMembersInfo>[];
|
||||||
|
json['kickedUserList'].forEach((v) {
|
||||||
|
kickedUserList!.add(GroupMembersInfo.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.opUser != null) {
|
||||||
|
data['opUser'] = this.opUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.kickedUserList != null) {
|
||||||
|
data['kickedUserList'] =
|
||||||
|
this.kickedUserList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Exit group notification
|
||||||
|
/// 退出群通知
|
||||||
|
class QuitGroupNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? quitUser;
|
||||||
|
|
||||||
|
QuitGroupNotification({this.group, this.quitUser});
|
||||||
|
|
||||||
|
QuitGroupNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
quitUser = json['quitUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['quitUser'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.quitUser != null) {
|
||||||
|
data['quitUser'] = this.quitUser!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Enter group notification
|
||||||
|
/// 进群通知
|
||||||
|
class EnterGroupNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? entrantUser;
|
||||||
|
|
||||||
|
EnterGroupNotification({this.group, this.entrantUser});
|
||||||
|
|
||||||
|
EnterGroupNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
entrantUser = json['entrantUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['entrantUser'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.entrantUser != null) {
|
||||||
|
data['quitUser'] = this.entrantUser!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Group rights transfer noticication
|
||||||
|
/// 群权转让通知
|
||||||
|
class GroupRightsTransferNoticication {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? opUser;
|
||||||
|
GroupMembersInfo? newGroupOwner;
|
||||||
|
|
||||||
|
GroupRightsTransferNoticication({
|
||||||
|
this.group,
|
||||||
|
this.opUser,
|
||||||
|
this.newGroupOwner,
|
||||||
|
});
|
||||||
|
|
||||||
|
GroupRightsTransferNoticication.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
opUser = json['opUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['opUser'])
|
||||||
|
: null;
|
||||||
|
newGroupOwner = json['newGroupOwner'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['newGroupOwner'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.opUser != null) {
|
||||||
|
data['opUser'] = this.opUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.newGroupOwner != null) {
|
||||||
|
data['newGroupOwner'] = this.newGroupOwner!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Mute member notification
|
||||||
|
/// 禁言成员通知
|
||||||
|
class MuteMemberNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? opUser;
|
||||||
|
GroupMembersInfo? mutedUser;
|
||||||
|
int? mutedSeconds;
|
||||||
|
|
||||||
|
MuteMemberNotification({
|
||||||
|
this.group,
|
||||||
|
this.opUser,
|
||||||
|
this.mutedUser,
|
||||||
|
this.mutedSeconds,
|
||||||
|
});
|
||||||
|
|
||||||
|
MuteMemberNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
opUser = json['opUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['opUser'])
|
||||||
|
: null;
|
||||||
|
mutedUser = json['mutedUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['mutedUser'])
|
||||||
|
: null;
|
||||||
|
mutedSeconds = json['mutedSeconds'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.opUser != null) {
|
||||||
|
data['opUser'] = this.opUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.mutedUser != null) {
|
||||||
|
data['mutedUser'] = this.mutedUser!.toJson();
|
||||||
|
}
|
||||||
|
data['mutedSeconds'] = this.mutedSeconds;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Burn after reading notification
|
||||||
|
/// 阅后即焚通知
|
||||||
|
class BurnAfterReadingNotification {
|
||||||
|
String? recvID;
|
||||||
|
String? sendID;
|
||||||
|
bool? isPrivate;
|
||||||
|
|
||||||
|
BurnAfterReadingNotification({this.recvID, this.sendID, this.isPrivate});
|
||||||
|
|
||||||
|
BurnAfterReadingNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
recvID = json['recvID'];
|
||||||
|
sendID = json['sendID'];
|
||||||
|
isPrivate = json['isPrivate'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['recvID'] = this.recvID;
|
||||||
|
data['sendID'] = this.sendID;
|
||||||
|
data['isPrivate'] = this.isPrivate;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Group member info changed notification
|
||||||
|
/// 禁言成员通知
|
||||||
|
class GroupMemberInfoChangedNotification {
|
||||||
|
GroupInfo? group;
|
||||||
|
GroupMembersInfo? opUser;
|
||||||
|
GroupMembersInfo? changedUser;
|
||||||
|
|
||||||
|
GroupMemberInfoChangedNotification({
|
||||||
|
this.group,
|
||||||
|
this.opUser,
|
||||||
|
this.changedUser,
|
||||||
|
});
|
||||||
|
|
||||||
|
GroupMemberInfoChangedNotification.fromJson(Map<String, dynamic> json) {
|
||||||
|
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
|
||||||
|
opUser = json['opUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['opUser'])
|
||||||
|
: null;
|
||||||
|
changedUser = json['changedUser'] != null
|
||||||
|
? GroupMembersInfo.fromJson(json['changedUser'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
if (this.group != null) {
|
||||||
|
data['group'] = this.group!.toJson();
|
||||||
|
}
|
||||||
|
if (this.opUser != null) {
|
||||||
|
data['opUser'] = this.opUser!.toJson();
|
||||||
|
}
|
||||||
|
if (this.changedUser != null) {
|
||||||
|
data['changedUser'] = this.changedUser!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
220
lib/src/models/organization_info.dart
Normal file
220
lib/src/models/organization_info.dart
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
class DeptInfo {
|
||||||
|
String? departmentID;
|
||||||
|
String? faceURL;
|
||||||
|
String? name;
|
||||||
|
String? parentID;
|
||||||
|
int? order;
|
||||||
|
int? departmentType;
|
||||||
|
int? createTime;
|
||||||
|
int? subDepartmentNum;
|
||||||
|
int? memberNum;
|
||||||
|
String? ex;
|
||||||
|
String? attachedInfo;
|
||||||
|
|
||||||
|
DeptInfo(
|
||||||
|
{this.departmentID,
|
||||||
|
this.faceURL,
|
||||||
|
this.name,
|
||||||
|
this.parentID,
|
||||||
|
this.order,
|
||||||
|
this.departmentType,
|
||||||
|
this.createTime,
|
||||||
|
this.subDepartmentNum,
|
||||||
|
this.memberNum,
|
||||||
|
this.ex,
|
||||||
|
this.attachedInfo});
|
||||||
|
|
||||||
|
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'];
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
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 {
|
||||||
|
String? userID;
|
||||||
|
String? nickname;
|
||||||
|
String? englishName;
|
||||||
|
String? faceURL;
|
||||||
|
int? gender;
|
||||||
|
String? mobile;
|
||||||
|
String? telephone;
|
||||||
|
int? birth;
|
||||||
|
String? email;
|
||||||
|
String? departmentID;
|
||||||
|
int? order;
|
||||||
|
String? position;
|
||||||
|
int? leader;
|
||||||
|
int? status;
|
||||||
|
int? createTime;
|
||||||
|
String? ex;
|
||||||
|
String? attachedInfo;
|
||||||
|
|
||||||
|
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});
|
||||||
|
|
||||||
|
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'];
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
|
||||||
|
DeptMemberAndSubDept({this.departmentList, this.departmentMemberList});
|
||||||
|
|
||||||
|
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));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
74
lib/src/models/search_info.dart
Normal file
74
lib/src/models/search_info.dart
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
class SearchResult {
|
||||||
|
/// 获取到的总的消息数量
|
||||||
|
int? totalCount;
|
||||||
|
List<SearchResultItems>? searchResultItems;
|
||||||
|
|
||||||
|
SearchResult({this.totalCount, this.searchResultItems});
|
||||||
|
|
||||||
|
SearchResult.fromJson(Map<String, dynamic> json) {
|
||||||
|
totalCount = json['totalCount'];
|
||||||
|
if (json['searchResultItems'] != null) {
|
||||||
|
searchResultItems = <SearchResultItems>[];
|
||||||
|
json['searchResultItems'].forEach((v) {
|
||||||
|
searchResultItems!.add(SearchResultItems.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['totalCount'] = this.totalCount;
|
||||||
|
if (this.searchResultItems != null) {
|
||||||
|
data['searchResultItems'] =
|
||||||
|
this.searchResultItems!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchResultItems {
|
||||||
|
/// 会话ID
|
||||||
|
String? conversationID;
|
||||||
|
|
||||||
|
/// 会话类型1单聊,2群聊,3,超级大群,4通知会话
|
||||||
|
int? conversationType;
|
||||||
|
String? showName;
|
||||||
|
String? faceURL;
|
||||||
|
|
||||||
|
/// 搜索到的这个会话下的消息数量
|
||||||
|
int? messageCount;
|
||||||
|
|
||||||
|
/// [Message]的列表
|
||||||
|
List<Message>? messageList;
|
||||||
|
|
||||||
|
SearchResultItems({this.conversationID, this.messageCount, this.messageList});
|
||||||
|
|
||||||
|
SearchResultItems.fromJson(Map<String, dynamic> json) {
|
||||||
|
conversationID = json['conversationID'];
|
||||||
|
conversationType = json['conversationType'];
|
||||||
|
showName = json['showName'];
|
||||||
|
faceURL = json['faceURL'];
|
||||||
|
messageCount = json['messageCount'];
|
||||||
|
if (json['messageList'] != null) {
|
||||||
|
messageList = <Message>[];
|
||||||
|
json['messageList'].forEach((v) {
|
||||||
|
messageList!.add(Message.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['conversationID'] = this.conversationID;
|
||||||
|
data['conversationType'] = this.conversationType;
|
||||||
|
data['showName'] = this.showName;
|
||||||
|
data['faceURL'] = this.faceURL;
|
||||||
|
data['messageCount'] = this.messageCount;
|
||||||
|
if (this.messageList != null) {
|
||||||
|
data['messageList'] = this.messageList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
98
lib/src/models/signaling_info.dart
Normal file
98
lib/src/models/signaling_info.dart
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
class SignalingInfo {
|
||||||
|
String? opUserID;
|
||||||
|
InvitationInfo? invitation;
|
||||||
|
OfflinePushInfo? offlinePushInfo;
|
||||||
|
|
||||||
|
SignalingInfo({
|
||||||
|
this.opUserID,
|
||||||
|
this.invitation,
|
||||||
|
this.offlinePushInfo,
|
||||||
|
});
|
||||||
|
|
||||||
|
SignalingInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
opUserID = json['opUserID'];
|
||||||
|
invitation = json['invitation'] == null
|
||||||
|
? null
|
||||||
|
: InvitationInfo.fromJson(json['invitation']);
|
||||||
|
offlinePushInfo = json['offlinePushInfo'] == null
|
||||||
|
? null
|
||||||
|
: OfflinePushInfo.fromJson(json['offlinePushInfo']);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['opUserID'] = this.opUserID;
|
||||||
|
data['invitation'] = this.invitation?.toJson();
|
||||||
|
data['offlinePushInfo'] = this.offlinePushInfo?.toJson();
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class InvitationInfo {
|
||||||
|
String? inviterUserID; //邀请者UserID
|
||||||
|
List<String>? inviteeUserIDList; //被邀请者UserID列表,如果是单聊只有一个元素
|
||||||
|
String? groupID; //如果是单聊,为""
|
||||||
|
String? roomID; //房间ID,必须唯一,可以不设置。
|
||||||
|
int? timeout; //邀请超时时间(秒)
|
||||||
|
String? mediaType; //video 或者audio
|
||||||
|
int? sessionType; //1为单聊,2为群聊
|
||||||
|
int? platformID; //和之前定义一致
|
||||||
|
|
||||||
|
InvitationInfo(
|
||||||
|
{this.inviterUserID,
|
||||||
|
this.inviteeUserIDList,
|
||||||
|
this.groupID,
|
||||||
|
this.roomID,
|
||||||
|
this.timeout,
|
||||||
|
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'];
|
||||||
|
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['mediaType'] = this.mediaType;
|
||||||
|
data['sessionType'] = this.sessionType;
|
||||||
|
data['platformID'] = this.platformID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SignalingCertificate {
|
||||||
|
String? token;
|
||||||
|
String? roomID;
|
||||||
|
String? liveURL;
|
||||||
|
|
||||||
|
SignalingCertificate({this.token, this.roomID, this.liveURL});
|
||||||
|
|
||||||
|
SignalingCertificate.fromJson(Map<String, dynamic> json) {
|
||||||
|
token = json['token'];
|
||||||
|
roomID = json['roomID'];
|
||||||
|
liveURL = json['liveURL'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['token'] = this.token;
|
||||||
|
data['roomID'] = this.roomID;
|
||||||
|
data['liveURL'] = this.liveURL;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,11 +16,17 @@ class UserInfo {
|
|||||||
int? createTime;
|
int? createTime;
|
||||||
String? remark;
|
String? remark;
|
||||||
|
|
||||||
|
/// User's public profile(用户公开的资料)
|
||||||
PublicUserInfo? publicInfo;
|
PublicUserInfo? publicInfo;
|
||||||
|
|
||||||
|
/// Only friends can view information(好友才能查看的资料)
|
||||||
FriendInfo? friendInfo;
|
FriendInfo? friendInfo;
|
||||||
|
|
||||||
|
/// blacklist information(黑名单资料)
|
||||||
BlacklistInfo? blackInfo;
|
BlacklistInfo? blackInfo;
|
||||||
|
|
||||||
bool? isFriendship;
|
bool? isFriendship;
|
||||||
|
|
||||||
bool? isBlacklist;
|
bool? isBlacklist;
|
||||||
|
|
||||||
UserInfo({
|
UserInfo({
|
||||||
@@ -76,7 +82,7 @@ class UserInfo {
|
|||||||
birth = json['birth'] ?? _birth;
|
birth = json['birth'] ?? _birth;
|
||||||
email = json['email'] ?? _email;
|
email = json['email'] ?? _email;
|
||||||
remark = json['remark'] ?? _remark;
|
remark = json['remark'] ?? _remark;
|
||||||
ex = json['ex'];
|
ex = json['ex'] ?? _ex;
|
||||||
createTime = json['createTime'];
|
createTime = json['createTime'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +129,10 @@ class UserInfo {
|
|||||||
? friendInfo?.gender
|
? friendInfo?.gender
|
||||||
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
|
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
|
||||||
|
|
||||||
|
String? get _ex => isFriendship!
|
||||||
|
? friendInfo?.ex
|
||||||
|
: (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
|
||||||
|
|
||||||
String? get _phoneNumber => friendInfo?.phoneNumber;
|
String? get _phoneNumber => friendInfo?.phoneNumber;
|
||||||
|
|
||||||
int? get _birth => friendInfo?.birth;
|
int? get _birth => friendInfo?.birth;
|
||||||
@@ -131,12 +141,22 @@ class UserInfo {
|
|||||||
|
|
||||||
String? get _remark => friendInfo?.remark;
|
String? get _remark => friendInfo?.remark;
|
||||||
|
|
||||||
String getShowName() => _trimBlank(remark) ?? _trimBlank(nickname) ?? userID!;
|
String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!;
|
||||||
|
|
||||||
static String? _trimBlank(String? value) {
|
static String? _isNull(String? value) {
|
||||||
if (value == null || value.trim().isEmpty) return null;
|
if (value == null || value.trim().isEmpty) return null;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is UserInfo &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
userID == other.userID;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => userID.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PublicUserInfo {
|
class PublicUserInfo {
|
||||||
@@ -145,6 +165,7 @@ class PublicUserInfo {
|
|||||||
String? faceURL;
|
String? faceURL;
|
||||||
int? gender;
|
int? gender;
|
||||||
int? appMangerLevel;
|
int? appMangerLevel;
|
||||||
|
String? ex;
|
||||||
|
|
||||||
PublicUserInfo({
|
PublicUserInfo({
|
||||||
this.userID,
|
this.userID,
|
||||||
@@ -152,6 +173,7 @@ class PublicUserInfo {
|
|||||||
this.faceURL,
|
this.faceURL,
|
||||||
this.gender,
|
this.gender,
|
||||||
this.appMangerLevel,
|
this.appMangerLevel,
|
||||||
|
this.ex,
|
||||||
});
|
});
|
||||||
|
|
||||||
PublicUserInfo.fromJson(Map<String, dynamic> json) {
|
PublicUserInfo.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -160,6 +182,7 @@ class PublicUserInfo {
|
|||||||
faceURL = json['faceURL'];
|
faceURL = json['faceURL'];
|
||||||
gender = json['gender'];
|
gender = json['gender'];
|
||||||
appMangerLevel = json['appMangerLevel'];
|
appMangerLevel = json['appMangerLevel'];
|
||||||
|
ex = json['ex'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -169,6 +192,7 @@ class PublicUserInfo {
|
|||||||
data['faceURL'] = this.faceURL;
|
data['faceURL'] = this.faceURL;
|
||||||
data['gender'] = this.gender;
|
data['gender'] = this.gender;
|
||||||
data['appMangerLevel'] = this.appMangerLevel;
|
data['appMangerLevel'] = this.appMangerLevel;
|
||||||
|
data['ex'] = this.ex;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
56
lib/src/models/workmoments_info.dart
Normal file
56
lib/src/models/workmoments_info.dart
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
class WorkMomentsInfo {
|
||||||
|
int? notificationMsgType;
|
||||||
|
String? replyUserName;
|
||||||
|
String? replyUserID;
|
||||||
|
String? content;
|
||||||
|
String? contentID;
|
||||||
|
String? workMomentID;
|
||||||
|
String? userID;
|
||||||
|
String? userName;
|
||||||
|
String? faceURL;
|
||||||
|
String? workMomentContent;
|
||||||
|
int? createTime;
|
||||||
|
|
||||||
|
WorkMomentsInfo(
|
||||||
|
{this.notificationMsgType,
|
||||||
|
this.replyUserName,
|
||||||
|
this.replyUserID,
|
||||||
|
this.content,
|
||||||
|
this.contentID,
|
||||||
|
this.workMomentID,
|
||||||
|
this.userID,
|
||||||
|
this.userName,
|
||||||
|
this.faceURL,
|
||||||
|
this.workMomentContent,
|
||||||
|
this.createTime});
|
||||||
|
|
||||||
|
WorkMomentsInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
notificationMsgType = json['notificationMsgType'];
|
||||||
|
replyUserName = json['replyUserName'];
|
||||||
|
replyUserID = json['replyUserID'];
|
||||||
|
content = json['content'];
|
||||||
|
contentID = json['contentID'];
|
||||||
|
workMomentID = json['workMomentID'];
|
||||||
|
userID = json['userID'];
|
||||||
|
userName = json['userName'];
|
||||||
|
faceURL = json['faceURL'];
|
||||||
|
workMomentContent = json['workMomentContent'];
|
||||||
|
createTime = json['createTime'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['notificationMsgType'] = this.notificationMsgType;
|
||||||
|
data['replyUserName'] = this.replyUserName;
|
||||||
|
data['replyUserID'] = this.replyUserID;
|
||||||
|
data['content'] = this.content;
|
||||||
|
data['contentID'] = this.contentID;
|
||||||
|
data['workMomentID'] = this.workMomentID;
|
||||||
|
data['userID'] = this.userID;
|
||||||
|
data['userName'] = this.userName;
|
||||||
|
data['faceURL'] = this.faceURL;
|
||||||
|
data['workMomentContent'] = this.workMomentContent;
|
||||||
|
data['createTime'] = this.createTime;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
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: 2.0.0+1
|
version: 2.0.9
|
||||||
homepage: https://www.rentsoft.cn
|
homepage: https://www.rentsoft.cn
|
||||||
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user