Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0b28099bf | ||
|
|
d5d11af7ce | ||
|
|
9cd717c67c | ||
|
|
c7218cb94c | ||
|
|
e4c78e0106 | ||
|
|
7457f182f3 | ||
|
|
952cb82417 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
## 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
|
## 2.0.0+6
|
||||||
|
|
||||||
1.Fix bug</br>
|
1.Fix bug</br>
|
||||||
|
|||||||
424
README.zh-cn.md
424
README.zh-cn.md
@@ -165,6 +165,8 @@ OpenIM.iMManager
|
|||||||
|
|
||||||
## 方法名、参数、返回值说明
|
## 方法名、参数、返回值说明
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### logout( 登出)
|
- ##### logout( 登出)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -173,6 +175,8 @@ OpenIM.iMManager
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getLoginUserInfo(获取当前登录用户的资料)
|
- ##### getLoginUserInfo(获取当前登录用户的资料)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -181,6 +185,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getLoginUserID(获取当前登录用户的ID)
|
- ##### getLoginUserID(获取当前登录用户的ID)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -189,6 +195,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getUsersInfo(根据用户ID批量获取用户信息)
|
- ##### getUsersInfo(根据用户ID批量获取用户信息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -199,6 +207,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getSelfUserInfo(获取当前登录用户的资料)
|
- ##### getSelfUserInfo(获取当前登录用户的资料)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -207,6 +217,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setSelfInfo(修改当前用登录户资料)
|
- ##### setSelfInfo(修改当前用登录户资料)
|
||||||
|
|
||||||
会触发当用户的onSelfInfoUpdated回调,以及好友的onFriendInfoChanged、onConversationChanged回调。
|
会触发当用户的onSelfInfoUpdated回调,以及好友的onFriendInfoChanged、onConversationChanged回调。
|
||||||
@@ -223,6 +235,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getAllConversationList(获取所有会话)
|
- ##### getAllConversationList(获取所有会话)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -231,6 +245,8 @@ OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getConversationListSplit(分页获取会话)
|
- ##### getConversationListSplit(分页获取会话)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -242,6 +258,8 @@ OpenIM.iMManager.conversationManager.getConversationListSplit(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getOneConversation(获取一个会话,如果不存在会自动创建)
|
- ##### getOneConversation(获取一个会话,如果不存在会自动创建)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -253,6 +271,8 @@ OpenIM.iMManager.conversationManager.getOneConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getMultipleConversation(根据会话id查询会话)
|
- ##### getMultipleConversation(根据会话id查询会话)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -263,6 +283,8 @@ OpenIM.iMManager.conversationManager.getOneConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### deleteConversation(根据会话id删除指定会话)
|
- ##### deleteConversation(根据会话id删除指定会话)
|
||||||
|
|
||||||
会触onTotalUnreadMessageCountChanged回调
|
会触onTotalUnreadMessageCountChanged回调
|
||||||
@@ -277,6 +299,8 @@ OpenIM.iMManager.conversationManager.deleteConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setConversationDraft(设置会话草稿)
|
- ##### setConversationDraft(设置会话草稿)
|
||||||
|
|
||||||
会触onConversationChanged回调
|
会触onConversationChanged回调
|
||||||
@@ -292,6 +316,8 @@ OpenIM.iMManager.conversationManager.setConversationDraft(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### pinConversation(置顶会话)
|
- ##### pinConversation(置顶会话)
|
||||||
|
|
||||||
会触onConversationChanged回调
|
会触onConversationChanged回调
|
||||||
@@ -307,6 +333,8 @@ OpenIM.iMManager.conversationManager.pinConversation(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### markGroupMessageHasRead(标记群会话已读,清除未读数)
|
- ##### markGroupMessageHasRead(标记群会话已读,清除未读数)
|
||||||
|
|
||||||
会触onConversationChanged、onTotalUnreadMessageCountChanged回调
|
会触onConversationChanged、onTotalUnreadMessageCountChanged回调
|
||||||
@@ -317,6 +345,8 @@ OpenIM.iMManager.conversationManager.markGroupMessageHasRead(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getTotalUnreadMsgCount(获取未读消息总数)
|
- ##### getTotalUnreadMsgCount(获取未读消息总数)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -325,6 +355,8 @@ OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount().then((count){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getConversationIDBySessionType(查询会话id)
|
- ##### getConversationIDBySessionType(查询会话id)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -336,6 +368,8 @@ OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount().then((count){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setConversationRecvMessageOpt(设置免打扰模式)
|
- ##### setConversationRecvMessageOpt(设置免打扰模式)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -349,6 +383,8 @@ OpenIM.iMManager.conversationManager.setConversationRecvMessageOpt(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getConversationRecvMessageOpt(查询免打扰状态)
|
- ##### getConversationRecvMessageOpt(查询免打扰状态)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -361,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查询好友资料)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -377,6 +481,8 @@ var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### addFriend(发起好友申请)
|
- ##### addFriend(发起好友申请)
|
||||||
|
|
||||||
主动申请者收到OnFriendApplicationAdded
|
主动申请者收到OnFriendApplicationAdded
|
||||||
@@ -394,6 +500,8 @@ var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### checkFriend(检查是否是好友)
|
- ##### checkFriend(检查是否是好友)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -404,6 +512,8 @@ OpenIM.iMManager.friendshipManager.checkFriend(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### deleteFriend(删除好友)
|
- ##### deleteFriend(删除好友)
|
||||||
|
|
||||||
操作者收到OnFriendDeleted
|
操作者收到OnFriendDeleted
|
||||||
@@ -418,6 +528,8 @@ OpenIM.iMManager.friendshipManager.deleteFriend(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setFriendRemark(好友备注设置)
|
- ##### setFriendRemark(好友备注设置)
|
||||||
|
|
||||||
操作者收到OnFriendInfoChanged
|
操作者收到OnFriendInfoChanged
|
||||||
@@ -433,6 +545,8 @@ OpenIM.iMManager.friendshipManager.deleteFriend(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getFriendList(好友列表)
|
- ##### getFriendList(好友列表)
|
||||||
|
|
||||||
返回的数据里包含已拉入黑名单的好友,可以根据isBlacklist字段筛选。
|
返回的数据里包含已拉入黑名单的好友,可以根据isBlacklist字段筛选。
|
||||||
@@ -443,6 +557,8 @@ OpenIM.iMManager.friendshipManager.getFriendList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getRecvFriendApplicationList(收到的好友申请)
|
- ##### getRecvFriendApplicationList(收到的好友申请)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -451,6 +567,8 @@ OpenIM.iMManager.friendshipManager.getFriendList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getSendFriendApplicationList(发出的好友申请)
|
- ##### getSendFriendApplicationList(发出的好友申请)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -459,6 +577,8 @@ OpenIM.iMManager.friendshipManager.getSendFriendApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### addBlacklist(拉黑好友)
|
- ##### addBlacklist(拉黑好友)
|
||||||
|
|
||||||
操作者收到OnBlackAdded
|
操作者收到OnBlackAdded
|
||||||
@@ -473,6 +593,8 @@ OpenIM.iMManager.friendshipManager.getSendFriendApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getBlacklist(黑名单)
|
- ##### getBlacklist(黑名单)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -481,6 +603,8 @@ OpenIM.iMManager.friendshipManager.getBlacklist().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### removeBlacklist(移除黑名单)
|
- ##### removeBlacklist(移除黑名单)
|
||||||
|
|
||||||
操作者收到OnBlackDeleted
|
操作者收到OnBlackDeleted
|
||||||
@@ -495,6 +619,8 @@ OpenIM.iMManager.friendshipManager.removeBlacklist(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### acceptFriendApplication(接受好友申请)
|
- ##### acceptFriendApplication(接受好友申请)
|
||||||
|
|
||||||
操作者收到OnFriendApplicationAccepted、OnFriendAdded
|
操作者收到OnFriendApplicationAccepted、OnFriendAdded
|
||||||
@@ -512,6 +638,8 @@ OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### refuseFriendApplication(拒绝好友申请)
|
- ##### refuseFriendApplication(拒绝好友申请)
|
||||||
|
|
||||||
操作者收到OnFriendApplicationRejected
|
操作者收到OnFriendApplicationRejected
|
||||||
@@ -529,6 +657,8 @@ OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### inviteUserToGroup(邀请进组)
|
- ##### inviteUserToGroup(邀请进组)
|
||||||
|
|
||||||
直接进组无需同意。
|
直接进组无需同意。
|
||||||
@@ -548,6 +678,8 @@ OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### kickGroupMember(移除组成员)
|
- ##### kickGroupMember(移除组成员)
|
||||||
|
|
||||||
被踢者收到OnJoinedGroupDeleted
|
被踢者收到OnJoinedGroupDeleted
|
||||||
@@ -564,6 +696,8 @@ OpenIM.iMManager.groupManager.kickGroupMember(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getGroupMembersInfo(查询组成员信息)
|
- ##### getGroupMembersInfo(查询组成员信息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -575,6 +709,8 @@ OpenIM.iMManager.groupManager.getGroupMembersInfo(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getGroupMemberList(组成员列表)
|
- ##### getGroupMemberList(组成员列表)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -588,6 +724,8 @@ OpenIM.iMManager.groupManager.getGroupMemberList(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getJoinedGroupList(获取已加入的群组)
|
- ##### getJoinedGroupList(获取已加入的群组)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -596,6 +734,8 @@ OpenIM.iMManager.groupManager.getJoinedGroupList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### isJoinedGroup(检查是否已入群)
|
- ##### isJoinedGroup(检查是否已入群)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -606,6 +746,8 @@ OpenIM.iMManager.groupManager.isJoinedGroup(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createGroup(创建组)
|
- ##### createGroup(创建组)
|
||||||
|
|
||||||
初始成员收到OnJoinedGroupAdded
|
初始成员收到OnJoinedGroupAdded
|
||||||
@@ -624,6 +766,8 @@ OpenIM.iMManager.groupManager.createGroup(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### setGroupInfo(修改组信息)
|
- ##### setGroupInfo(修改组信息)
|
||||||
|
|
||||||
群成员收到OnGroupInfoChanged
|
群成员收到OnGroupInfoChanged
|
||||||
@@ -639,6 +783,8 @@ OpenIM.iMManager.groupManager.setGroupInfo(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getGroupsInfo(根据id查询组信息)
|
- ##### getGroupsInfo(根据id查询组信息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -649,6 +795,8 @@ OpenIM.iMManager.groupManager.getGroupsInfo(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### joinGroup(申请入群组)
|
- ##### joinGroup(申请入群组)
|
||||||
|
|
||||||
需要通过管理员同意。
|
需要通过管理员同意。
|
||||||
@@ -664,6 +812,8 @@ OpenIM.iMManager.groupManager.joinGroup(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### quitGroup(退出组)
|
- ##### quitGroup(退出组)
|
||||||
|
|
||||||
退出者收到OnJoinedGroupDeleted
|
退出者收到OnJoinedGroupDeleted
|
||||||
@@ -680,6 +830,8 @@ OpenIM.iMManager.groupManager.quitGroup(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### transferGroupOwner(群转让)
|
- ##### transferGroupOwner(群转让)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -693,6 +845,8 @@ OpenIM.iMManager.groupManager.transferGroupOwner(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getRecvGroupApplicationList(收到的入群申请)
|
- ##### getRecvGroupApplicationList(收到的入群申请)
|
||||||
|
|
||||||
作为群主或者管理员,获取收到的群成员申请进群列表。
|
作为群主或者管理员,获取收到的群成员申请进群列表。
|
||||||
@@ -703,6 +857,8 @@ OpenIM.iMManager.groupManager.getRecvGroupApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getSendGroupApplicationList(发出的入群申请)
|
- ##### getSendGroupApplicationList(发出的入群申请)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -711,6 +867,8 @@ OpenIM.iMManager.groupManager.getSendGroupApplicationList().then((list){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### acceptGroupApplication(接受入群申请)
|
- ##### acceptGroupApplication(接受入群申请)
|
||||||
|
|
||||||
申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
|
申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
|
||||||
@@ -727,6 +885,8 @@ OpenIM.iMManager.groupManager.acceptGroupApplication(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### refuseGroupApplication(拒绝入群申请)
|
- ##### refuseGroupApplication(拒绝入群申请)
|
||||||
|
|
||||||
申请者收到OnGroupApplicationRejected
|
申请者收到OnGroupApplicationRejected
|
||||||
@@ -741,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(发送消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -756,6 +975,8 @@ OpenIM.iMManager.messageManager.sendMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### getHistoryMessageList(获取聊天记录)
|
- ##### getHistoryMessageList(获取聊天记录)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -773,6 +994,8 @@ OpenIM.iMManager.messageManager.getHistoryMessageList(
|
|||||||
|
|
||||||
下次就是list.first(index == 0),以此类推。
|
下次就是list.first(index == 0),以此类推。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### revokeMessage(撤回消息)
|
- ##### revokeMessage(撤回消息)
|
||||||
|
|
||||||
撤回成功需要当前用户从列表里移除Message然后更新ui,而另外一方通过撤回监听(onRecvMessageRevoked)移除。
|
撤回成功需要当前用户从列表里移除Message然后更新ui,而另外一方通过撤回监听(onRecvMessageRevoked)移除。
|
||||||
@@ -787,6 +1010,8 @@ OpenIM.iMManager.messageManager.revokeMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### deleteMessageFromLocalStorage(删除单条消息)
|
- ##### deleteMessageFromLocalStorage(删除单条消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -799,6 +1024,8 @@ OpenIM.iMManager.messageManager.deleteMessageFromLocalStorage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### insertSingleMessageToLocalStorage(向本地插入一条消息)
|
- ##### insertSingleMessageToLocalStorage(向本地插入一条消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -809,6 +1036,8 @@ OpenIM.iMManager.messageManager.insertSingleMessageToLocalStorage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### markC2CMessageAsRead(标记c2c消息已读)
|
- ##### markC2CMessageAsRead(标记c2c消息已读)
|
||||||
|
|
||||||
当调用此方法后,已读的消息会通过已读回执(onRecvC2CReadReceipt)告诉对方。
|
当调用此方法后,已读的消息会通过已读回执(onRecvC2CReadReceipt)告诉对方。
|
||||||
@@ -820,6 +1049,8 @@ OpenIM.iMManager.messageManager.markC2CMessageAsRead(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### typingStatusUpdate(正在输入提示)
|
- ##### typingStatusUpdate(正在输入提示)
|
||||||
|
|
||||||
会通过onRecvNewMessage回调
|
会通过onRecvNewMessage回调
|
||||||
@@ -831,6 +1062,8 @@ OpenIM.iMManager.messageManager.typingStatusUpdate(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### clearC2CHistoryMessage(清空c2c聊天记录)
|
- ##### clearC2CHistoryMessage(清空c2c聊天记录)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -843,6 +1076,8 @@ OpenIM.iMManager.messageManager.clearC2CHistoryMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### clearGroupHistoryMessage(清空群聊天记录)
|
- ##### clearGroupHistoryMessage(清空群聊天记录)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -855,6 +1090,8 @@ OpenIM.iMManager.messageManager.clearGroupHistoryMessage(
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createTextMessage(文本消息)
|
- ##### createTextMessage(文本消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -863,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(图片消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -882,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(图片消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -890,6 +1135,8 @@ var message = await OpenIM.iMManager.messageManager.createImageMessageFromFullPa
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createSoundMessage(语音消息,相对路径)
|
- ##### createSoundMessage(语音消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -899,6 +1146,8 @@ var message = await OpenIM.iMManager.messageManager.createSoundMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createSoundMessageFromFullPath(语音消息全路径)
|
- ##### createSoundMessageFromFullPath(语音消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -908,6 +1157,8 @@ var message = await OpenIM.iMManager.messageManager.createSoundMessageFromFullPa
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createVideoMessage(视频消息,相对路径)
|
- ##### createVideoMessage(视频消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -919,6 +1170,8 @@ var message = await OpenIM.iMManager.messageManager.createVideoMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createVideoMessageFromFullPath(视频消息全路径)
|
- ##### createVideoMessageFromFullPath(视频消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -930,6 +1183,8 @@ var message = await OpenIM.iMManager.messageManager.createVideoMessageFromFullPa
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createFileMessage(文件消息,相对路径)
|
- ##### createFileMessage(文件消息,相对路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -939,6 +1194,8 @@ var message = await OpenIM.iMManager.messageManager.createFileMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createFileMessageFromFullPath(文件消息全路径)
|
- ##### createFileMessageFromFullPath(文件消息全路径)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -948,6 +1205,8 @@ var message = await OpenIM.iMManager.messageManager.createFileMessageFromFullPat
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createForwardMessage(转发消息)
|
- ##### createForwardMessage(转发消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -956,6 +1215,8 @@ var message = await OpenIM.iMManager.messageManager.createForwardMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createMergerMessage(合并消息)
|
- ##### createMergerMessage(合并消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -966,6 +1227,8 @@ var message = await OpenIM.iMManager.messageManager.createMergerMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createLocationMessage(位置消息)
|
- ##### createLocationMessage(位置消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -976,6 +1239,8 @@ var message = await OpenIM.iMManager.messageManager.createLocationMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createCustomMessage(自定义消息)
|
- ##### createCustomMessage(自定义消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -986,6 +1251,8 @@ var message = await OpenIM.iMManager.messageManager.createCustomMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createQuoteMessage(引用消息/消息回复)
|
- ##### createQuoteMessage(引用消息/消息回复)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -995,6 +1262,8 @@ var message = await OpenIM.iMManager.messageManager.createQuoteMessage(
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- ##### createCardMessage(名片消息)
|
- ##### createCardMessage(名片消息)
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -1002,3 +1271,156 @@ 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
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,9 @@ version '1.0'
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
|
||||||
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()
|
||||||
@@ -22,13 +18,9 @@ buildscript {
|
|||||||
|
|
||||||
rootProject.allprojects {
|
rootProject.allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
|
||||||
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()
|
||||||
@@ -49,5 +41,5 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.openim:client-sdk:2.0.51@aar'
|
implementation 'io.openim:core-sdk:2.0.9.6@aar'
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,7 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager;
|
|||||||
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
||||||
import io.openim.flutter_openim_sdk.manager.IMManager;
|
import io.openim.flutter_openim_sdk.manager.IMManager;
|
||||||
import io.openim.flutter_openim_sdk.manager.MessageManager;
|
import io.openim.flutter_openim_sdk.manager.MessageManager;
|
||||||
|
import io.openim.flutter_openim_sdk.manager.OrganizationManager;
|
||||||
import io.openim.flutter_openim_sdk.manager.SignalingManager;
|
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;
|
import io.openim.flutter_openim_sdk.manager.WorkMomentsManager;
|
||||||
@@ -41,6 +42,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
|||||||
private static GroupManager groupManager;
|
private static GroupManager groupManager;
|
||||||
private static SignalingManager signalingManager;
|
private static SignalingManager signalingManager;
|
||||||
private static WorkMomentsManager workMomentsManager;
|
private static WorkMomentsManager workMomentsManager;
|
||||||
|
private static OrganizationManager organizationManager;
|
||||||
|
|
||||||
public FlutterOpenimSdkPlugin() {
|
public FlutterOpenimSdkPlugin() {
|
||||||
}
|
}
|
||||||
@@ -54,6 +56,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
|||||||
FlutterOpenimSdkPlugin.groupManager = new GroupManager();
|
FlutterOpenimSdkPlugin.groupManager = new GroupManager();
|
||||||
FlutterOpenimSdkPlugin.signalingManager = new SignalingManager();
|
FlutterOpenimSdkPlugin.signalingManager = new SignalingManager();
|
||||||
FlutterOpenimSdkPlugin.workMomentsManager = new WorkMomentsManager();
|
FlutterOpenimSdkPlugin.workMomentsManager = new WorkMomentsManager();
|
||||||
|
FlutterOpenimSdkPlugin.organizationManager = new OrganizationManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,4 +44,13 @@ public class IMManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void uploadImage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.uploadImage(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "path"),
|
||||||
|
value(methodCall, "token"),
|
||||||
|
value(methodCall, "obj")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,7 +68,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "2.0.0+6"
|
version: "2.0.9"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ public class IMMananger: BaseServiceManager {
|
|||||||
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
|
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func uploadImage(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkUploadImage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "path"], methodCall[string: "token"], methodCall[string: "obj"])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||||
|
|||||||
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
|||||||
let userManger: UserManager
|
let userManger: UserManager
|
||||||
let signalingManager: SignalingManager
|
let signalingManager: SignalingManager
|
||||||
let workMomentsManager: WorkMomentsManager
|
let workMomentsManager: WorkMomentsManager
|
||||||
|
let organizationManager: OrganizationManager
|
||||||
|
|
||||||
init(channel: FlutterMethodChannel) {
|
init(channel: FlutterMethodChannel) {
|
||||||
self.imManager = IMMananger(channel: channel)
|
self.imManager = IMMananger(channel: channel)
|
||||||
@@ -20,6 +21,7 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
|||||||
self.userManger = UserManager(channel: channel)
|
self.userManger = UserManager(channel: channel)
|
||||||
self.signalingManager = SignalingManager(channel: channel)
|
self.signalingManager = SignalingManager(channel: channel)
|
||||||
self.workMomentsManager = WorkMomentsManager(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) {
|
||||||
@@ -47,6 +49,8 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
|||||||
signalingManager.handleMethod(call: call, result: result)
|
signalingManager.handleMethod(call: call, result: result)
|
||||||
case "workMomentsManager":
|
case "workMomentsManager":
|
||||||
workMomentsManager.handleMethod(call: call, result: result)
|
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")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ A new Flutter project.
|
|||||||
s.dependency 'Flutter'
|
s.dependency 'Flutter'
|
||||||
s.platform = :ios, '8.0'
|
s.platform = :ios, '8.0'
|
||||||
|
|
||||||
s.dependency 'OpenIMSDKCore','2.0.8'
|
s.dependency 'OpenIMSDKCore','2.0.9'
|
||||||
s.static_framework = true
|
s.static_framework = true
|
||||||
# s.vendored_frameworks = 'Framework/*.framework'
|
# s.vendored_frameworks = 'Framework/*.framework'
|
||||||
# Flutter.framework does not contain a i386 slice.
|
# Flutter.framework does not contain a i386 slice.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export 'src/listener/conversation_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/msg_send_progress_listener.dart';
|
export 'src/listener/msg_send_progress_listener.dart';
|
||||||
|
export 'src/listener/organization_listener.dart';
|
||||||
export 'src/listener/signaling_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/listener/workmoments_listener.dart';
|
||||||
@@ -22,6 +23,7 @@ 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/manager/im_workmoments_manager.dart';
|
||||||
@@ -29,6 +31,7 @@ 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/notification_info.dart';
|
||||||
|
export 'src/models/organization_info.dart';
|
||||||
export 'src/models/search_info.dart';
|
export 'src/models/search_info.dart';
|
||||||
export 'src/models/signaling_info.dart';
|
export 'src/models/signaling_info.dart';
|
||||||
export 'src/models/user_info.dart';
|
export 'src/models/user_info.dart';
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ class ListenerType {
|
|||||||
static final signalingListener = 'signalingListener';
|
static final signalingListener = 'signalingListener';
|
||||||
static final msgSendProgressListener = "msgSendProgressListener";
|
static final msgSendProgressListener = "msgSendProgressListener";
|
||||||
static final workMomentsListener = "workMomentsListener";
|
static final workMomentsListener = "workMomentsListener";
|
||||||
|
static final organizationListener = "organizationListener";
|
||||||
}
|
}
|
||||||
|
|||||||
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class FriendshipManager {
|
|||||||
|
|
||||||
/// 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,
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -334,7 +356,9 @@ class GroupManager {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
/// Enable group mute
|
/// Enable group mute
|
||||||
/// 开启群禁言
|
/// 开启群禁言,所有群成员禁止发言
|
||||||
|
/// [groupID] 将开启群禁言的组ID
|
||||||
|
/// [mute] true:开启,false:关闭
|
||||||
Future<dynamic> changeGroupMute({
|
Future<dynamic> changeGroupMute({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required bool mute,
|
required bool mute,
|
||||||
@@ -350,6 +374,9 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Mute group members
|
/// Mute group members
|
||||||
/// 禁言群成员
|
/// 禁言群成员
|
||||||
|
/// [groupID] 群ID
|
||||||
|
/// [userID] 将被禁言的成员ID
|
||||||
|
/// [seconds] 被禁言的时间s,设置为0则为接触禁言
|
||||||
Future<dynamic> changeGroupMemberMute({
|
Future<dynamic> changeGroupMemberMute({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required String userID,
|
required String userID,
|
||||||
@@ -367,6 +394,9 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Set group user nickname
|
/// Set group user nickname
|
||||||
/// 设置群成员昵称
|
/// 设置群成员昵称
|
||||||
|
/// [groupID] 群ID
|
||||||
|
/// [userID] 群成员的用户ID
|
||||||
|
/// [groupNickname] 群昵称
|
||||||
Future<dynamic> setGroupMemberNickname({
|
Future<dynamic> setGroupMemberNickname({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required String userID,
|
required String userID,
|
||||||
|
|||||||
@@ -14,11 +14,14 @@ class IMManager {
|
|||||||
// late OfflinePushManager offlinePushManager;
|
// late OfflinePushManager offlinePushManager;
|
||||||
late SignalingManager signalingManager;
|
late SignalingManager signalingManager;
|
||||||
late WorkMomentsManager workMomentsManager;
|
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);
|
||||||
@@ -29,6 +32,7 @@ class IMManager {
|
|||||||
// offlinePushManager = OfflinePushManager(_channel);
|
// offlinePushManager = OfflinePushManager(_channel);
|
||||||
signalingManager = SignalingManager(_channel);
|
signalingManager = SignalingManager(_channel);
|
||||||
workMomentsManager = WorkMomentsManager(_channel);
|
workMomentsManager = WorkMomentsManager(_channel);
|
||||||
|
organizationManager = OrganizationManager(_channel);
|
||||||
_addNativeCallback(_channel);
|
_addNativeCallback(_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,6 +273,13 @@ class IMManager {
|
|||||||
workMomentsManager.listener.recvNewNotification();
|
workMomentsManager.listener.recvNewNotification();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (call.method == ListenerType.organizationListener) {
|
||||||
|
String type = call.arguments['type'];
|
||||||
|
switch (type) {
|
||||||
|
case 'onOrganizationUpdated':
|
||||||
|
organizationManager.listener.organizationUpdated();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
print(
|
print(
|
||||||
@@ -284,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
|
||||||
///
|
///
|
||||||
@@ -291,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,
|
||||||
@@ -301,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(
|
||||||
@@ -324,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,
|
||||||
@@ -339,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;
|
||||||
}
|
}
|
||||||
@@ -352,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,12 +388,33 @@ class IMManager {
|
|||||||
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
||||||
|
|
||||||
/// wakeup
|
/// wakeup
|
||||||
|
/// 从后台回到前台立刻唤醒
|
||||||
Future wakeUp({String? operationID}) => _channel.invokeMethod(
|
Future wakeUp({String? operationID}) => _channel.invokeMethod(
|
||||||
'wakeUp',
|
'wakeUp',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'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;
|
||||||
|
|||||||
@@ -54,10 +54,12 @@ 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
|
||||||
/// [conversationID] 会话id,查询通知是可用
|
/// [conversationID] 会话id,查询通知时可用
|
||||||
/// [groupID]接收消息的组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,
|
||||||
@@ -93,7 +95,7 @@ class MessageManager {
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
/// Delete message
|
/// Delete message
|
||||||
/// 删除消息
|
/// 删除本地消息
|
||||||
Future deleteMessageFromLocalStorage({
|
Future deleteMessageFromLocalStorage({
|
||||||
required Message message,
|
required Message message,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -110,45 +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
|
||||||
|
.invokeMethod(
|
||||||
'insertSingleMessageToLocalStorage',
|
'insertSingleMessageToLocalStorage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"message": message?.toJson(),
|
"message": message?.toJson(),
|
||||||
"receiverID": receiverID,
|
"receiverID": receiverID,
|
||||||
"senderID": senderID,
|
"senderID": senderID,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}));
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
///
|
/// 插入群聊消息到本地
|
||||||
Future insertGroupMessageToLocalStorage({
|
Future<Message> insertGroupMessageToLocalStorage({
|
||||||
String? groupID,
|
String? groupID,
|
||||||
String? senderID,
|
String? senderID,
|
||||||
Message? message,
|
Message? message,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
'insertGroupMessageToLocalStorage',
|
'insertGroupMessageToLocalStorage',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"message": message?.toJson(),
|
"message": message?.toJson(),
|
||||||
"groupID": groupID,
|
"groupID": groupID,
|
||||||
"senderID": senderID,
|
"senderID": senderID,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"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}) =>
|
|
||||||
// _channel.invokeMethod(
|
|
||||||
// 'findMessages',
|
|
||||||
// _buildParam({
|
|
||||||
// "messageIDList": messageIDList,
|
|
||||||
// }));
|
|
||||||
|
|
||||||
/// Mark c2c message as read
|
/// Mark c2c message as read
|
||||||
/// 标记c2c消息已读
|
/// 标记c2c消息已读
|
||||||
@@ -182,6 +180,7 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Typing
|
/// Typing
|
||||||
/// 正在输入提示
|
/// 正在输入提示
|
||||||
|
/// [msgTip] 自定义内容
|
||||||
Future typingStatusUpdate({
|
Future typingStatusUpdate({
|
||||||
required String userID,
|
required String userID,
|
||||||
String? msgTip,
|
String? msgTip,
|
||||||
@@ -212,6 +211,10 @@ 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> atUserIDList,
|
required List<String> atUserIDList,
|
||||||
@@ -250,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,
|
||||||
@@ -284,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,
|
||||||
@@ -323,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,
|
||||||
@@ -362,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,
|
||||||
@@ -379,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,
|
||||||
@@ -398,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,
|
||||||
@@ -414,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,
|
||||||
@@ -452,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,
|
||||||
@@ -483,9 +504,11 @@ class MessageManager {
|
|||||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
/// Create custom emoji message
|
/// Create custom emoji message
|
||||||
|
/// [index] The position of the emoji, such as the position emoji
|
||||||
|
/// [data] Other data, such as url expressions
|
||||||
/// 创建自定义表情消息
|
/// 创建自定义表情消息
|
||||||
/// [index] The position of the emoji, such as the position emoji(表情的位置,如位置表情)
|
/// [index] 位置表情,根据index匹配
|
||||||
/// [data] Other data, such as url expressions(其他数据,如url表情)
|
/// [data] url表情,直接使用url显示
|
||||||
Future<Message> createFaceMessage({
|
Future<Message> createFaceMessage({
|
||||||
int index = -1,
|
int index = -1,
|
||||||
String? data,
|
String? data,
|
||||||
@@ -571,7 +594,7 @@ class MessageManager {
|
|||||||
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||||
|
|
||||||
/// Delete message from local and service
|
/// Delete message from local and service
|
||||||
/// 删除消息
|
/// 删除本地跟服务器的指定的消息
|
||||||
Future<dynamic> deleteMessageFromLocalAndSvr({
|
Future<dynamic> deleteMessageFromLocalAndSvr({
|
||||||
required Message message,
|
required Message message,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -584,7 +607,7 @@ class MessageManager {
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
/// Delete all message from local
|
/// Delete all message from local
|
||||||
/// 删除所有消息
|
/// 删除本地所有聊天记录
|
||||||
Future<dynamic> deleteAllMsgFromLocal({
|
Future<dynamic> deleteAllMsgFromLocal({
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
@@ -595,7 +618,7 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
/// Delete all message from service
|
/// Delete all message from service
|
||||||
/// 删除所有消息
|
/// 删除本地跟服务器所有聊天记录
|
||||||
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
@@ -607,6 +630,8 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Mark conversation message as read
|
/// Mark conversation message as read
|
||||||
/// 标记消息已读
|
/// 标记消息已读
|
||||||
|
/// [conversationID] 会话ID
|
||||||
|
/// [messageIDList] 被标记的消息clientMsgID
|
||||||
Future markMessageAsReadByConID({
|
Future markMessageAsReadByConID({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
required List<String> messageIDList,
|
required List<String> messageIDList,
|
||||||
@@ -621,7 +646,7 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
/// Clear all c2c history message
|
/// Clear all c2c history message
|
||||||
/// 清空单聊消息记录
|
/// 删除本地跟服务器的单聊聊天记录
|
||||||
Future<dynamic> clearC2CHistoryMessageFromLocalAndSvr({
|
Future<dynamic> clearC2CHistoryMessageFromLocalAndSvr({
|
||||||
required String uid,
|
required String uid,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -634,7 +659,7 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
/// Clear all group history
|
/// Clear all group history
|
||||||
/// 清空组消息记录
|
/// 删除本地跟服务器的群聊天记录
|
||||||
Future<dynamic> clearGroupHistoryMessageFromLocalAndSvr({
|
Future<dynamic> clearGroupHistoryMessageFromLocalAndSvr({
|
||||||
required String gid,
|
required String gid,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@@ -647,10 +672,12 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
/// Find all history message
|
/// Find all history message
|
||||||
/// 获取聊天记录
|
/// 获取聊天记录(以startMsg为节点,新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
|
||||||
/// [userID]接收消息的用户id
|
/// [userID] 接收消息的用户id
|
||||||
/// [conversationID] 会话id
|
/// [conversationID] 会话id,查询通知时可用
|
||||||
/// [groupID]接收消息的组id
|
/// [groupID] 接收消息的组id
|
||||||
|
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.last
|
||||||
|
/// [count] 一次拉取的总数
|
||||||
Future<List<Message>> getHistoryMessageListReverse({
|
Future<List<Message>> getHistoryMessageListReverse({
|
||||||
String? userID,
|
String? userID,
|
||||||
String? groupID,
|
String? groupID,
|
||||||
|
|||||||
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -608,11 +608,13 @@ class AttachedInfoElem {
|
|||||||
/// 单聊有效
|
/// 单聊有效
|
||||||
bool? isPrivateChat;
|
bool? isPrivateChat;
|
||||||
int? hasReadTime;
|
int? hasReadTime;
|
||||||
|
bool? notSenderNotificationPush;
|
||||||
|
|
||||||
AttachedInfoElem({
|
AttachedInfoElem({
|
||||||
this.groupHasReadInfo,
|
this.groupHasReadInfo,
|
||||||
this.isPrivateChat,
|
this.isPrivateChat,
|
||||||
this.hasReadTime,
|
this.hasReadTime,
|
||||||
|
this.notSenderNotificationPush,
|
||||||
});
|
});
|
||||||
|
|
||||||
AttachedInfoElem.fromJson(Map<String, dynamic> json) {
|
AttachedInfoElem.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -621,6 +623,7 @@ class AttachedInfoElem {
|
|||||||
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
|
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
|
||||||
isPrivateChat = json['isPrivateChat'];
|
isPrivateChat = json['isPrivateChat'];
|
||||||
hasReadTime = json['hasReadTime'];
|
hasReadTime = json['hasReadTime'];
|
||||||
|
notSenderNotificationPush = json['notSenderNotificationPush'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@@ -628,6 +631,7 @@ class AttachedInfoElem {
|
|||||||
data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson();
|
data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson();
|
||||||
data['isPrivateChat'] = this.isPrivateChat;
|
data['isPrivateChat'] = this.isPrivateChat;
|
||||||
data['hasReadTime'] = this.hasReadTime;
|
data['hasReadTime'] = this.hasReadTime;
|
||||||
|
data['notSenderNotificationPush'] = this.notSenderNotificationPush;
|
||||||
return data;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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+6
|
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