Compare commits

..

117 Commits

Author SHA1 Message Date
hrxiang
377b07ef05 Fix bug 2023-02-20 09:33:08 +08:00
hrxiang
025487fbf3 Fix bug 2023-02-09 14:31:25 +08:00
hrxiang
ba3767da42 Fix bug 2023-02-08 09:53:39 +08:00
hrxiang
fc6fd3dd93 Fix bug 2023-02-08 09:45:53 +08:00
hrxiang
c6d9815e64 Fix bug 2023-01-18 10:48:52 +08:00
hrxiang
8e0c736d29 Merge pull request #105 from johnzerTang/main
feat:补充conversation_info的遗漏
2023-01-16 09:35:35 +08:00
johnzer
15854a2c27 feat:补充conversation_info的遗漏 2023-01-09 16:27:48 +08:00
hrxiang
3e1ee249c9 Fix bug 2023-01-03 16:25:08 +08:00
hrxiang
29eac1bf91 Fix bug 2022-12-30 18:58:57 +08:00
skiffer-git
bea820ff27 Update README.md 2022-12-14 10:36:02 +08:00
hrxiang
a85062ce79 Fix bug 2022-12-12 10:51:20 +08:00
hrxiang
98b2774dc1 Fix bug 2022-12-09 16:45:25 +08:00
hrxiang
e823df62a8 Fix bug 2022-12-09 15:08:27 +08:00
hrxiang
2c40b626e4 Fix bug 2022-12-09 11:25:44 +08:00
hrxiang
3b5f47c9f0 V2.3.5 2022-12-08 12:05:21 +08:00
hrxiang
4c540fbff5 Update 2022-12-02 10:50:48 +08:00
hrxiang
b8a51374a3 Update 2022-11-25 17:03:50 +08:00
hrxiang
099cb9849a Merge branch 'main' of https://github.com/OpenIMSDK/Open-IM-SDK-Flutter 2022-11-16 16:46:35 +08:00
hrxiang
025334d32f Fix bug 2022-11-16 16:45:12 +08:00
hrxiang
5adc50b963 Merge pull request #102 from yohom/main
fix: 所有的设置Listener方法都调用result.success(null), 否则dart端的Future会一直挂起不返回.
2022-11-16 16:42:41 +08:00
yohom
ebbe5c882f fix: 所有的设置Listener方法都调用result.success(null), 否则dart端的Future会一直挂起不返回. 2022-11-16 16:28:48 +08:00
hrxiang
eb3361c4b3 Fix bug 2022-11-14 14:28:33 +08:00
hrxiang
9c5aa56609 Fix bug 2022-11-11 14:22:17 +08:00
hrxiang
3e03460300 Fix bug 2022-11-08 12:04:09 +08:00
hrxiang
788ab524c2 Fix bug 2022-11-08 11:22:44 +08:00
hrxiang
eed59f468c Fix bug 2022-11-07 10:32:05 +08:00
hrxiang
d758f3fca1 Fix bug 2022-10-31 10:27:54 +08:00
hrxiang
b8ee9276a2 Add some new function 2022-10-25 11:45:30 +08:00
hrxiang
a77c86e87a Fix bug 2022-10-09 13:55:47 +08:00
hrxiang
c99d1e4d67 Fix bug 2022-10-09 13:54:26 +08:00
hrxiang
b53d4dfcfd Fix bug 2022-10-08 18:53:29 +08:00
hrxiang
bb49d6b27a Core sdk upgrade to 2.3.4 2022-09-30 17:29:22 +08:00
hrxiang
2b78f83b20 Core sdk upgrade to 2.3.4 2022-09-30 17:28:30 +08:00
hrxiang
38a899d32c Core sdk upgrade to 2.3.3 2022-09-20 11:04:58 +08:00
hrxiang
0a0635bb71 2.3.2 2022-09-16 09:37:21 +08:00
xianghr
c44575ec0e Merge branch 'main' of https://github.com/OpenIMSDK/Open-IM-SDK-Flutter 2022-09-09 18:46:27 +08:00
std-s
14624c717b [Update] 2022-09-09 18:44:28 +08:00
xianghr
0900df2aa2 3.2.2 2022-09-09 18:31:06 +08:00
xianghr
cd06c3bb5a 3.2.2 2022-09-09 17:17:31 +08:00
hrxiang
a6aea5496a [Super Group]2.3.0 2022-08-24 11:46:15 +08:00
hrxiang
72111053bd [Super Group]2.3.0 2022-08-03 17:30:40 +08:00
hrxiang
18f099c437 [Super Group] 2022-07-22 12:12:55 +08:00
hrxiang
cff0a4cce2 [Super Group] 2022-07-18 10:13:04 +08:00
hrxiang
e415961d64 [Super Group] 2022-07-15 18:35:48 +08:00
hrxiang
b3aebeb318 [Super Group] 2022-07-15 18:34:21 +08:00
hrxiang
c76bfeb07a [Super Group] 2022-07-15 18:19:17 +08:00
hrxiang
a9343bf892 update 2022-07-05 10:25:59 +08:00
hrxiang
bf354c4103 update 2022-07-04 11:56:02 +08:00
hrxiang
644c52ae0e update 2022-07-01 10:30:42 +08:00
hrxiang
80048bcd18 update 2022-06-30 11:31:21 +08:00
hrxiang
cc6c1bdc22 update 2022-06-30 09:56:32 +08:00
hrxiang
7233b2e298 update 2022-06-29 16:40:22 +08:00
hrxiang
cd61ebba7f update 2022-06-28 09:53:54 +08:00
hrxiang
3a294dd856 update 2022-06-28 09:50:04 +08:00
hrxiang
45e0c82ea3 update 2022-06-27 18:25:55 +08:00
hrxiang
2de606d13e update 2022-06-27 18:23:33 +08:00
hrxiang
7a68e13398 update 2022-06-27 18:20:00 +08:00
hrxiang
4132338633 update 2022-06-27 18:01:31 +08:00
hrxiang
485bf58f14 Merge branch 'main' of https://github.com/OpenIMSDK/Open-IM-SDK-Flutter 2022-06-27 17:55:24 +08:00
hrxiang
6ad47216fb update 2022-06-27 17:55:18 +08:00
hrxiang
3c62315cfd Update README.zh-cn.md 2022-06-27 17:54:46 +08:00
hrxiang
7247f6b982 update 2022-06-27 17:40:04 +08:00
hrxiang
6a771f8035 update 2022-06-24 15:28:47 +08:00
hrxiang
4726055b6f update 2022-06-24 15:22:44 +08:00
hrxiang
2a9d4a0587 update 2022-06-24 11:05:29 +08:00
hrxiang
cce41e0991 update 2022-06-21 18:40:28 +08:00
hrxiang
599c25b099 update 2022-06-21 14:27:38 +08:00
hrxiang
6c3311cce1 update 2022-06-20 14:25:15 +08:00
hrxiang
9a359ca9a0 update 2022-06-17 10:00:03 +08:00
hrxiang
cc2211c36d update 2022-06-16 19:31:21 +08:00
hrxiang
ccf4d4fec1 update 2022-06-16 19:30:22 +08:00
hrxiang
0b8762a754 update 2022-06-16 19:28:54 +08:00
std-s
28a911022c Update build.gradle 2022-06-16 18:43:29 +08:00
std-s
996281e49a Update build.gradle 2022-06-16 15:43:06 +08:00
hrxiang
e2b546f400 update 2022-06-16 12:18:15 +08:00
hrxiang
8abc8e4399 1.Fix bug </br>
2.New searchOrganization method</br>
3.New searchFriends method</br>
4.New getDepartmentInfo method</br>
5.New setGroupMemberRoleLevel method</br>
2022-06-14 17:42:15 +08:00
hrxiang
ed20b4915a 1.Fix bug </br>
2.New searchOrganization method</br>
3.New searchFriends method</br>
4.New getDepartmentInfo method</br>
5.New setGroupMemberRoleLevel method</br>
2022-06-14 17:40:26 +08:00
hrxiang
8b1f4dc320 Fix bug 2022-06-06 17:22:23 +08:00
hrxiang
f7416290fb Upgrade 2022-06-06 09:27:53 +08:00
hrxiang
f0b28099bf Upgrade 2022-05-25 17:03:53 +08:00
hrxiang
d5d11af7ce Upgrade 2022-05-25 16:21:43 +08:00
hrxiang
9cd717c67c Upgrade 2022-05-25 15:18:22 +08:00
hrxiang
c7218cb94c Upgrade 2022-05-20 10:27:18 +08:00
hrxiang
e4c78e0106 Upgrade 2022-05-19 16:00:10 +08:00
hrxiang
7457f182f3 Upgrade 2022-05-18 16:47:14 +08:00
hrxiang
952cb82417 Upgrade 2022-05-11 17:30:11 +08:00
std-s
3cb2c6d514 [Fix] object is NSNull. 2022-05-10 15:02:18 +08:00
hrxiang
90be2f74ac Upgrade 2022-05-10 10:37:12 +08:00
hrxiang
53ef6c2173 Upgrade 2022-05-10 10:33:39 +08:00
hrxiang
373171aded Fix bug 2022-05-10 10:13:14 +08:00
hrxiang
58702fcbaf Upgrade 2022-05-10 09:56:59 +08:00
hrxiang
8b8c9d5923 Upgrade 2022-04-29 14:14:08 +08:00
hrxiang
d5e3947878 Upgrade 2022-04-28 16:28:13 +08:00
hrxiang
6edf9b74fa Upgrade 2022-04-24 12:12:26 +08:00
hrxiang
fcc8373560 Upgrade 2022-04-08 16:29:08 +08:00
hrxiang
7e8d72929a Upgrade 2022-04-08 14:36:47 +08:00
hrxiang
03fa70c585 Upgrade 2022-04-08 10:55:15 +08:00
hrxiang
8b4a35e6b7 Upgrade 2022-04-07 12:22:38 +08:00
hrxiang
71897bcb4e Upgrade 2022-04-01 18:25:52 +08:00
hrxiang
57340e52a7 New some function 2022-03-31 11:13:36 +08:00
hrxiang
197f0b482f New some function 2022-03-31 11:08:11 +08:00
hrxiang
e009224256 Fix bug 2022-03-30 09:23:41 +08:00
hrxiang
ad0563aee4 Fix bug 2022-03-25 16:39:19 +08:00
hrxiang
d120312ac9 Fix bug 2022-03-25 16:34:06 +08:00
hrxiang
d64b426c90 Fix bug 2022-03-25 16:14:30 +08:00
hrxiang
3a845dc40b Pre publish 2.0.0+4 2022-03-25 15:15:27 +08:00
hrxiang
700265c685 Fix bug 2022-03-21 18:42:29 +08:00
hrxiang
73b9eb776f New add some fuc 2022-03-21 17:17:41 +08:00
hrxiang
372e573ea0 Fix bug 2022-03-18 19:11:30 +08:00
hrxiang
8ea08f9ce6 New add fuc 2022-03-18 18:39:34 +08:00
hrxiang
40b65f52a5 Add signaling function 2022-03-15 16:40:42 +08:00
hrxiang
6c0676fbe5 Add custom emoji message 2022-03-10 17:53:01 +08:00
hrxiang
80152e2314 Fix some one crash 2022-03-04 17:37:27 +08:00
hrxiang
2381d26729 Fix some one crash 2022-03-04 17:36:16 +08:00
hrxiang
b25f0d8547 Update ios framework 2022-03-03 11:47:59 +08:00
hrxiang
f4e7eaf50e Update README.md 2022-03-03 11:42:38 +08:00
hrxiang
f40d4148a8 Update README.md 2022-02-28 14:05:37 +08:00
98 changed files with 10120 additions and 2544 deletions

View File

@@ -15,6 +15,21 @@
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/ios/.symlinks/plugins/flutter_openim_sdk/example/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@@ -20,7 +20,6 @@
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/typed_data" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_gl" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_sql" />
</CLASSES>
<JAVADOC />
<SOURCES />

1
.idea/misc.xml generated
View File

@@ -3,4 +3,5 @@
<component name="FrameworkDetectionExcludesConfiguration">
<type id="android" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 25 Platform" project-jdk-type="Android SDK" />
</project>

1
.idea/modules.xml generated
View File

@@ -3,6 +3,7 @@
<component name="ProjectModuleManager">
<modules>
<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>
</component>
</project>

View File

@@ -1,3 +1,217 @@
## 2.3.5+2
- Add onRecvMessageExtensionsAdded method for OnAdvancedMsgListener
- Add addMessageReactionExtensions method for MessageManager
- Add getMessageListSomeReactionExtensions method for MessageManager
- Add isExternal field for MessageManager
- Add isReact method field MessageManager
- Add params isExternalExtensions for initSDK
## 2.3.5+1
- Add birthTime for UserInfo
- Add setMessageKvInfoListener method for MessageManager
- Add setMessageReactionExtensions method for MessageManager
- Add deleteMessageReactionExtensions method for MessageManager
- Add getMessageListReactionExtensions method for MessageManager
- Add onRecvMessageExtensionsChanged method for OnAdvancedMsgListener
- Add onRecvMessageExtensionsDeleted method for OnAdvancedMsgListener
- Add OnMessageKvInfoListener listener
- Add class KeyValue
- Add class UserExInfo
- Add class SingleTypeKeyInfoSum
- Add class MessageKv
- Add class TypeKeySetResult
- Add class MessageTypeKeyMapping
## 2.3.5
- Add setCustomBusinessListener method for MessageManager
- Add OnCustomBusinessListener listener
- Add message encryption config
- Add message compression config
- Add setGroupMemberInfo for GroupManager
## 2.3.4+6
- Add setAppBackgroundStatus method for IMManager
## 2.3.4+5
- Fix bug
- Add setOneConversationBurnDuration method for ConversationManager
- Add signalingSendCustomSignal method for SignalingManager
- Add onReceiveCustomSignal listener for OnSignalingListener
- Add burnDuration field for ConversationInfo
- Add burnDuration field for AttachedInfoElem
## 2.3.4+4
- Fix bug
- Replace maven repository address
## 2.3.4+3
- Fix bug
## 2.3.4+2
- Add streamChangedEvent listener for OnSignalingListener
- Add signalingJoinMeeting method for SignalingManager
- Add signalingCreateMeeting method for SignalingManager
- Add signalingOperateStream method for SignalingManager
- Add signalingGetMeetings method for SignalingManager
- Add signalingCloseRoom method for SignalingManager
- Add signalingUpdateMeetingInfo method for SignalingManager
- Update findMessageList method
- Add sendMessageNotOss method for MessageManager
- Add createImageMessageByURL method for MessageManager
- Add createSoundMessageByURL method for MessageManager
- Add createVideoMessageByURL method for MessageManager
- Add createFileMessageByURL method for MessageManager
## 2.3.4+1
- Add signalingGetTokenByRoomID method for SignalingManager
## 2.3.4
- Fix bug
- Add signalGetRoomByGroupID method for SignalingManager
- Add class RoomCallingInfo
- Add onRoomParticipantConnected listener for OnSignalingListener
- Add onRoomParticipantDisconnected listener for OnSignalingListener
- Add busyLineUserIDList field for SignalingCertificate
## 2.3.3
- Fix bug
## 2.3.2
- Fix bug
- Add createAdvancedQuoteMessage method for MessageManager
- Add createAdvancedTextMessage method for MessageManager
## 2.3.0+1
- Fix bug
- enum class MessageType new add customMsgNotTriggerConversation
- enum class MessageType new add customMsgOnlineOnly
- class IMManager new add updateFcmToken method
- class MessageManager new add findMessageList method
- initSDK method add encryptionKey param
## 2.3.0
- Fix bug
- Super group
- Add setGroupLookMemberInfo method for GroupManager
- Add setGroupApplyMemberFriend method for GroupManager
- Add getGroupOwnerAndAdmin method for GroupManager
- Add revokeMessageV2 method for MessageManager
- Add lookMemberInfo field for GroupInfo
- Add applyMemberFriend field for GroupInfo
- Add notificationUpdateTime field for GroupInfo
- Add notificationUserID field for GroupInfo
- Add inviterUserID field for GroupMembersInfo
- Add joinSource field for joinGroup method
- Add advanced revoke type
- Add recvMessageRevokedV2 callback for OnAdvancedMsgListener
- Add joinSource field for GroupApplicationInfo
- Add inviterUserID field for GroupApplicationInfo
- Add getAdvancedHistoryMessageList method for MessageManager
- Add searchGroupMembers method for GroupManager
## 2.2.0
1.Fix bug </br>
## 2.1.0+1
1.Add setGroupVerification method </br>
## 2.1.0
1.Fix bug </br>
2.Add getGroupMemberListByJoinTime method </br>
3.Add groupMemberCount field </br>
## 2.0.9+3
1.Fix bug </br>
2.Add setGlobalRecvMessageOpt method </br>
## 2.0.9+2
1.Fix bug </br>
2.Add searchOrganization method </br>
3.Add searchFriends method </br>
4.Add getDepartmentInfo method </br>
5.Add setGroupMemberRoleLevel method </br>
## 2.0.9+1
1.Fix bug </br>
## 2.0.9
1.Fix bug </br>
2.Add organization fuction </br>
3.Add 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.Add modify group nickname </br>
4.Update at message </br>
5.ConverstaionInfo new add isNotInGroup field</br>
6.Add at type </br>
7.Add work moments </br>
8.Add global search </br>
9.Add getHistoryMessageListReverse method </br>
10.Add getAtAllTag method </br>
11.Add resetConversationGroupAtType method </br>
12.Add searchGroups method </br>
## 2.0.0+5
1.Add notification parse </br>
2.Add deleteConversationFromLocalAndSvr method </br>
3.Add deleteMessageFromLocalAndSvr method </br>
4.Add deleteAllMsgFromLocal method </br>
5.Add deleteAllMsgFromLocalAndSvr method </br>
6.Add clearC2CHistoryMessageFromLocalAndSvr method </br>
7.Add clearGroupHistoryMessageFromLocalAndSvr method </br>
8.Add markMessageAsReadByConID method </br>
9.Add wakeUp method </br>
10.Add deleteAllConversationFromLocal method </br>
## 2.0.0+4
1.Add dismiss group </br>
2.Add search local message </br>
3.Add private chat </br>
4.Add group mute
## 2.0.0+3
1.Fix bug </br>
## 2.0.0+2
1.Fix some one crash </br>
2.Add signaling function </br>
3.Add group have read receipt
## 2.0.0+1
1.Fix multi-terminal synchronization bug fix for retracted messages </br>
@@ -23,13 +237,13 @@
## 1.0.8
1.Upgrade sdk to 1.4.4. </br>
2.New and changed conversation return changed data and no longer return all data. </br>
3.New conversation paging method.
2.Add changed conversation return changed data and no longer return all data. </br>
3.Add conversation paging method.
## 1.0.7
Upgrade sdk to 1.3.4 </br>
New add method setConversationRecvMessageOpt and getConversationRecvMessageOpt
Add method setConversationRecvMessageOpt and getConversationRecvMessageOpt
## 1.0.6
@@ -67,36 +281,45 @@ Fix bug
## 0.0.9+5
1. Android upgrade sdk to 0.0.17 </br>
2. New add createFileMessageFromFullPath method
2. Add createFileMessageFromFullPath method
## 0.0.9+4
Fix ios friendship params error
## 0.0.9+3
Ios native remove method 'removeAdvancedMsgListener'
## 0.0.9+2
1. Fix bug
2. Upgrade sdk
## 0.0.9+1
Fix bug
## 0.0.9
Add ios support
## 0.0.8
Upgrade sdk to 0.0.14 </br>
Sending a message adds a retry mechanism
## 0.0.7
1. Add a new method to obtain conversation id based on user id or group id </br>
2. Modify the type of conversation manager input parameter sessionType to int
## 0.0.6
Fix bug
## 0.0.5
Upgrade sdk </br>
Fix message error bug
@@ -105,11 +328,14 @@ Fix message error bug
Replace the input parameters of the createCustomMessage method from Uint8List to Map
## 0.0.3
Upgrade sdk </br>
Fix bug </br>
## 0.0.2
1. Move the markSingleMessageHasRead, markGroupMessageHasRead and getTotalUnreadMsgCount methods from the MessageManager class to the ConversationManager class. </br>
1. Move the markSingleMessageHasRead, markGroupMessageHasRead and getTotalUnreadMsgCount methods
from the MessageManager class to the ConversationManager class. </br>
2. Modify the parameters of the setFriendInfo method. </br>
3. Modify the parameters of the createGroup and setGroupInfo methods.

1785
README.md

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,10 +3,6 @@ version '1.0'
buildscript {
repositories {
maven {
allowInsecureProtocol = true
url 'http://121.37.25.71:8081/repository/maven-releases/'
}
google()
mavenCentral()
}
@@ -18,10 +14,7 @@ buildscript {
rootProject.allprojects {
repositories {
maven {
allowInsecureProtocol = true
url 'http://121.37.25.71:8081/repository/maven-releases/'
}
maven { url 'https://open-im-online.rentsoft.cn:51000/repository/maven2/' }
google()
mavenCentral()
}
@@ -41,5 +34,5 @@ android {
}
}
dependencies {
implementation 'io.openim:client-sdk:2.0.4@aar'
api 'io.openim:core-sdk:2.3.5-t19@aar'
}

View File

@@ -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.IMManager;
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.WorkMomentsManager;
/**
@@ -37,6 +40,9 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
private static MessageManager messageManager;
private static ConversationManager conversationManager;
private static GroupManager groupManager;
private static SignalingManager signalingManager;
private static WorkMomentsManager workMomentsManager;
private static OrganizationManager organizationManager;
public FlutterOpenimSdkPlugin() {
}
@@ -48,6 +54,9 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
FlutterOpenimSdkPlugin.messageManager = new MessageManager();
FlutterOpenimSdkPlugin.conversationManager = new ConversationManager();
FlutterOpenimSdkPlugin.groupManager = new GroupManager();
FlutterOpenimSdkPlugin.signalingManager = new SignalingManager();
FlutterOpenimSdkPlugin.workMomentsManager = new WorkMomentsManager();
FlutterOpenimSdkPlugin.organizationManager = new OrganizationManager();
}
@Override

View File

@@ -13,14 +13,57 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
this.id = listenerId;
}
@Override
public void onNewRecvMessageRevoked(String s) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("revokedMessageV2", s);
CommonUtil.emitEvent("advancedMsgListener", "onNewRecvMessageRevoked", values);
}
@Override
public void onRecvC2CReadReceipt(String s) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("haveReadMessage", s);
values.put("c2cMessageReadReceipt", s);
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
public void onRecvMessageExtensionsAdded(String s, String s1) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("msgID", s);
values.put("list", s1);
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsAdded", values);
}
@Override
public void onRecvMessageExtensionsChanged(String s, String s1) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("msgID", s);
values.put("list", s1);
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsChanged", values);
}
@Override
public void onRecvMessageExtensionsDeleted(String s, String s1) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("msgID", s);
values.put("list", s1);
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsDeleted", values);
}
@Override
public void onRecvMessageRevoked(String s) {
final Map<String, String> values = new ArrayMap<>();

View File

@@ -1,6 +1,8 @@
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.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk_callback.Base;
@@ -8,18 +10,22 @@ import open_im_sdk_callback.Base;
public class OnBaseListener implements Base {
MethodChannel.Result result;
MethodCall call;
public OnBaseListener(MethodChannel.Result result) {
public OnBaseListener(MethodChannel.Result result, MethodCall call) {
this.result = result;
this.call = call;
}
@Override
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);
}
@Override
public void onSuccess(String s) {
Log.i("F-OpenIMSDK(flutter call native)", "method: 【 " + call.method + " 】, onSuccess: " + s);
CommonUtil.runMainThreadReturn(result, s);
}
}

View File

@@ -0,0 +1,10 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnCustomBusinessListener implements open_im_sdk_callback.OnCustomBusinessListener {
@Override
public void onRecvCustomBusinessMessage(String s) {
CommonUtil.emitEvent("customBusinessListener", "onRecvCustomBusinessMessage", s);
}
}

View File

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

View File

@@ -0,0 +1,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);
}
}

View File

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

View File

@@ -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);
}
}

View File

@@ -18,7 +18,10 @@ class BaseManager {
}
static Long int2long(MethodCall methodCall, String key) {
Integer i = value(methodCall, key);
return Long.valueOf(i);
Object i = value(methodCall, key);
if (i instanceof Long) {
return (Long) i;
}
return Long.valueOf((Integer) i);
}
}

View File

@@ -11,19 +11,21 @@ public class ConversationManager extends BaseManager {
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationListener(new OnConversationListener());
result.success(null);
}
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getAllConversationList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getConversationListSplit(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
int2long(methodCall, "offset"),
int2long(methodCall, "count")
@@ -32,7 +34,7 @@ public class ConversationManager extends BaseManager {
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getOneConversation(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
int2long(methodCall, "sessionType"),
value(methodCall, "sourceID")
@@ -41,7 +43,7 @@ public class ConversationManager extends BaseManager {
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMultipleConversation(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList")
);
@@ -49,7 +51,7 @@ public class ConversationManager extends BaseManager {
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteConversation(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID")
);
@@ -57,7 +59,7 @@ public class ConversationManager extends BaseManager {
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationDraft(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "draftText")
@@ -66,7 +68,7 @@ public class ConversationManager extends BaseManager {
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.pinConversation(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "isPinned")
@@ -75,7 +77,7 @@ public class ConversationManager extends BaseManager {
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.markSingleMessageHasRead(
// new OnBaseListener(result),
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// value(methodCall, "userID")
// );
@@ -83,7 +85,7 @@ public class ConversationManager extends BaseManager {
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markGroupMessageHasRead(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID")
);
@@ -91,7 +93,7 @@ public class ConversationManager extends BaseManager {
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getTotalUnreadMsgCount(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
@@ -104,7 +106,7 @@ public class ConversationManager extends BaseManager {
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationRecvMessageOpt(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList"),
int2long(methodCall, "status")
@@ -113,9 +115,62 @@ public class ConversationManager extends BaseManager {
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getConversationRecvMessageOpt(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
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());
}
public void setGlobalRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGlobalRecvMessageOpt(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
int2long(methodCall, "status")
);
}
public void setOneConversationBurnDuration(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setOneConversationBurnDuration(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "burnDuration")
);
}
}

View File

@@ -11,11 +11,13 @@ public class FriendshipManager extends BaseManager {
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendListener(new OnFriendshipListener());
result.success(null);
}
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getDesignatedFriendsInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList")
);
@@ -23,7 +25,7 @@ public class FriendshipManager extends BaseManager {
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addFriend(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
@@ -31,28 +33,28 @@ public class FriendshipManager extends BaseManager {
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getRecvFriendApplicationList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSendFriendApplicationList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendRemark(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
@@ -60,7 +62,7 @@ public class FriendshipManager extends BaseManager {
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addBlack(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
@@ -68,14 +70,14 @@ public class FriendshipManager extends BaseManager {
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getBlackList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.removeBlack(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
@@ -83,7 +85,7 @@ public class FriendshipManager extends BaseManager {
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.checkFriend(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList")
);
@@ -91,7 +93,7 @@ public class FriendshipManager extends BaseManager {
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteFriend(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
@@ -99,7 +101,7 @@ public class FriendshipManager extends BaseManager {
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.acceptFriendApplication(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
@@ -107,21 +109,17 @@ public class FriendshipManager extends BaseManager {
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.refuseFriendApplication(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
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();
// }
public void searchFriends(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchFriends(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParam")
);
}
}

View File

@@ -10,11 +10,13 @@ public class GroupManager extends BaseManager {
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupListener(new OnGroupListener());
result.success(null);
}
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.inviteUserToGroup(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason"),
@@ -24,7 +26,7 @@ public class GroupManager extends BaseManager {
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.kickGroupMember(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason"),
@@ -34,7 +36,7 @@ public class GroupManager extends BaseManager {
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMembersInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
jsonValue(methodCall, "uidList")
@@ -43,7 +45,7 @@ public class GroupManager extends BaseManager {
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMemberList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "filter"),
@@ -55,14 +57,14 @@ public class GroupManager extends BaseManager {
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getJoinedGroupList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.createGroup(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "gInfo"),
jsonValue(methodCall, "memberList")
@@ -71,7 +73,7 @@ public class GroupManager extends BaseManager {
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
jsonValue(methodCall, "gInfo")
@@ -80,7 +82,7 @@ public class GroupManager extends BaseManager {
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupsInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "gidList")
);
@@ -88,16 +90,17 @@ public class GroupManager extends BaseManager {
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.joinGroup(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason")
value(methodCall, "reason"),
value(methodCall, "joinSource")
);
}
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.quitGroup(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid")
);
@@ -105,7 +108,7 @@ public class GroupManager extends BaseManager {
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.transferGroupOwner(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "uid")
@@ -114,21 +117,21 @@ public class GroupManager extends BaseManager {
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getRecvGroupApplicationList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSendGroupApplicationList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.acceptGroupApplication(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "uid"),
@@ -139,7 +142,7 @@ public class GroupManager extends BaseManager {
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.refuseGroupApplication(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "uid"),
@@ -148,19 +151,112 @@ public class GroupManager extends BaseManager {
}
// public void forceSyncApplyGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncApplyGroupRequest();
// }
//
// public void forceSyncGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncGroupRequest();
// }
//
// public void forceSyncJoinedGroup(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncJoinedGroup();
// }
//
// public void forceSyncJoinedGroupMember(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncJoinedGroupMember();
// }
public void dismissGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.dismissGroup(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid")
);
}
public void changeGroupMute(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.changeGroupMute(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
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")
);
}
public void setGroupMemberRoleLevel(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupMemberRoleLevel(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "userID"),
int2long(methodCall, "roleLevel")
);
}
public void getGroupMemberListByJoinTimeFilter(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMemberListByJoinTimeFilter(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "offset"),
value(methodCall, "count"),
int2long(methodCall, "joinTimeBegin"),
int2long(methodCall, "joinTimeEnd"),
jsonValue(methodCall, "excludeUserIDList")
);
}
public void setGroupVerification(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupVerification(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "needVerification")
);
}
public void setGroupLookMemberInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupLookMemberInfo(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "status")
);
}
public void setGroupApplyMemberFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupApplyMemberFriend(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "status")
);
}
public void getGroupMemberOwnerAndAdmin(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMemberOwnerAndAdmin(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID")
);
}
public void searchGroupMembers(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchGroupMembers(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParam")
);
}
public void setGroupMemberInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupMemberInfo(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info")
);
}
}

View File

@@ -19,7 +19,7 @@ public class IMManager extends BaseManager {
public void login(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.login(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "uid"),
value(methodCall, "token")
@@ -28,7 +28,7 @@ public class IMManager extends BaseManager {
public void logout(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.logout(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
@@ -37,29 +37,37 @@ public class IMManager extends BaseManager {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
}
// public void getLoginUid(MethodCall methodCall, MethodChannel.Result result) {
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
// }
public void wakeUp(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.wakeUp(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
// public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.getUsersInfo(
// jsonValue(methodCall, "uidList"), new BaseListener(result));
// }
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")
);
}
// public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.setSelfInfo(
// jsonValue(methodCall), new BaseListener(result));
// }
public void updateFcmToken(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.updateFcmToken(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "fcmToken")
);
}
// 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"));
// }
public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setAppBackgroundStatus(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "isBackground")
);
}
}

View File

@@ -4,6 +4,8 @@ import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnCustomBusinessListener;
import io.openim.flutter_openim_sdk.listener.OnMessageKvInfoListener;
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk;
@@ -11,6 +13,7 @@ import open_im_sdk.Open_im_sdk;
public class MessageManager extends BaseManager {
private final static String KEY_ID = "id";
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
/* private static boolean initializedListener = false;
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
@@ -82,6 +85,8 @@ public class MessageManager extends BaseManager {
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
result.success(null);
}
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
@@ -97,7 +102,7 @@ public class MessageManager extends BaseManager {
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getHistoryMessageList(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
@@ -105,7 +110,7 @@ public class MessageManager extends BaseManager {
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.revokeMessage(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
@@ -113,19 +118,19 @@ public class MessageManager extends BaseManager {
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteMessageFromLocalStorage(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
// 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) {
Open_im_sdk.insertSingleMessageToLocalStorage(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
value(methodCall, "receiverID"),
@@ -133,22 +138,37 @@ public class MessageManager extends BaseManager {
);
}
// public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.findMessages(new OnBaseListener(result), jsonValue(methodCall, "messageIDList"));
// }
public void insertGroupMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
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) {
Open_im_sdk.markC2CMessageAsRead(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "userID"),
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) {
Open_im_sdk.typingStatusUpdate(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "userID"),
value(methodCall, "msgTip")
@@ -167,7 +187,10 @@ public class MessageManager extends BaseManager {
Open_im_sdk.createTextAtMessage(
value(methodCall, "operationID"),
value(methodCall, "text"),
jsonValue(methodCall, "atUserList")));
jsonValue(methodCall, "atUserIDList"),
jsonValue(methodCall, "atUserInfoList"),
jsonValue(methodCall, "quoteMessage")
));
}
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
@@ -183,6 +206,7 @@ public class MessageManager extends BaseManager {
value(methodCall, "operationID"),
value(methodCall, "imagePath")));
}
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessage(
@@ -285,13 +309,17 @@ public class MessageManager extends BaseManager {
));
}
// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncMsg();
// }
public void createFaceMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFaceMessage(
value(methodCall, "operationID"),
int2long(methodCall, "index"),
value(methodCall, "data")
));
}
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.clearC2CHistoryMessage(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "userID")
);
@@ -299,9 +327,212 @@ public class MessageManager extends BaseManager {
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.clearGroupHistoryMessage(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
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)
);
}
public void newRevokeMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.newRevokeMessage(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void getAdvancedHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getAdvancedHistoryMessageList(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void findMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.findMessageList(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParams")
);
}
public void createAdvancedTextMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createAdvancedTextMessage(
value(methodCall, "operationID"),
value(methodCall, "text"),
jsonValue(methodCall, "richMessageInfoList")
));
}
public void createAdvancedQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createAdvancedQuoteMessage(
value(methodCall, "operationID"),
value(methodCall, "quoteText"),
jsonValue(methodCall, "quoteMessage"),
jsonValue(methodCall, "richMessageInfoList")
));
}
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.sendMessageNotOss(
new OnMsgSendListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
value(methodCall, "userID"),
value(methodCall, "groupID"),
jsonValue(methodCall, "offlinePushInfo")
);
}
public void createImageMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "sourcePicture"),
jsonValue(methodCall, "bigPicture"),
jsonValue(methodCall, "snapshotPicture")));
}
public void createSoundMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "soundElem")));
}
public void createVideoMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "videoElem")));
}
public void createFileMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "fileElem")));
}
public void setCustomBusinessListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setCustomBusinessListener(new OnCustomBusinessListener());
result.success(null);
}
public void setMessageKvInfoListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageKvInfoListener(new OnMessageKvInfoListener());
result.success(null);
}
public void setMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
jsonValue(methodCall, "list")
);
}
public void deleteMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteMessageReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
jsonValue(methodCall, "list")
);
}
public void getMessageListReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMessageListReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "messageList")
);
}
public void addMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addMessageReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
jsonValue(methodCall, "list")
);
}
public void getMessageListSomeReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMessageListSomeReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "messageList"),
jsonValue(methodCall, "list")
);
}
}

View File

@@ -0,0 +1,70 @@
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());
result.success(null);
}
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")
);
}
public void getDepartmentInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getDepartmentInfo(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "departmentID")
);
}
public void searchOrganization(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchOrganization(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParam"),
int2long(methodCall, "offset"),
int2long(methodCall, "count")
);
}
}

View File

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

View File

@@ -10,25 +10,27 @@ public class UserManager extends BaseManager {
public void setUserListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setUserListener(new OnUserListener());
result.success(null);
}
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList"));
}
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSelfInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall));
}
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSelfUserInfo(
new OnBaseListener(result),
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}

View File

@@ -0,0 +1,33 @@
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());
result.success(null);
}
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"));
}
}

View File

@@ -4,8 +4,9 @@ import org.json.JSONObject;
public class JsonUtil {
public static String toString(Object o) {
if (o == null) return null;
if (o instanceof String) {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append("\"");
buffer.append(o);
buffer.append("\"");

View File

@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>

View File

@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -138,7 +138,6 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -197,25 +196,9 @@
/* End PBXResourcesBuildPhase 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 */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -230,6 +213,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -302,6 +286,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -339,7 +324,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -375,6 +360,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -418,7 +404,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -430,6 +416,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -467,7 +454,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;

View File

@@ -41,5 +41,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
void main() {
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页offet0count20第2页offset20
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
);
}
}

View File

@@ -5,58 +5,58 @@ packages:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.8.2"
version: "2.10.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0"
version: "1.17.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
version: "1.0.5"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@@ -68,40 +68,52 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.1"
version: "2.3.5+2"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.5"
matcher:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.11"
version: "0.12.13"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
version: "0.2.0"
meta:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0"
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
@@ -111,58 +123,58 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
version: "1.9.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "0.4.16"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
version: "2.1.4"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=1.20.0"

View File

@@ -3,9 +3,15 @@ import Foundation
public class JsonUtil {
public static func toString(object: AnyObject?)->String {
if object is NSNull {
return ""
}
if object == nil {
return ""
}
if object is String{
let s = object as! String
let b = s.replacingOccurrences(of: "\"", with: "\\\"")

View File

@@ -19,6 +19,13 @@ public class ConversationManager: BaseServiceManager {
self["getConversationIDBySessionType"] = getConversationIDBySessionType
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
self["setOneConversationPrivateChat"] = setOneConversationPrivateChat
self["deleteConversationFromLocalAndSvr"] = deleteConversationFromLocalAndSvr
self["deleteAllConversationFromLocal"] = deleteAllConversationFromLocal
self["resetConversationGroupAtType"] = resetConversationGroupAtType
self["getAtAllTag"] = getAtAllTag
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
self["setOneConversationBurnDuration"] = setOneConversationBurnDuration
}
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -78,6 +85,34 @@ public class ConversationManager: BaseServiceManager {
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
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())
}
func setGlobalRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGlobalRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "status"])
}
func setOneConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetOneConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
}
}

View File

@@ -19,6 +19,7 @@ public class FriendshipManager: BaseServiceManager {
self["deleteFriend"] = deleteFriend
self["acceptFriendApplication"] = acceptFriendApplication
self["refuseFriendApplication"] = refuseFriendApplication
self["searchFriends"] = searchFriends
// self["forceSyncFriendApplication"] = forceSyncFriendApplication
// self["forceSyncFriend"] = forceSyncFriend
// self["forceSyncBlackList"] = forceSyncBlackList
@@ -81,6 +82,9 @@ public class FriendshipManager: BaseServiceManager {
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
}
// func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
// Open_im_sdkForceSyncFriendApplication()
// callBack(result)

View File

@@ -21,10 +21,19 @@ public class GroupManager: BaseServiceManager {
self["getSendGroupApplicationList"] = getSendGroupApplicationList
self["acceptGroupApplication"] = acceptGroupApplication
self["refuseGroupApplication"] = refuseGroupApplication
// self["forceSyncApplyGroupRequest"] = forceSyncApplyGroupRequest
// self["forceSyncGroupRequest"] = forceSyncGroupRequest
// self["forceSyncJoinedGroup"] = forceSyncJoinedGroup
// self["forceSyncJoinedGroupMember"] = forceSyncJoinedGroupMember
self["dismissGroup"] = dismissGroup
self["changeGroupMute"] = changeGroupMute
self["changeGroupMemberMute"] = changeGroupMemberMute
self["setGroupMemberNickname"] = setGroupMemberNickname
self["searchGroups"] = searchGroups
self["setGroupMemberRoleLevel"] = setGroupMemberRoleLevel
self["getGroupMemberListByJoinTimeFilter"] = getGroupMemberListByJoinTimeFilter
self["setGroupVerification"] = setGroupVerification
self["setGroupLookMemberInfo"] = setGroupLookMemberInfo
self["setGroupApplyMemberFriend"] = setGroupApplyMemberFriend
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
self["searchGroupMembers"] = searchGroupMembers
self["setGroupMemberInfo"] = setGroupMemberInfo
}
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -68,7 +77,7 @@ public class GroupManager: BaseServiceManager {
}
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"])
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
}
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -95,27 +104,59 @@ public class GroupManager: BaseServiceManager {
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) {
// Open_im_sdkForceSyncApplyGroupRequest()
// callBack(result)
// }
//
// func forceSyncGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkForceSyncGroupRequest()
// callBack(result)
// }
//
// func forceSyncJoinedGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkForceSyncJoinedGroup()
// callBack(result)
// }
//
// func forceSyncJoinedGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkForceSyncJoinedGroupMember()
// callBack(result)
// }
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
}
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[bool: "mute"])
}
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 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 searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
}
func setGroupMemberRoleLevel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupMemberRoleLevel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[int:"roleLevel"])
}
func getGroupMemberListByJoinTimeFilter(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMemberListByJoinTimeFilter(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "offset"], methodCall[int32: "count"], methodCall[int64: "joinTimeBegin"], methodCall[int64: "joinTimeEnd"], methodCall[jsonString: "excludeUserIDList"])
}
func setGroupVerification(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupVerification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"needVerification"])
}
func setGroupLookMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupLookMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
}
func setGroupApplyMemberFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupApplyMemberFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
}
func getGroupMemberOwnerAndAdmin(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMemberOwnerAndAdmin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
}
func searchGroupMembers(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchGroupMembers(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
}
func setGroupMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
}
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
private let channel:FlutterMethodChannel

View File

@@ -9,17 +9,14 @@ public class IMMananger: BaseServiceManager {
self["login"] = login
self["logout"] = logout
self["getLoginStatus"] = getLoginStatus
// self["getLoginUid"] = getLoginUid
// self["getUsersInfo"] = getUsersInfo
// self["setSelfInfo"] = setSelfInfo
// self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo
// self["forceReConn"] = forceReConn
// self["setSdkLog"] = setSdkLog
self["wakeUp"] = wakeUp
self["uploadImage"] = uploadImage
self["updateFcmToken"] = updateFcmToken
self["setAppBackgroundStatus"] = setAppBackgroundStatus
}
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString())
callBack(result)
callBack(result,Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
}
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@@ -34,30 +31,22 @@ public class IMMananger: BaseServiceManager {
callBack(result, Open_im_sdkGetLoginStatus())
}
// func getLoginUid(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// callBack(result, Open_im_sdkGetLoginUser())
// }
func wakeUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
}
// func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result))
// }
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"])
}
// func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result))
// }
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"])
}
func setAppBackgroundStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[bool: "isBackground"])
}
// 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 {

View File

@@ -12,10 +12,10 @@ public class MessageManager: BaseServiceManager {
self["getHistoryMessageList"] = getHistoryMessageList
self["revokeMessage"] = revokeMessage
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
self["deleteMessages"] = deleteMessages
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
// self["findMessages"] = findMessages
self["insertGroupMessageToLocalStorage"] = insertGroupMessageToLocalStorage
self["markC2CMessageAsRead"] = markC2CMessageAsRead
self["markGroupMessageAsRead"] = markGroupMessageAsRead
self["typingStatusUpdate"] = typingStatusUpdate
self["createTextMessage"] = createTextMessage
self["createTextAtMessage"] = createTextAtMessage
@@ -33,9 +33,34 @@ public class MessageManager: BaseServiceManager {
self["createCustomMessage"] = createCustomMessage
self["createQuoteMessage"] = createQuoteMessage
self["createCardMessage"] = createCardMessage
// self["forceSyncMsg"] = forceSyncMsg
self["createFaceMessage"] = createFaceMessage
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
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
self["newRevokeMessage"] = newRevokeMessage
self["getAdvancedHistoryMessageList"] = getAdvancedHistoryMessageList
self["findMessageList"] = findMessageList
self["createAdvancedTextMessage"] = createAdvancedTextMessage
self["createAdvancedQuoteMessage"] = createAdvancedQuoteMessage
self["sendMessageNotOss"] = sendMessageNotOss
self["createImageMessageByURL"] = createImageMessageByURL
self["createSoundMessageByURL"] = createSoundMessageByURL
self["createVideoMessageByURL"] = createVideoMessageByURL
self["createFileMessageByURL"] = createFileMessageByURL
self["setCustomBusinessListener"] = setCustomBusinessListener
self["setMessageKvInfoListener"] = setMessageKvInfoListener
self["setMessageReactionExtensions"] = setMessageReactionExtensions
self["deleteMessageReactionExtensions"] = deleteMessageReactionExtensions
self["getMessageListReactionExtensions"] = getMessageListReactionExtensions
self["addMessageReactionExtensions"] = addMessageReactionExtensions
self["getMessageListSomeReactionExtensions"] = getMessageListSomeReactionExtensions
}
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -63,33 +88,36 @@ public class MessageManager: BaseServiceManager {
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){
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
methodCall[string: "receiverID"], methodCall[string: "senderID"])
}
// func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
// Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"])
// }
func insertGroupMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
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){
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){
Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"])
}
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"]))
}
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){
@@ -116,18 +144,18 @@ public class MessageManager: BaseServiceManager {
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
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)
}
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
}
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
}
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
}
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
methodCall[jsonString: "summaryList"])
@@ -158,77 +186,250 @@ public class MessageManager: BaseServiceManager {
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
}
func createFaceMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFaceMessage(methodCall[string: "operationID"], methodCall[int: "index"], methodCall[string: "data"]))
}
// func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
// Open_im_sdkForceSyncMsg()
// callBack(result)
// }
func createAdvancedTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateAdvancedTextMessage(methodCall[string: "operationID"], methodCall[string: "text"], methodCall[jsonString: "richMessageInfoList"])
callBack(result, prama)
}
func createAdvancedQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateAdvancedQuoteMessage(methodCall[string: "operationID"], methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"], methodCall[jsonString: "richMessageInfoList"])
callBack(result, prama)
}
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
}
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
}
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
private let channel: FlutterMethodChannel
private let result: FlutterResult
private let call: FlutterMethodCall
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
self.channel = channel
self.result = result
self.call = methodCall
}
public func onError(_ errCode: Int32, errMsg: String?) {
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
}
public func onProgress(_ progress: Int) {
var values: [String: Any] = [:]
let message = call[dict: "message"]
values["clientMsgID"] = message["clientMsgID"]
values["progress"] = progress
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
}
public func onSuccess(_ data: String?) {
DispatchQueue.main.async { self.result(data) }
}
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())
}
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
private let channel: FlutterMethodChannel
private let id: String
func deleteAllMsgFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkDeleteAllMsgFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
}
init(channel: FlutterMethodChannel, id: String) {
self.channel = channel
self.id = id
}
func deleteAllMsgFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkDeleteAllMsgFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"])
}
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["haveReadMessage"] = msgReceiptList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageRevoked(_ msgId: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["revokedMessage"] = msgId
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
}
public func onRecvNewMessage(_ message: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["newMessage"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
}
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())
}
func newRevokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkNewRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
func getAdvancedHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetAdvancedHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkFindMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"])
}
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
}
func createImageMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateImageMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "sourcePicture"], methodCall[jsonString: "bigPicture"], methodCall[jsonString: "snapshotPicture"]))
}
func createSoundMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateSoundMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "soundElem"]))
}
func createVideoMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateVideoMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "videoElem"]))
}
func createFileMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "fileElem"]))
}
func setCustomBusinessListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel))
callBack(result)
}
func setMessageKvInfoListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageKvInfoListener(MessageKvInfoListener(channel: channel))
callBack(result)
}
func setMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
}
func deleteMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
}
func getMessageListReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetMessageListReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "messageList"])
}
func addMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
}
func getMessageListSomeReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetMessageListSomeReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[jsonString: "list"])
}
}
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
private let channel: FlutterMethodChannel
private let result: FlutterResult
private let call: FlutterMethodCall
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
self.channel = channel
self.result = result
self.call = methodCall
}
public func onError(_ errCode: Int32, errMsg: String?) {
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
}
public func onProgress(_ progress: Int) {
var values: [String: Any] = [:]
let message = call[dict: "message"]
values["clientMsgID"] = message["clientMsgID"]
values["progress"] = progress
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
}
public func onSuccess(_ data: String?) {
DispatchQueue.main.async { self.result(data) }
}
}
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
private let channel: FlutterMethodChannel
private let id: String
init(channel: FlutterMethodChannel, id: String) {
self.channel = channel
self.id = id
}
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["c2cMessageReadReceipt"] = msgReceiptList
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?) {
var values: [String: Any] = [:]
values["id"] = id
values["revokedMessage"] = msgId
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
}
public func onRecvNewMessage(_ message: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["newMessage"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
}
public func onNewRecvMessageRevoked(_ messageRevoked: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["revokedMessageV2"] = messageRevoked
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onNewRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageExtensionsChanged(_ msgID: String?, reactionExtensionList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["msgID"] = msgID
values["list"] = reactionExtensionList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsChanged", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageExtensionsDeleted(_ msgID: String?, reactionExtensionKeyList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["msgID"] = msgID
values["list"] = reactionExtensionKeyList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsDeleted", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageExtensionsAdded(_ msgID: String?, reactionExtensionList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["msgID"] = msgID
values["list"] = reactionExtensionList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsAdded", errCode: nil, errMsg: nil, data: values)
}
}
public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
private let channel: FlutterMethodChannel
init(channel: FlutterMethodChannel) {
self.channel = channel
}
public func onRecvCustomBusinessMessage(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "customBusinessListener", type: "onRecvCustomBusinessMessage", errCode: nil, errMsg: nil, data: s)
}
}
public class MessageKvInfoListener: NSObject, Open_im_sdk_callbackOnMessageKvInfoListenerProtocol {
private let channel: FlutterMethodChannel
init(channel: FlutterMethodChannel) {
self.channel = channel
}
public func onMessageKvInfoChanged(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "messageKvInfoListener", type: "onMessageKvInfoChanged", errCode: nil, errMsg: nil, data: s)
}
}

View File

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

View File

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

View File

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

View File

@@ -8,6 +8,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
let messageManager: MessageManager
let groupManager: GroupManager
let userManger: UserManager
let signalingManager: SignalingManager
let workMomentsManager: WorkMomentsManager
let organizationManager: OrganizationManager
init(channel: FlutterMethodChannel) {
self.imManager = IMMananger(channel: channel)
@@ -16,6 +19,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
self.messageManager = MessageManager(channel: channel)
self.groupManager = GroupManager(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) {
@@ -39,6 +45,12 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
groupManager.handleMethod(call: call, result: result)
case "userManager":
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:
print("Handle ManagerName Error: \(managerName) not found")
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 *
}

View File

@@ -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>

View File

@@ -15,9 +15,11 @@ A new Flutter project.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '8.0'
s.platform = :ios, '9.0'
s.vendored_frameworks = 'Framework/*.framework'
s.dependency 'OpenIMSDKCore','2.3.5-b3'
s.static_framework = true
# s.vendored_frameworks = 'Framework/*.framework'
# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' }
s.swift_version = '5.0'

View File

@@ -1,35 +1,46 @@
library flutter_openim_sdk;
export 'src/enum/conversation_type.dart';
export 'src/enum/group_at_type.dart';
export 'src/enum/group_role_level.dart';
export 'src/enum/group_type.dart';
export 'src/enum/group_verification.dart';
export 'src/enum/im_platform.dart';
export 'src/enum/listener_type.dart';
export 'src/enum/message_status.dart';
export 'src/enum/message_type.dart';
export 'src/enum/sdk_error_code.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/conversation_listener.dart';
export 'src/listener/friendship_listener.dart';
export 'src/listener/custom_business_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/message_kv_info_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/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_friendship_manager.dart';
export 'src/manager/im_group_manager.dart';
export 'src/manager/im_manager.dart';
export 'src/manager/im_message_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_user_manager.dart';
export 'src/manager/im_workmoments_manager.dart';
export 'src/models/conversation_info.dart';
export 'src/models/group_info.dart';
export 'src/models/meeting_info.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/workmoments_info.dart';
export 'src/openim.dart';
export 'src/utils.dart';

View File

@@ -1,4 +1,14 @@
/// 会话类型
class ConversationType {
/// 单聊
static const single = 1;
/// 群
static const group = 2;
/// 大群
static const superGroup = 3;
/// 通知
static const notification = 4;
}

View File

@@ -0,0 +1,17 @@
/// 会话强提示内容
class GroupAtType {
/// 取消所有提示即调用了resetConversationGroupAtType方法
static const atNormal = 0;
/// @了我提示
static const atMe = 1;
/// @了所有人提示
static const atAll = 2;
/// @了所有人@了我
static const atAllAtMe = 3;
/// 群公告提示
static const groupNotification = 4;
}

View File

@@ -1,7 +1,11 @@
/// 1 ordinary member, 2 group owners, 3 administrators
/// 1普通成员, 2群主3管理员
/// 群成员角色
class GroupRoleLevel {
/// 普通成员
static const member = 1;
/// 群主
static const owner = 2;
/// 管理员
static const admin = 3;
}

View File

@@ -0,0 +1,8 @@
/// 组类型
class GroupType {
/// 普通群
static const int general = 0;
/// 工作群
static const int work = 2;
}

View File

@@ -0,0 +1,11 @@
/// 进群验证设置选项
class GroupVerification {
/// 申请需要同意 邀请直接进
static const int applyNeedVerificationInviteDirectly = 0;
/// 所有人进群需要验证,除了群主管理员邀
static const int allNeedVerification = 1;
/// 直接进群
static const int directly = 2;
}

View File

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

View File

@@ -1,3 +1,4 @@
/// callback类型
class ListenerType {
static final simpleMsgListener = 'simpleMsgListener';
static final connectListener = 'connectListener';
@@ -8,4 +9,8 @@ class ListenerType {
static final friendListener = 'friendListener';
static final signalingListener = 'signalingListener';
static final msgSendProgressListener = "msgSendProgressListener";
static final workMomentsListener = "workMomentsListener";
static final organizationListener = "organizationListener";
static final customBusinessListener = "customBusinessListener";
static final messageKvInfoListener = "messageKvInfoListener";
}

View File

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

View File

@@ -1,40 +1,168 @@
/// 消息类型
class MessageType {
///
/// 普通文本
static const text = 101;
/// 图片
static const picture = 102;
/// 语音
static const voice = 103;
/// 视频
static const video = 104;
/// 文件
static const file = 105;
/// @消息
static const at_text = 106;
/// 合并
static const merger = 107;
// static const forward = 108;
/// 名片
static const card = 108;
/// 位置
static const location = 109;
/// 自定义
static const custom = 110;
/// 撤回
static const revoke = 111;
/// 已读回执
static const has_read_receipt = 112;
/// 正字输入
static const typing = 113;
/// 引用回复
static const quote = 114;
///
static const accept_friend = 201;
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 custom_face = 115;
static const kick_online = 303;
/// 群消息已读回执
static const groupHasReadReceipt = 116;
///
static const transfer_group_owner = 501;
static const create_group = 502;
// static const create_group = 503;
static const join_group = 504;
static const quit_group = 505;
static const set_group_info = 506;
static const accept_group_application = 507;
static const refuse_group_application = 508;
static const kick_group_member = 509;
static const invited_user_to_group = 510;
/// 富文本消息
static const advancedText = 117;
/// 高级撤回
static const advancedRevoke = 118;
static const customMsgNotTriggerConversation = 119;
static const customMsgOnlineOnly = 120;
/// 通知类型
static const notificationBegin = 1000;
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 userNotificationBegin = 1301;
/// 用户信息改变
static const userInfoUpdatedNotification = 1303;
static const userNotificationEnd = 1399;
/// OA通知
static const oaNotification = 1400;
static const groupNotificationBegin = 1500;
/// 群已被创建
static const groupCreatedNotification = 1501;
/// 群资料改变
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;
}

View File

@@ -0,0 +1,14 @@
/// 消息发送失败
class MessageFailedCode {
/// 被对方拉黑
static const int blockedByFriend = 600;
/// 被对方删除
static const int deletedByFriend = 601;
}
/// 添加好友失败
class AddFriendFailedCode {
/// 该用户已设置不可添加
static const int refuseToAddFriends = 10007;
}

View File

@@ -1,33 +1,68 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 消息监听
class OnAdvancedMsgListener {
/// Message read receipt
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
/// A friend revoked a message
Function(List<ReadReceiptInfo> list)? onRecvC2CMessageReadReceipt;
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
Function(String msgId)? onRecvMessageRevoked;
/// Receive new message
Function(Message msg)? onRecvNewMessage;
Function(RevokedInfo info)? onRecvMessageRevokedV2;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsChanged;
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
/// Uniquely identifies
String id;
OnAdvancedMsgListener({
this.onRecvC2CReadReceipt,
this.onRecvMessageRevoked,
this.onRecvC2CMessageReadReceipt,
this.onRecvGroupMessageReadReceipt,
@deprecated this.onRecvMessageRevoked,
this.onRecvNewMessage,
this.onRecvMessageRevokedV2,
this.onRecvMessageExtensionsChanged,
this.onRecvMessageExtensionsDeleted,
this.onRecvMessageExtensionsAdded,
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
if (null != onRecvC2CReadReceipt) onRecvC2CReadReceipt!(list);
/// C2C消息已读回执
void recvC2CMessageReadReceipt(List<ReadReceiptInfo> list) {
onRecvC2CMessageReadReceipt?.call(list);
}
/// 群消息已读回执
void recvGroupMessageReadReceipt(List<ReadReceiptInfo> list) {
onRecvGroupMessageReadReceipt?.call(list);
}
/// 消息被撤回
void recvMessageRevoked(String msgId) {
if (null != onRecvMessageRevoked) onRecvMessageRevoked!(msgId);
onRecvMessageRevoked?.call(msgId);
}
/// 收到了一条新消息
void recvNewMessage(Message msg) {
if (null != onRecvNewMessage) onRecvNewMessage!(msg);
onRecvNewMessage?.call(msg);
}
/// 消息被撤回
void recvMessageRevokedV2(RevokedInfo info) {
onRecvMessageRevokedV2?.call(info);
}
/// 收到拓展消息kv改变
void recvMessageExtensionsChanged(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsChanged?.call(msgID, list);
}
/// 收到扩展消息被删除
/// [list] 被删除的TypeKey
void recvMessageExtensionsDeleted(String msgID, List<String> list) {
onRecvMessageExtensionsDeleted?.call(msgID, list);
}
/// 收到拓展消息kv新增
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsAdded?.call(msgID, list);
}
}

View File

@@ -1,19 +1,9 @@
/// SDK 连接状态监听
class OnConnectListener {
/// SDK failed to connect to the server
Function(int? code, String? errorMsg)? onConnectFailed;
/// SDK has successfully connected to the server
Function()? onConnectSuccess;
/// SDK is connecting to the server
Function()? onConnecting;
/// The current user is kicked offline.
/// At this time, the UI can prompt the user and call IMManager's login() function to log in again.
Function()? onKickedOffline;
/// Ticket expired when online.
/// At this time, you need to generate a new userSig and call IMManager's login() function to log in again
Function()? onUserSigExpired;
OnConnectListener({
@@ -24,22 +14,27 @@ class OnConnectListener {
this.onUserSigExpired,
});
/// SDK连接服务器失败
void connectFailed(int? code, String? errorMsg) {
if (null != onConnectFailed) onConnectFailed!(code, errorMsg);
}
/// SDK连接服务器成功
void connectSuccess() {
if (null != onConnectSuccess) onConnectSuccess!();
}
/// SDK正在连接服务器
void connecting() {
if (null != onConnecting) onConnecting!.call();
}
/// 账号已在其他地方登录,当前设备被踢下线
void kickedOffline() {
if (null != onKickedOffline) onKickedOffline!();
}
/// 登录凭证过期,需要重新登录
void userSigExpired() {
if (null != onUserSigExpired) onUserSigExpired!();
}

View File

@@ -1,5 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 会话监听
class OnConversationListener {
Function(List<ConversationInfo> list)? onConversationChanged;
Function(List<ConversationInfo> list)? onNewConversation;
@@ -17,14 +18,22 @@ class OnConversationListener {
this.onSyncServerStart,
});
/// 会话发生改变
void conversationChanged(List<ConversationInfo> list) {
if (onConversationChanged != null) onConversationChanged!(list);
}
/// 有新会话产生
void newConversation(List<ConversationInfo> list) {
if (onNewConversation != null) onNewConversation!(list);
}
/// 未读消息总数发送改变
void totalUnreadMessageCountChanged(int i) {
if (onTotalUnreadMessageCountChanged != null)
onTotalUnreadMessageCountChanged!(i);
}
void syncServerFailed() {
if (onSyncServerFailed != null) onSyncServerFailed!();
}
@@ -36,9 +45,4 @@ class OnConversationListener {
void syncServerStart() {
if (onSyncServerStart != null) onSyncServerStart!();
}
void totalUnreadMessageCountChanged(int i) {
if (onTotalUnreadMessageCountChanged != null)
onTotalUnreadMessageCountChanged!(i);
}
}

View File

@@ -0,0 +1,9 @@
class OnCustomBusinessListener {
Function(String s)? onRecvCustomBusinessMessage;
OnCustomBusinessListener({this.onRecvCustomBusinessMessage});
void recvCustomBusinessMessage(String s) {
onRecvCustomBusinessMessage?.call(s);
}
}

View File

@@ -1,5 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 好友关系监听
class OnFriendshipListener {
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
@@ -23,38 +24,47 @@ class OnFriendshipListener {
this.onFriendInfoChanged,
});
/// 已被加入黑名单
void blacklistAdded(BlacklistInfo u) {
onBlacklistAdded?.call(u);
}
/// 已从黑名单移除
void blacklistDeleted(BlacklistInfo u) {
onBlacklistDeleted?.call(u);
}
/// 好友已添加
void friendAdded(FriendInfo u) {
onFriendAdded?.call(u);
}
/// 好友申请已被接受
void friendApplicationAccepted(FriendApplicationInfo u) {
onFriendApplicationAccepted?.call(u);
}
/// 已添加新的好友申请
void friendApplicationAdded(FriendApplicationInfo u) {
onFriendApplicationAdded?.call(u);
}
/// 好友申请已被删除
void friendApplicationDeleted(FriendApplicationInfo u) {
onFriendApplicationDeleted?.call(u);
}
/// 好友申请已被拒绝
void friendApplicationRejected(FriendApplicationInfo u) {
onFriendApplicationRejected?.call(u);
}
/// 好友已被删除
void friendDeleted(FriendInfo u) {
onFriendDeleted?.call(u);
}
/// 好友资料发生改变
void friendInfoChanged(FriendInfo u) {
onFriendInfoChanged?.call(u);
}

View File

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

View File

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

View File

@@ -1,8 +1,10 @@
/// 消息发送进度监听
class OnMsgSendProgressListener {
Function(String clientMsgID, int progress)? onProgress;
OnMsgSendProgressListener({this.onProgress});
/// 消息发送进度
void progress(String clientMsgID, int progress) {
if (null != onProgress) onProgress!(clientMsgID, progress);
}

View File

@@ -0,0 +1,11 @@
/// 组织架构监听
class OnOrganizationListener {
Function()? onOrganizationUpdated;
OnOrganizationListener({this.onOrganizationUpdated});
/// 组织架构有更新
void organizationUpdated() {
onOrganizationUpdated?.call();
}
}

View File

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

View File

@@ -1,11 +1,13 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 当前用户资料监听
class OnUserListener {
/// The information of the logged-in user has been updated
Function(UserInfo info)? onSelfInfoUpdated;
OnUserListener({this.onSelfInfoUpdated});
/// 自身信息发送变化回调
void selfInfoUpdated(UserInfo info) {
onSelfInfoUpdated?.call(info);
}

View File

@@ -0,0 +1,11 @@
/// 朋友圈监听
class OnWorkMomentsListener {
Function()? onRecvNewNotification;
OnWorkMomentsListener({this.onRecvNewNotification});
/// 朋友圈信息发送改变
void recvNewNotification() {
onRecvNewNotification?.call();
}
}

View File

@@ -3,18 +3,16 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class ConversationManager {
MethodChannel _channel;
late OnConversationListener conversationListener;
late OnConversationListener listener;
ConversationManager(this._channel);
/// Observe conversation changes
/// 会话监听
Future setConversationListener(OnConversationListener listener) {
this.conversationListener = listener;
this.listener = listener;
return _channel.invokeMethod('setConversationListener', _buildParam({}));
}
/// Get all conversations
/// 获取所有会话
Future<List<ConversationInfo>> getAllConversationList(
{String? operationID}) =>
@@ -27,8 +25,9 @@ class ConversationManager {
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// Paging to get conversation
/// 分页获取会话
/// [offset] 开始下标
/// [count] 每页数量
Future<List<ConversationInfo>> getConversationListSplit({
int offset = 0,
int count = 20,
@@ -45,12 +44,9 @@ class ConversationManager {
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// Get a conversation, if it doesn't exist it will be created automatically
/// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
/// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2
/// 获取一个会话,如果不存在会自动创建
/// [sourceID] 如果是单聊值传用户ID如果是群聊值传组ID
/// [sessionType] 如果是单聊值传1如果是群聊值传2
/// 查询会话,如果会话不存在会自动生成一个
/// [sourceID] 如果是单聊会话传userID如果是群聊会话传GroupID
/// [sessionType] 参考[ConversationType]
Future<ConversationInfo> getOneConversation({
required String sourceID,
required int sessionType,
@@ -67,8 +63,8 @@ class ConversationManager {
.then((value) =>
Utils.toObj(value, (map) => ConversationInfo.fromJson(map)));
/// Get conversation list by id list
/// 获取多个会话
/// 根据会话id获取多个会话
/// [conversationIDList] 会话id列表
Future<List<ConversationInfo>> getMultipleConversation({
required List<String> conversationIDList,
String? operationID,
@@ -83,8 +79,8 @@ class ConversationManager {
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// Delete conversation by id
/// 删除会话
/// 通过会话id删除指定会话
/// [conversationID] 被删除会话的id
Future deleteConversation({
required String conversationID,
String? operationID,
@@ -96,8 +92,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Set draft
/// 设置会话草稿
/// [conversationID] 会话id
/// [draftText] 草稿
Future setConversationDraft({
required String conversationID,
required String draftText,
@@ -111,8 +108,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Pinned conversation
/// 置顶会话
/// [conversationID] 会话id
/// [isPinned] true置顶false取消置顶
Future pinConversation({
required String conversationID,
required bool isPinned,
@@ -126,12 +124,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
// Future<dynamic> markSingleMessageHasRead({required String userID}) =>
// _channel.invokeMethod(
// 'markSingleMessageHasRead', _buildParam({'userID': userID}));
/// Mark group chat messages as read
/// 标记群聊已读
/// 标记群聊会话已读
/// [groupID] 群id
Future<dynamic> markGroupMessageHasRead({
required String groupID,
String? operationID,
@@ -143,7 +137,6 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Get the total number of unread messages
/// 获取未读消息总数
Future<dynamic> getTotalUnreadMsgCount({
String? operationID,
@@ -154,12 +147,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Query conversation id
/// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
/// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2
/// 查询会话id
/// [sourceID] 如果是单聊值传用户ID如果是群聊值传组ID
/// [sessionType] 如果是单聊值传1如果是群聊值传2
/// [sessionType] 参考[ConversationType]
Future<dynamic> getConversationIDBySessionType({
required String sourceID,
required int sessionType,
@@ -171,9 +161,8 @@ class ConversationManager {
"sessionType": sessionType,
}));
/// Message Do Not Disturb
/// [status] 0: Normal. 1: Do not receive messages. 2: Do not notify when messages are received.
/// 消息免打扰设置
/// [conversationIDList] 会话id列表
/// [status] 0正常1不接受消息2接受在线消息不接受离线消息
Future<dynamic> setConversationRecvMessageOpt({
required List<String> conversationIDList,
@@ -188,9 +177,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Message Do Not Disturb
/// [{"conversationId":"single_13922222222","result":0}]
/// 查询免打扰状态
/// [conversationIDList] 会话id列表
/// 返回:[{"conversationId":"single_13922222222","result":0}]result值0正常1不接受消息2接受在线消息不接受离线消息
Future<List<dynamic>> getConversationRecvMessageOpt({
required List<String> conversationIDList,
String? operationID,
@@ -204,7 +193,91 @@ class ConversationManager {
}))
.then((value) => Utils.toListMap(value));
/// Custom sort for conversation list
/// 阅后即焚
/// [conversationID] 会话id
/// [isPrivate] true开启false关闭
Future<dynamic> setOneConversationPrivateChat({
required String conversationID,
required bool isPrivate,
String? operationID,
}) =>
_channel.invokeMethod(
'setOneConversationPrivateChat',
_buildParam({
"conversationID": conversationID,
"isPrivate": isPrivate,
"operationID": Utils.checkOperationID(operationID),
}));
/// 删除本地以及服务器的会话
/// [conversationID] 会话ID
Future<dynamic> deleteConversationFromLocalAndSvr({
required String conversationID,
String? operationID,
}) =>
_channel.invokeMethod(
'deleteConversationFromLocalAndSvr',
_buildParam({
"conversationID": conversationID,
"operationID": Utils.checkOperationID(operationID),
}));
/// 删除所有本地会话
Future<dynamic> deleteAllConversationFromLocal({
String? operationID,
}) =>
_channel.invokeMethod(
'deleteAllConversationFromLocal',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}));
/// 重置强提醒标识[GroupAtType]
/// [conversationID] 会话id
Future<dynamic> resetConversationGroupAtType({
required String conversationID,
String? operationID,
}) =>
_channel.invokeMethod(
'resetConversationGroupAtType',
_buildParam({
"conversationID": conversationID,
"operationID": Utils.checkOperationID(operationID),
}));
/// 查询@所有人标识
Future<dynamic> getAtAllTag() =>
_channel.invokeMethod('getAtAllTag', _buildParam({}));
/// 全局免打扰
/// [status] 0正常1不接受消息2接受在线消息不接受离线消息
Future<dynamic> setGlobalRecvMessageOpt({
required int status,
String? operationID,
}) =>
_channel.invokeMethod(
'setGlobalRecvMessageOpt',
_buildParam({
"status": status,
"operationID": Utils.checkOperationID(operationID),
}));
/// 设置阅后即焚时长
/// [conversationID] 会话id
/// [burnDuration] 时长s默认30s
Future<dynamic> setOneConversationBurnDuration({
required String conversationID,
int burnDuration = 30,
String? operationID,
}) =>
_channel.invokeMethod(
'setOneConversationBurnDuration',
_buildParam({
"conversationID": conversationID,
"burnDuration": burnDuration,
"operationID": Utils.checkOperationID(operationID),
}));
/// 会话列表自定义排序规则。
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
..sort((a, b) {

View File

@@ -3,19 +3,18 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class FriendshipManager {
MethodChannel _channel;
late OnFriendshipListener friendshipListener;
late OnFriendshipListener listener;
FriendshipManager(this._channel);
/// Set up a friend relationship listener
/// 好友关系监听
Future setFriendshipListener(OnFriendshipListener listener) {
this.friendshipListener = listener;
this.listener = listener;
return _channel.invokeMethod('setFriendListener', _buildParam({}));
}
/// Get friend info by user id
/// 查询好友信息
/// [uidList] userID集合
Future<List<UserInfo>> getFriendsInfo({
required List<String> uidList,
String? operationID,
@@ -29,8 +28,9 @@ class FriendshipManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Send an friend application
/// 发送一个好友请求
/// 发送一个好友请求,需要对方调用同意申请才能成为好友。
/// [uid] 被邀请的用户ID
/// [reason] 备注说明
Future<dynamic> addFriend({
required String uid,
String? reason,
@@ -44,7 +44,6 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Get someone's request to add me as a friend
/// 获取别人加我为好友的申请
Future<List<FriendApplicationInfo>> getRecvFriendApplicationList(
{String? operationID}) =>
@@ -57,7 +56,6 @@ class FriendshipManager {
.then((value) =>
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
/// Get friend requests from me
/// 获取我发出的好友申请
Future<List<FriendApplicationInfo>> getSendFriendApplicationList(
{String? operationID}) =>
@@ -70,8 +68,7 @@ class FriendshipManager {
.then((value) =>
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
/// Find all friends including those who have been added to the blacklist
/// 获取好友列表包含已拉入黑名单的好友
/// 获取好友列表,返回的列表包含了已拉入黑名单的好友
Future<List<UserInfo>> getFriendList({String? operationID}) => _channel
.invokeMethod(
'getFriendList',
@@ -80,8 +77,7 @@ class FriendshipManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Find all friends including those who have been added to the blacklist
/// 获取好友列表
/// 获取好友列表,返回的列表包含了已拉入黑名单的好友
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
.invokeMethod(
'getFriendList',
@@ -90,8 +86,9 @@ class FriendshipManager {
}))
.then((value) => Utils.toListMap(value));
/// Modify friend remark name
/// 设置好友备注
/// [uid] 好友的userID
/// [remark] 好友的备注
Future<dynamic> setFriendRemark({
required String uid,
required String remark,
@@ -105,8 +102,8 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Add friends to blacklist
/// 加入黑名单
/// [uid] 被加入黑名单的好友ID
Future<dynamic> addBlacklist({
required String uid,
String? operationID,
@@ -118,7 +115,6 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Find all blacklist
/// 获取黑名单列表
Future<List<UserInfo>> getBlacklist({String? operationID}) => _channel
.invokeMethod(
@@ -128,8 +124,8 @@ class FriendshipManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Remove from blacklist
/// 从黑名单移除
/// [uid] 用户ID
Future<dynamic> removeBlacklist({
required String uid,
String? operationID,
@@ -141,8 +137,8 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Determine if there is a friendship by userId
/// 检查友好关系
/// [uidList] userID列表
Future<List<FriendshipInfo>> checkFriend({
required List<String> uidList,
String? operationID,
@@ -157,8 +153,8 @@ class FriendshipManager {
.then((value) =>
Utils.toList(value, (v) => FriendshipInfo.fromJson(v)));
/// Dissolve friendship from friend list
/// 删除好友
/// [uid] 用户ID
Future<dynamic> deleteFriend({
required String uid,
String? operationID,
@@ -170,8 +166,9 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Accept application of be friend
/// 接受好友请求
/// [uid] 用户ID
/// [handleMsg]备注说明
Future<dynamic> acceptFriendApplication({
required String uid,
String? handleMsg,
@@ -185,8 +182,9 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Refuse application of be friend
/// 拒绝好友请求
/// [uid] 用户ID
/// [handleMsg]备注说明
Future<dynamic> refuseFriendApplication({
required String uid,
String? handleMsg,
@@ -200,6 +198,33 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// 查好友
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] 是否以关键词搜索好友ID(注不可以同时为false)为空默认false
/// [isSearchNickname] 是否以关键词搜索昵称为空默认false
/// [isSearchRemark] 是否以关键词搜索备注名为空默认false
Future<List<FriendInfo>> searchFriends({
List<String> keywordList = const [],
bool isSearchUserID = false,
bool isSearchNickname = false,
bool isSearchRemark = false,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchFriends',
_buildParam({
'searchParam': {
'keywordList': keywordList,
'isSearchUserID': isSearchUserID,
'isSearchNickname': isSearchNickname,
'isSearchRemark': isSearchRemark,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => FriendInfo.fromJson(map)));
static Map _buildParam(Map param) {
param["ManagerName"] = "friendshipManager";
return param;

View File

@@ -3,19 +3,19 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class GroupManager {
MethodChannel _channel;
late OnGroupListener groupListener;
late OnGroupListener listener;
GroupManager(this._channel);
/// Set up group relationship monitoring
/// 组关系监听
Future setGroupListener(OnGroupListener listener) {
this.groupListener = listener;
this.listener = listener;
return _channel.invokeMethod('setGroupListener', _buildParam({}));
}
/// Invite friends into the group
/// 邀请进组,直接进组无需同意。
/// [groupId] 组ID
/// [uidList] 用户ID列表
Future<List<GroupInviteResult>> inviteUserToGroup({
required String groupId,
required List<String> uidList,
@@ -34,8 +34,10 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
/// Remove member from group
/// 移除组成员
/// [groupId] 组ID
/// [uidList] 用户ID列表
/// [reason] 备注说明
Future<List<GroupInviteResult>> kickGroupMember({
required String groupId,
required List<String> uidList,
@@ -54,8 +56,9 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
/// Get group member's info
/// 查询组成员资料
/// [groupId] 组ID
/// [uidList] 用户ID列表
Future<List<GroupMembersInfo>> getGroupMembersInfo({
required String groupId,
required List<String> uidList,
@@ -72,8 +75,11 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Get the list of group members
/// 分页获取组成员列表
/// [groupId] 群ID
/// [filter] 过滤成员 0所有1普通成员, 2群主3管理员4管理员+普通成员
/// [offset] 开始下标
/// [count] 总数
Future<List<GroupMembersInfo>> getGroupMemberList({
required String groupId,
int filter = 0,
@@ -94,8 +100,11 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Get the list of group members
/// 分页获取组成员列表
/// [groupId] 群ID
/// [filter] 过滤成员 0所有1普通成员, 2群主3管理员4管理员+普通成员
/// [offset] 开始下标
/// [count] 总数
Future<List<dynamic>> getGroupMemberListMap({
required String groupId,
int filter = 0,
@@ -115,7 +124,6 @@ class GroupManager {
}))
.then((value) => Utils.toListMap(value));
/// Find all groups you have joined
/// 查询已加入的组列表
Future<List<GroupInfo>> getJoinedGroupList({String? operationID}) => _channel
.invokeMethod(
@@ -125,7 +133,6 @@ class GroupManager {
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Find all groups you have joined
/// 查询已加入的组列表
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
.invokeMethod(
@@ -135,8 +142,8 @@ class GroupManager {
}))
.then((value) => Utils.toListMap(value));
/// Check if you are a member of the group
/// 检查是否已加入组
/// [gid] 组ID
Future<bool> isJoinedGroup({
required String gid,
String? operationID,
@@ -145,8 +152,14 @@ class GroupManager {
operationID: Utils.checkOperationID(operationID),
).then((list) => list.where((e) => e.groupID == gid).length > 0);
/// Create a group
/// 创建一个组
/// [groupName] 群名
/// [notification] 公告
/// [introduction] 群介绍
/// [faceUrl] 群头像
/// [groupType] 组类型 [GroupType]
/// [ex] 额外信息
/// [list] 初创群成员以及其角色列表[GroupMemberRole]
Future<GroupInfo> createGroup({
String? groupName,
String? notification,
@@ -175,8 +188,13 @@ class GroupManager {
.then(
(value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));
/// Edit group information
/// 编辑组资料
/// [groupID] 被编辑的群ID
/// [groupName] 新的群名
/// [notification] 新的公告
/// [introduction] 新的群介绍
/// [faceUrl] 新的群头像
/// [ex] 新的额外信息
Future<dynamic> setGroupInfo({
required String groupID,
String? groupName,
@@ -201,8 +219,8 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// Find group information by group id
/// 查询组信息
/// [gidList] 组ID列表
Future<List<GroupInfo>> getGroupsInfo({
required List<String> gidList,
String? operationID,
@@ -217,22 +235,23 @@ class GroupManager {
.then(
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Apply to join the group
/// 申请加入组,需要通过管理员同意。
/// 申请加入组,需要通过管理员/群组同意。
/// [joinSource] 2通过邀请 3通过搜索 4通过二维码
Future<dynamic> joinGroup({
required String gid,
String? reason,
String? operationID,
int joinSource = 3,
}) =>
_channel.invokeMethod(
'joinGroup',
_buildParam({
'gid': gid,
'reason': reason,
'joinSource': joinSource,
'operationID': Utils.checkOperationID(operationID),
}));
/// Leave group
/// 退出组
Future<dynamic> quitGroup({
required String gid,
@@ -245,8 +264,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// Give group permissions to others
/// 转移组拥有者权限
/// [gid] 组ID
/// [uid] 新拥有者ID
Future<dynamic> transferGroupOwner({
required String gid,
required String uid,
@@ -260,8 +280,7 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// As the group owner or administrator, get the list of received group members' applications to join the group.
/// 作为群主或者管理员,获取收到的群成员申请进群列表。
/// 作为群主或者管理员,收到的群成员入群申请
Future<List<GroupApplicationInfo>> getRecvGroupApplicationList(
{String? operationID}) =>
_channel
@@ -273,7 +292,6 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
/// Get the record of the group membership application issued by yourself
/// 获取自己发出的入群申请记录
Future<List<GroupApplicationInfo>> getSendGroupApplicationList(
{String? operationID}) =>
@@ -286,8 +304,10 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
/// Accept group application
/// 管理员或者群主同意某人进入某群
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
/// [gid] 组id
/// [uid] 申请者用户ID
Future<dynamic> acceptGroupApplication({
required String gid,
required String uid,
@@ -303,8 +323,11 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// Refuse group application
/// 管理员或者群主拒绝某人进入某群
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
/// [gid] 组id
/// [uid] 申请者用户ID
/// [handleMsg] 说明
Future<dynamic> refuseGroupApplication({
required String gid,
required String uid,
@@ -320,6 +343,294 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 解散群
/// [groupID] 群ID
Future<dynamic> dismissGroup({
required String groupID,
String? operationID,
}) =>
_channel.invokeMethod(
'dismissGroup',
_buildParam({
'gid': groupID,
'operationID': Utils.checkOperationID(operationID),
}));
/// 开启群禁言,所有群成员禁止发言
/// [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),
}));
/// 禁言群成员
/// [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),
}));
/// 设置群成员昵称
/// [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),
}));
/// 查询群
/// [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)));
/// 设置群成员权限
/// [groupID] 群ID
/// [userID] 群成员的用户ID
/// [roleLevel] 角色等级,参考[GroupRoleLevel]
Future<dynamic> setGroupMemberRoleLevel({
required String groupID,
required String userID,
required int roleLevel,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupMemberRoleLevel',
_buildParam({
'groupID': groupID,
'userID': userID,
'roleLevel': roleLevel,
'operationID': Utils.checkOperationID(operationID),
}));
/// 根据加入时间分页获取组成员列表
/// [groupID] 群ID
/// [joinTimeBegin] 加入开始时间
/// [joinTimeEnd] 加入结束时间
/// [offset] 开始下标
/// [count] 总数
/// [excludeUserIDList] 排除的用户
Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({
required String groupID,
int offset = 0,
int count = 0,
int joinTimeBegin = 0,
int joinTimeEnd = 0,
List<String> excludeUserIDList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getGroupMemberListByJoinTimeFilter',
_buildParam({
'groupID': groupID,
'offset': offset,
'count': count,
'joinTimeBegin': joinTimeBegin,
'joinTimeEnd': joinTimeEnd,
'excludeUserIDList': excludeUserIDList,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// 进群验证设置
/// [groupID] 群ID
/// [needVerification] 进群设置,参考[GroupVerification]类
Future<dynamic> setGroupVerification({
required String groupID,
required int needVerification,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupVerification',
_buildParam({
'groupID': groupID,
'needVerification': needVerification,
'operationID': Utils.checkOperationID(operationID),
}));
/// 不允许通过群获取成员资料
/// [groupID] 群ID
/// [status] 0关闭1打开
Future<dynamic> setGroupLookMemberInfo({
required String groupID,
required int status,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupLookMemberInfo',
_buildParam({
'groupID': groupID,
'status': status,
'operationID': Utils.checkOperationID(operationID),
}));
/// 不允许通过群添加好友
/// [groupID] 群ID
/// [status] 0关闭1打开
Future<dynamic> setGroupApplyMemberFriend({
required String groupID,
required int status,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupApplyMemberFriend',
_buildParam({
'groupID': groupID,
'status': status,
'operationID': Utils.checkOperationID(operationID),
}));
/// 获取群拥有者,管理员
/// [groupId] 群ID
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
required String groupID,
String? operationID,
}) =>
_channel
.invokeMethod(
'getGroupMemberOwnerAndAdmin',
_buildParam({
'groupID': groupID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// 查询群
/// [groupID] 群id
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] 是否以关键词搜成员id
/// [isSearchMemberNickname] 是否以关键词搜索成员昵称
/// [offset] 开始index
/// [count] 每次获取的总数
Future<List<GroupMembersInfo>> searchGroupMembers({
required String groupID,
List<String> keywordList = const [],
bool isSearchUserID = false,
bool isSearchMemberNickname = false,
int offset = 0,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchGroupMembers',
_buildParam({
'searchParam': {
'groupID': groupID,
'keywordList': keywordList,
'isSearchUserID': isSearchUserID,
'isSearchMemberNickname': isSearchMemberNickname,
'offset': offset,
'count': count,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// 查询群
/// [groupID] 群id
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] 是否以关键词搜成员id
/// [isSearchMemberNickname] 是否以关键词搜索成员昵称
/// [offset] 开始index
/// [count] 每次获取的总数
Future<List<dynamic>> searchGroupMembersListMap({
required String groupID,
List<String> keywordList = const [],
bool isSearchUserID = false,
bool isSearchMemberNickname = false,
int offset = 0,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchGroupMembers',
_buildParam({
'searchParam': {
'groupID': groupID,
'keywordList': keywordList,
'isSearchUserID': isSearchUserID,
'isSearchMemberNickname': isSearchMemberNickname,
'offset': offset,
'count': count,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toListMap(value));
/// 修改GroupMemberInfo ex字段
Future<dynamic> setGroupMemberInfo({
required String groupID,
required String userID,
String? ex,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupMemberInfo',
_buildParam({
'info': {
'groupID': groupID,
'userID': userID,
'ex': ex,
},
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "groupManager";
return param;

View File

@@ -12,11 +12,16 @@ class IMManager {
late UserManager userManager;
// late OfflinePushManager offlinePushManager;
// late SignalingManager signalingManager;
late SignalingManager signalingManager;
late WorkMomentsManager workMomentsManager;
late OrganizationManager organizationManager;
late OnConnectListener _connectListener;
late String uid;
late UserInfo uInfo;
bool isLogined = false;
String? token;
String? _objectStorage;
IMManager(this._channel) {
conversationManager = ConversationManager(_channel);
@@ -25,7 +30,9 @@ class IMManager {
groupManager = GroupManager(_channel);
userManager = UserManager(_channel);
// offlinePushManager = OfflinePushManager(_channel);
// signalingManager = SignalingManager(_channel);
signalingManager = SignalingManager(_channel);
workMomentsManager = WorkMomentsManager(_channel);
organizationManager = OrganizationManager(_channel);
_addNativeCallback(_channel);
}
@@ -60,7 +67,7 @@ class IMManager {
switch (type) {
case 'onSelfInfoUpdated':
uInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
userManager.userListener.selfInfoUpdated(uInfo);
userManager.listener.selfInfoUpdated(uInfo);
break;
}
} else if (call.method == ListenerType.groupListener) {
@@ -70,69 +77,101 @@ class IMManager {
case 'onGroupApplicationAccepted':
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.groupListener.groupApplicationAccepted(i);
groupManager.listener.groupApplicationAccepted(i);
break;
case 'onGroupApplicationAdded':
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.groupListener.groupApplicationAdded(i);
groupManager.listener.groupApplicationAdded(i);
break;
case 'onGroupApplicationDeleted':
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.groupListener.groupApplicationDeleted(i);
groupManager.listener.groupApplicationDeleted(i);
break;
case 'onGroupApplicationRejected':
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.groupListener.groupApplicationRejected(i);
groupManager.listener.groupApplicationRejected(i);
break;
case 'onGroupInfoChanged':
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
groupManager.groupListener.groupInfoChanged(i);
groupManager.listener.groupInfoChanged(i);
break;
case 'onGroupMemberAdded':
final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.groupListener.groupMemberAdded(i);
groupManager.listener.groupMemberAdded(i);
break;
case 'onGroupMemberDeleted':
final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.groupListener.groupMemberDeleted(i);
groupManager.listener.groupMemberDeleted(i);
break;
case 'onGroupMemberInfoChanged':
final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.groupListener.groupMemberInfoChanged(i);
groupManager.listener.groupMemberInfoChanged(i);
break;
case 'onJoinedGroupAdded':
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
groupManager.groupListener.joinedGroupAdded(i);
groupManager.listener.joinedGroupAdded(i);
break;
case 'onJoinedGroupDeleted':
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
groupManager.groupListener.joinedGroupDeleted(i);
groupManager.listener.joinedGroupDeleted(i);
break;
}
} else if (call.method == ListenerType.advancedMsgListener) {
var type = call.arguments['type'];
var id = call.arguments['data']['id'];
// var id = call.arguments['data']['id'];
switch (type) {
case 'onRecvNewMessage':
var value = call.arguments['data']['newMessage'];
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.advancedMsgListener.recvNewMessage(msg);
messageManager.msgListener.recvNewMessage(msg);
break;
case 'onRecvMessageRevoked':
var value = call.arguments['data']['revokedMessage'];
messageManager.advancedMsgListener.recvMessageRevoked(value);
var msgID = call.arguments['data']['revokedMessage'];
messageManager.msgListener.recvMessageRevoked(msgID);
break;
case 'onRecvC2CReadReceipt':
var value = call.arguments['data']['haveReadMessage'];
var value = call.arguments['data']['c2cMessageReadReceipt'];
var list =
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;
case 'onNewRecvMessageRevoked':
var value = call.arguments['data']['revokedMessageV2'];
var info = Utils.toObj(value, (map) => RevokedInfo.fromJson(map));
messageManager.msgListener.recvMessageRevokedV2(info);
break;
case 'onRecvMessageExtensionsChanged':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['list'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener
.recvMessageExtensionsChanged(msgID, list);
break;
case 'onRecvMessageExtensionsDeleted':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['list'];
var list = Utils.toList(value, (map) => '$map');
messageManager.msgListener
.recvMessageExtensionsDeleted(msgID, list);
break;
case 'onRecvMessageExtensionsAdded':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['list'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener
.recvMessageExtensionsAdded(msgID, list);
break;
}
} else if (call.method == ListenerType.msgSendProgressListener) {
@@ -153,28 +192,27 @@ class IMManager {
dynamic data = call.arguments['data'];
switch (type) {
case 'onSyncServerStart':
conversationManager.conversationListener.syncServerStart();
conversationManager.listener.syncServerStart();
break;
case 'onSyncServerFinish':
conversationManager.conversationListener.syncServerFinish();
conversationManager.listener.syncServerFinish();
break;
case 'onSyncServerFailed':
conversationManager.conversationListener.syncServerFailed();
conversationManager.listener.syncServerFailed();
break;
case 'onNewConversation':
var list =
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
conversationManager.conversationListener.newConversation(list);
conversationManager.listener.newConversation(list);
break;
case 'onConversationChanged':
var list =
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
conversationManager.conversationListener
.conversationChanged(list);
conversationManager.listener.conversationChanged(list);
break;
case 'onTotalUnreadMessageCountChanged':
conversationManager.conversationListener
conversationManager.listener
.totalUnreadMessageCountChanged(data ?? 0);
break;
}
@@ -185,43 +223,134 @@ class IMManager {
switch (type) {
case 'onBlacklistAdded':
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
friendshipManager.friendshipListener.blacklistAdded(u);
friendshipManager.listener.blacklistAdded(u);
break;
case 'onBlacklistDeleted':
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
friendshipManager.friendshipListener.blacklistDeleted(u);
friendshipManager.listener.blacklistDeleted(u);
break;
case 'onFriendApplicationAccepted':
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.friendshipListener.friendApplicationAccepted(u);
friendshipManager.listener.friendApplicationAccepted(u);
break;
case 'onFriendApplicationAdded':
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.friendshipListener.friendApplicationAdded(u);
friendshipManager.listener.friendApplicationAdded(u);
break;
case 'onFriendApplicationDeleted':
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.friendshipListener.friendApplicationDeleted(u);
friendshipManager.listener.friendApplicationDeleted(u);
break;
case 'onFriendApplicationListRejected':
case 'onFriendApplicationRejected':
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.friendshipListener.friendApplicationRejected(u);
friendshipManager.listener.friendApplicationRejected(u);
break;
case 'onFriendInfoChanged':
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
friendshipManager.friendshipListener.friendInfoChanged(u);
friendshipManager.listener.friendInfoChanged(u);
break;
case 'onFriendAdded':
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
friendshipManager.friendshipListener.friendAdded(u);
friendshipManager.listener.friendAdded(u);
break;
case 'onFriendDeleted':
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'];
dynamic info;
switch (type) {
case 'onRoomParticipantConnected':
case 'onRoomParticipantDisconnected':
info = Utils.toObj(data, (map) => RoomCallingInfo.fromJson(map));
break;
case 'onStreamChange':
info =
Utils.toObj(data, (map) => MeetingStreamEvent.fromJson(map));
break;
case 'onReceiveCustomSignal':
info = Utils.toObj(data, (map) => CustomSignaling.fromJson(map));
break;
default:
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
break;
}
switch (type) {
case 'onInvitationCancelled':
signalingManager.listener.invitationCancelled(info);
break;
case 'onInvitationTimeout':
signalingManager.listener.invitationTimeout(info);
break;
case 'onInviteeAccepted':
signalingManager.listener.inviteeAccepted(info);
break;
case 'onInviteeRejected':
signalingManager.listener.inviteeRejected(info);
break;
case 'onReceiveNewInvitation':
signalingManager.listener.receiveNewInvitation(info);
break;
case 'onInviteeAcceptedByOtherDevice':
signalingManager.listener.inviteeAcceptedByOtherDevice(info);
break;
case 'onInviteeRejectedByOtherDevice':
signalingManager.listener.inviteeRejectedByOtherDevice(info);
break;
case 'onHangUp':
signalingManager.listener.hangup(info);
break;
case 'onRoomParticipantConnected':
signalingManager.listener.roomParticipantConnected(info);
break;
case 'onRoomParticipantDisconnected':
signalingManager.listener.roomParticipantDisconnected(info);
break;
case 'onStreamChange':
signalingManager.listener.streamChangedEvent(info);
break;
case 'onReceiveCustomSignal':
signalingManager.listener.receiveCustomSignal(info);
break;
}
} else if (call.method == ListenerType.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;
}
} else if (call.method == ListenerType.customBusinessListener) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onRecvCustomBusinessMessage':
messageManager.customBusinessListener
?.recvCustomBusinessMessage(data);
break;
}
} else if (call.method == ListenerType.messageKvInfoListener) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onMessageKvInfoChanged':
final list =
Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
break;
}
}
@@ -233,19 +362,15 @@ class IMManager {
});
}
/// Initialize SDK
///
/// [platform] platform number [IMPlatform]
/// [apiAddr] api server ip address
/// [wsAddr] webSocket ip address
/// [dataDir] data storage directory
///
/// 初始化SDK
///
/// [platform] 平台编号[IMPlatform]
/// [apiAddr] SDK api地址
/// [wsAddr] SDK websocket地址
/// [dataDir] SDK数据库存储目录
/// [objectStorage] 存储对象 cos/minio
/// [logLevel] 日志 1不打印
/// [enabledEncryption] true加密
/// [enabledCompression] true压缩
Future<dynamic> initSDK({
required int platform,
required String apiAddr,
@@ -254,9 +379,14 @@ class IMManager {
required OnConnectListener listener,
int logLevel = 6,
String objectStorage = 'cos',
String? encryptionKey,
bool enabledEncryption = false,
bool enabledCompression = false,
bool isExternalExtensions = false,
String? operationID,
}) {
_connectListener = listener;
this._connectListener = listener;
this._objectStorage = objectStorage;
return _channel.invokeMethod(
'initSDK',
_buildParam(
@@ -267,18 +397,23 @@ class IMManager {
"data_dir": dataDir,
"log_level": logLevel,
"object_storage": objectStorage,
"encryption_key": encryptionKey,
"is_need_encryption": enabledEncryption,
"is_compression ": enabledCompression,
"is_external_extensions": isExternalExtensions,
"operationID": Utils.checkOperationID(operationID),
},
));
}
@deprecated
/// 反初始化SDK
Future<dynamic> unInitSDK() {
return _channel.invokeMethod('unInitSDK', _buildParam({}));
}
/// Login sdk
/// 登录
/// [uid] 用户id
/// [token] 登录token从业务服务器上获取
Future<UserInfo> login({
required String uid,
required String token,
@@ -294,11 +429,11 @@ class IMManager {
);
this.isLogined = true;
this.uid = uid;
this.token = token;
this.uInfo = await userManager.getSelfUserInfo();
return uInfo;
}
/// Logout sdk
/// 登出
Future<dynamic> logout({String? operationID}) async {
var value = await _channel.invokeMethod(
@@ -307,21 +442,73 @@ class IMManager {
'operationID': Utils.checkOperationID(operationID),
}));
this.isLogined = false;
this.token = null;
return value;
}
///
/// 获取登录状态
Future<int?> getLoginStatus() =>
_channel.invokeMethod<int>('getLoginStatus', _buildParam({}));
/// Current user id
/// 获取当前登录用户id
Future<String> getLoginUserID() async => uid;
/// Current user info
/// 获取当前登录用户信息
Future<UserInfo> getLoginUserInfo() async => uInfo;
/// 从后台回到前台立刻唤醒
Future wakeUp({String? operationID}) => _channel.invokeMethod(
'wakeUp',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}));
/// 上传图片到服务器
/// [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),
}));
/// 更新firebase客户端注册token
/// [fcmToken] firebase token
Future updateFcmToken({
required String fcmToken,
String? operationID,
}) =>
_channel.invokeMethod(
'updateFcmToken',
_buildParam({
'fcmToken': fcmToken,
'operationID': Utils.checkOperationID(operationID),
}));
/// 标记app处于后台
Future setAppBackgroundStatus({
required bool isBackground,
String? operationID,
}) =>
_channel.invokeMethod(
'setAppBackgroundStatus',
_buildParam({
'isBackground': isBackground,
'operationID': Utils.checkOperationID(operationID),
}));
MethodChannel get channel => _channel;
static Map _buildParam(Map param) {
param["ManagerName"] = "imManager";
return param;

View File

@@ -6,14 +6,15 @@ class MessageManager {
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
OnMsgSendProgressListener? msgSendProgressListener;
late OnAdvancedMsgListener advancedMsgListener;
late OnAdvancedMsgListener msgListener;
OnCustomBusinessListener? customBusinessListener;
OnMessageKvInfoListener? messageKvInfoListener;
MessageManager(this._channel);
/// Set a message listener
/// 消息监听
Future setAdvancedMsgListener(OnAdvancedMsgListener listener) {
this.advancedMsgListener = listener;
this.msgListener = listener;
// advancedMsgListeners.add(listener);
return _channel.invokeMethod(
'setAdvancedMsgListener',
@@ -22,18 +23,16 @@ class MessageManager {
}));
}
/// Set up message sending progress monitoring
/// 消息发送进度监听
void setMsgSendProgressListener(OnMsgSendProgressListener listener) {
msgSendProgressListener = listener;
}
/// Send a message to user or to group
/// [userID] receiver's user ID
/// 发送消息
/// [userID]接收消息的用户id
/// [groupID]接收消息的id
/// [offlinePushInfo]离线消息显示内容
/// [message] 消息体
/// [userID] 接收消息的用户id
/// [groupID] 接收消息的组id
/// [offlinePushInfo] 离线消息显示内容
Future<Message> sendMessage({
required Message message,
required OfflinePushInfo offlinePushInfo,
@@ -53,13 +52,16 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Find all history message
/// 获取聊天记录
/// [userID]接收消息的用户id
/// [groupID]接收消息的组id
/// 获取聊天记录(以startMsg为节点以前的聊天记录)
/// [userID] 接收消息的用户id
/// [conversationID] 会话id查询通知时可用
/// [groupID] 接收消息的组id
/// [startMsg] 从这条消息开始查询[count]条获取的列表index==length-1为最新消息所以获取下一页历史记录startMsg=list.first
/// [count] 一次拉取的总数
Future<List<Message>> getHistoryMessageList({
String? userID,
String? groupID,
String? conversationID,
Message? startMsg,
int? count,
String? operationID,
@@ -70,14 +72,16 @@ class MessageManager {
_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)));
/// Revoke the sent information
/// 撤回消息
/// 撤回消息[revokeMessageV2]
/// [message] 被撤回消息
@deprecated
Future revokeMessage({
required Message message,
String? operationID,
@@ -89,8 +93,8 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
})));
/// Delete message
/// 删除消息
/// 删除本地消息
/// [message] 被删除消息
Future deleteMessageFromLocalStorage({
required Message message,
String? operationID,
@@ -102,37 +106,51 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
})));
///
// Future deleteMessages({required List<Message> msgList}) =>
// _channel.invokeMethod('deleteMessages',
// _buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
///
Future insertSingleMessageToLocalStorage({
/// 插入单聊消息到本地
/// [receiverID] 接收者id
/// [senderID] 发送者id
/// [message] 消息体
Future<Message> insertSingleMessageToLocalStorage({
String? receiverID,
String? senderID,
Message? message,
String? operationID,
}) =>
_channel.invokeMethod(
'insertSingleMessageToLocalStorage',
_buildParam({
"message": message?.toJson(),
"receiverID": receiverID,
"senderID": senderID,
"operationID": Utils.checkOperationID(operationID),
}));
_channel
.invokeMethod(
'insertSingleMessageToLocalStorage',
_buildParam({
"message": message?.toJson(),
"receiverID": receiverID,
"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}) =>
// _channel.invokeMethod(
// 'findMessages',
// _buildParam({
// "messageIDList": messageIDList,
// }));
/// 插入群聊消息到本地
/// [groupID] 群id
/// [senderID] 发送者id
/// [message] 消息体
Future<Message> insertGroupMessageToLocalStorage({
String? groupID,
String? senderID,
Message? message,
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
/// 标记c2c消息已读
/// 标记c2c单条消息已读
/// [userID] 消息来源的userID
/// [messageIDList] 消息clientMsgID集合
Future markC2CMessageAsRead({
required String userID,
required List<String> messageIDList,
@@ -146,8 +164,24 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Typing
/// 标记群聊消息已读
/// [groupID] 群id
/// [messageIDList] 消息clientMsgID集合
Future markGroupMessageAsRead({
required String groupID,
required List<String> messageIDList,
String? operationID,
}) =>
_channel.invokeMethod(
'markGroupMessageAsRead',
_buildParam({
"messageIDList": messageIDList,
"groupID": groupID,
"operationID": Utils.checkOperationID(operationID),
}));
/// 正在输入提示
/// [msgTip] 自定义内容
Future typingStatusUpdate({
required String userID,
String? msgTip,
@@ -161,7 +195,6 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Create text message
/// 创建文本消息
Future<Message> createTextMessage({
required String text,
@@ -176,11 +209,16 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create @ message
/// 创建@消息
/// [text] 输入内容
/// [atUserIDList] 被@到的userID集合
/// [atUserInfoList] userID跟nickname映射关系用在界面显示时将id替换为nickname
/// [quoteMessage] 引用消息(被回复的消息)
Future<Message> createTextAtMessage({
required String text,
required List<String> atUidList,
required List<String> atUserIDList,
List<AtUserInfo> atUserInfoList = const [],
Message? quoteMessage,
String? operationID,
}) =>
_channel
@@ -188,14 +226,16 @@ class MessageManager {
'createTextAtMessage',
_buildParam({
'text': text,
'atUserList': atUidList,
'atUserIDList': atUserIDList,
'atUserInfoList': atUserInfoList.map((e) => e.toJson()).toList(),
'quoteMessage': quoteMessage?.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create picture message
/// 创建图片消息
/// [imagePath] 路径
Future<Message> createImageMessage({
required String imagePath,
String? operationID,
@@ -210,8 +250,8 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create picture message
/// 创建图片消息
/// [imagePath] 路径
Future<Message> createImageMessageFromFullPath({
required String imagePath,
String? operationID,
@@ -226,8 +266,9 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create sound message
/// 创建语音消息
/// [soundPath] 路径
/// [duration] 时长s
Future<Message> createSoundMessage({
required String soundPath,
required int duration,
@@ -244,8 +285,9 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create sound message
/// 创建语音消息
/// [soundPath] 路径
/// [duration] 时长s
Future<Message> createSoundMessageFromFullPath({
required String soundPath,
required int duration,
@@ -262,8 +304,11 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create video message
/// 创建视频消息
/// [videoPath] 路径
/// [videoType] 视频mime类型
/// [duration] 时长s
/// [snapshotPath] 默认站位图路径
Future<Message> createVideoMessage({
required String videoPath,
required String videoType,
@@ -283,8 +328,11 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create video message
/// 创建视频消息
/// [videoPath] 路径
/// [videoType] 视频mime类型
/// [duration] 时长s
/// [snapshotPath] 默认站位图路径
Future<Message> createVideoMessageFromFullPath({
required String videoPath,
required String videoType,
@@ -304,8 +352,9 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create file message
/// 创建文件消息
/// [filePath] 路径
/// [fileName] 文件名
Future<Message> createFileMessage({
required String filePath,
required String fileName,
@@ -322,8 +371,9 @@ class MessageManager {
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
}
/// Create file message
/// 创建文件消息
/// [filePath] 路径
/// [fileName] 文件名
Future<Message> createFileMessageFromFullPath({
required String filePath,
required String fileName,
@@ -339,8 +389,10 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create merger message
/// 创建合并消息
/// [messageList] 被选中的消息
/// [title] 摘要标题
/// [summaryList] 摘要内容
Future<Message> createMergerMessage({
required List<Message> messageList,
required String title,
@@ -358,8 +410,8 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create forward message
/// 创建转发消息
/// [message] 被转发的消息
Future<Message> createForwardMessage({
required Message message,
String? operationID,
@@ -374,8 +426,10 @@ class MessageManager {
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
}
/// Create location message
/// 创建位置消息
/// [latitude] 纬度
/// [longitude] 经度
/// [description] 自定义描述信息
Future<Message> createLocationMessage({
required double latitude,
required double longitude,
@@ -393,8 +447,10 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create custom message
/// 创建自定义消息
/// [data] 自定义数据
/// [extension] 自定义扩展内容
/// [description] 自定义描述内容
Future<Message> createCustomMessage({
required String data,
required String extension,
@@ -412,8 +468,9 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create quote message
/// 创建引用消息
/// [text] 回复的内容
/// [quoteMsg] 被回复的消息
Future<Message> createQuoteMessage({
required String text,
required Message quoteMsg,
@@ -429,8 +486,8 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Create card message
/// 创建卡片消息
/// [data] 自定义数据
Future<Message> createCardMessage({
required Map<String, dynamic> data,
String? operationID,
@@ -444,8 +501,26 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// Clear all c2c history message
/// 创建自定义表情消息
/// [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)));
/// 清空单聊消息记录
/// [uid] 单聊对象id
Future<dynamic> clearC2CHistoryMessage({
required String uid,
String? operationID,
@@ -457,8 +532,8 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Clear all group history
/// 清空组消息记录
/// [gid] 组id
Future<dynamic> clearGroupHistoryMessage({
required String gid,
String? operationID,
@@ -470,6 +545,427 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// 搜索消息
/// [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)));
/// 删除本地跟服务器的指定的消息
/// [message] 被删除的消息
Future<dynamic> deleteMessageFromLocalAndSvr({
required Message message,
String? operationID,
}) =>
_channel.invokeMethod(
'deleteMessageFromLocalAndSvr',
_buildParam(message.toJson()
..addAll({
"operationID": Utils.checkOperationID(operationID),
})));
/// 删除本地所有聊天记录
Future<dynamic> deleteAllMsgFromLocal({
String? operationID,
}) =>
_channel.invokeMethod(
'deleteAllMsgFromLocal',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}));
/// 删除本地跟服务器所有聊天记录
Future<dynamic> deleteAllMsgFromLocalAndSvr({
String? operationID,
}) =>
_channel.invokeMethod(
'deleteAllMsgFromLocalAndSvr',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}));
/// 标记消息已读
/// [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),
}));
/// 删除本地跟服务器的单聊聊天记录
/// [uid] 聊天对象的userID
Future<dynamic> clearC2CHistoryMessageFromLocalAndSvr({
required String uid,
String? operationID,
}) =>
_channel.invokeMethod(
'clearC2CHistoryMessageFromLocalAndSvr',
_buildParam({
"userID": uid,
"operationID": Utils.checkOperationID(operationID),
}));
/// 删除本地跟服务器的群聊天记录
/// [gid] 组id
Future<dynamic> clearGroupHistoryMessageFromLocalAndSvr({
required String gid,
String? operationID,
}) =>
_channel.invokeMethod(
'clearGroupHistoryMessageFromLocalAndSvr',
_buildParam({
"groupID": gid,
"operationID": Utils.checkOperationID(operationID),
}));
/// 获取聊天记录(以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)));
/// 撤回消息
/// [message] 被撤回的消息体
Future revokeMessageV2({
required Message message,
String? operationID,
}) =>
_channel.invokeMethod(
'newRevokeMessage',
_buildParam(message.toJson()
..addAll({
"operationID": Utils.checkOperationID(operationID),
})));
/// 获取聊天记录(以startMsg为节点以前的聊天记录)
/// [userID] 接收消息的用户id
/// [conversationID] 会话id查询通知时可用
/// [groupID] 接收消息的组id
/// [startMsg] 从这条消息开始查询[count]条获取的列表index==length-1为最新消息所以获取下一页历史记录startMsg=list.first
/// [count] 一次拉取的总数
/// [lastMinSeq] 第一页消息不用传,获取第二页开始必传 跟[startMsg]一样
Future<AdvancedMessage> getAdvancedHistoryMessageList({
String? userID,
String? groupID,
String? conversationID,
int? lastMinSeq,
Message? startMsg,
int? count,
String? operationID,
}) =>
_channel
.invokeMethod(
'getAdvancedHistoryMessageList',
_buildParam({
'userID': userID ?? '',
'groupID': groupID ?? '',
'conversationID': conversationID ?? '',
'startClientMsgID': startMsg?.clientMsgID ?? '',
'count': count ?? 40,
'lastMinSeq': lastMinSeq ?? 0,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
/// 查找消息详细
/// [conversationID] 会话id
/// [clientMsgIDList] 消息id列表
Future<SearchResult> findMessageList({
required List<SearchParams> searchParams,
String? operationID,
}) =>
_channel
.invokeMethod(
'findMessageList',
_buildParam({
'searchParams': searchParams.map((e) => e.toJson()).toList(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
/// 富文本消息
/// [text] 输入内容
/// [list] 富文本消息具体详细
Future<Message> createAdvancedTextMessage({
required String text,
List<RichMessageInfo> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'createAdvancedTextMessage',
_buildParam({
'text': text,
'richMessageInfoList': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 富文本消息
/// [text] 回复的内容
/// [quoteMsg] 被回复的消息
/// [list] 富文本消息具体详细
Future<Message> createAdvancedQuoteMessage({
required String text,
required Message quoteMsg,
List<RichMessageInfo> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'createAdvancedQuoteMessage',
_buildParam({
'quoteText': text,
'quoteMessage': quoteMsg.toJson(),
'richMessageInfoList': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 发送消息
/// [message] 消息体 [createImageMessageByURL],[createSoundMessageByURL],[createVideoMessageByURL],[createFileMessageByURL]
/// [userID] 接收消息的用户id
/// [groupID] 接收消息的组id
/// [offlinePushInfo] 离线消息显示内容
Future<Message> sendMessageNotOss({
required Message message,
required OfflinePushInfo offlinePushInfo,
String? userID,
String? groupID,
String? operationID,
}) =>
_channel
.invokeMethod(
'sendMessageNotOss',
_buildParam({
'message': message.toJson(),
'offlinePushInfo': offlinePushInfo.toJson(),
'userID': userID ?? '',
'groupID': groupID ?? '',
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建图片消息
Future<Message> createImageMessageByURL({
required PictureInfo sourcePicture,
required PictureInfo bigPicture,
required PictureInfo snapshotPicture,
String? operationID,
}) =>
_channel
.invokeMethod(
'createImageMessageByURL',
_buildParam({
'sourcePicture': sourcePicture.toJson(),
'bigPicture': bigPicture.toJson(),
'snapshotPicture': snapshotPicture.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建语音消息
Future<Message> createSoundMessageByURL({
required SoundElem soundElem,
String? operationID,
}) =>
_channel
.invokeMethod(
'createSoundMessageByURL',
_buildParam({
'soundElem': soundElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建视频消息
Future<Message> createVideoMessageByURL({
required VideoElem videoElem,
String? operationID,
}) =>
_channel
.invokeMethod(
'createVideoMessageByURL',
_buildParam({
'videoElem': videoElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建视频消息
Future<Message> createFileMessageByURL({
required FileElem fileElem,
String? operationID,
}) =>
_channel
.invokeMethod(
'createFileMessageByURL',
_buildParam({
'fileElem': fileElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 用户资料改变监听
Future setCustomBusinessListener(OnCustomBusinessListener listener) {
this.customBusinessListener = listener;
return _channel.invokeMethod('setCustomBusinessListener', _buildParam({}));
}
///
Future setMessageKvInfoListener(OnMessageKvInfoListener listener) {
this.messageKvInfoListener = listener;
return _channel.invokeMethod('setMessageKvInfoListener', _buildParam({}));
}
Future<List<TypeKeySetResult>> setMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'setMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<TypeKeySetResult>> deleteMessageReactionExtensions({
required Message message,
List<String> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'deleteMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListReactionExtensions({
List<Message> messageList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(
value, (map) => MessageTypeKeyMapping.fromJson(map)));
Future<List<TypeKeySetResult>> addMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'addMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListSomeReactionExtensions({
List<Message> messageList = const [],
List<KeyValue> kvList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListSomeReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
'list': kvList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(
value, (map) => MessageTypeKeyMapping.fromJson(map)));
static Map _buildParam(Map param) {
param["ManagerName"] = "messageManager";
return param;

View File

@@ -0,0 +1,162 @@
import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OrganizationManager {
MethodChannel _channel;
late OnOrganizationListener listener;
OrganizationManager(this._channel);
/// 组织架构发生变化回调
Future setOrganizationListener(OnOrganizationListener listener) {
this.listener = listener;
return _channel.invokeMethod('setOrganizationListener', _buildParam({}));
}
/// 获取子部门列表,返回当前部门下的一级子部门
/// [departmentID] 当前部门id
/// [offset] 开始下标
/// [count] 每页大小
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)));
/// 获取部门下的成员列表,返回当前部门下的一级成员
/// [departmentID] 当前部门id
/// [offset] 开始下标
/// [count] 每页大小
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)));
/// 获取成员所在的部门
/// [userID] 成员ID
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)));
/// 获取部门下的子部门跟员工
/// [departmentID] 当前部门id
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)));
/// 查询部门信息
/// [departmentID] 部门ID
Future<DeptInfo> getDeptInfo({
required String departmentID,
String? operationID,
}) =>
_channel
.invokeMethod(
'getDepartmentInfo',
_buildParam({
'departmentID': departmentID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (v) => DeptInfo.fromJson(v)));
/// 搜索组织人员
/// [keyWord] 关键字
/// [isSearchUserName] 是否匹配用户名
/// [isSearchEnglishName] 是否匹配英文名
/// [isSearchPosition] 是否匹配职位
/// [isSearchUserID] 是否匹配用户ID
/// [isSearchMobile] 是否匹配手机号
/// [isSearchEmail] 是否匹配邮箱号
/// [isSearchTelephone] 是否匹配电话号码
/// [offset] 开始下标
/// [count] 分页大小
Future<OrganizationSearchResult> searchOrganization({
required String keyWord,
bool isSearchUserName = false,
bool isSearchEnglishName = false,
bool isSearchPosition = false,
bool isSearchUserID = false,
bool isSearchMobile = false,
bool isSearchEmail = false,
bool isSearchTelephone = false,
int offset = 0,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchOrganization',
_buildParam({
'searchParam': {
'keyWord': keyWord,
'isSearchUserName': isSearchUserName,
'isSearchEnglishName': isSearchEnglishName,
'isSearchPosition': isSearchPosition,
'isSearchUserID': isSearchUserID,
'isSearchMobile': isSearchMobile,
'isSearchEmail': isSearchEmail,
'isSearchTelephone': isSearchTelephone,
},
'offset': offset,
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (v) => OrganizationSearchResult.fromJson(v)));
static Map _buildParam(Map param) {
param["ManagerName"] = "organizationManager";
return param;
}
}

View File

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

View File

@@ -3,19 +3,18 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class UserManager {
MethodChannel _channel;
late OnUserListener userListener;
late OnUserListener listener;
UserManager(this._channel);
/// Observe user info changes
/// 用户资料改变监听
Future setUserListener(OnUserListener listener) {
this.userListener = listener;
this.listener = listener;
return _channel.invokeMethod('setUserListener', _buildParam({}));
}
/// Query user information
/// 获取用户资料
/// [uidList] 用户ID列表
Future<List<UserInfo>> getUsersInfo({
required List<String> uidList,
String? operationID,
@@ -29,7 +28,6 @@ class UserManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
/// Get the information of the currently logged in user
/// 获取当前登录用户的信息
Future<UserInfo> getSelfUserInfo({
String? operationID,
@@ -42,8 +40,15 @@ class UserManager {
}))
.then((value) => Utils.toObj(value, (map) => UserInfo.fromJson(map)));
/// Modify current user info
/// 修改当前登录用户资料
/// [nickname] 昵称
/// [faceURL] 头像
/// [gender] 性别
/// [appMangerLevel]
/// [phoneNumber] 手机号
/// [birth] 出生日期
/// [email] 邮箱
/// [ex] 扩展字段
Future<String?> setSelfInfo({
String? nickname,
String? faceURL,

View File

@@ -0,0 +1,61 @@
import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class WorkMomentsManager {
MethodChannel _channel;
late OnWorkMomentsListener listener;
WorkMomentsManager(this._channel);
/// 朋友圈信息发送变化通知
Future setWorkMomentsListener(OnWorkMomentsListener listener) {
this.listener = listener;
return _channel.invokeMethod('setWorkMomentsListener', _buildParam({}));
}
/// 获取朋友圈未读消息总数
Future<int> getWorkMomentsUnReadCount({
String? operationID,
}) =>
_channel
.invokeMethod(
'getWorkMomentsUnReadCount',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => map['unreadCount']));
/// 获取通知列表
/// [offset] 开始下标
/// [count] 每页大小
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)));
/// 清除通知列表
Future clearWorkMomentsNotification({
String? operationID,
}) =>
_channel.invokeMethod(
'clearWorkMomentsNotification',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "workMomentsManager";
return param;
}
}

View File

@@ -3,38 +3,83 @@ import 'dart:convert';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class ConversationInfo {
/// 会话ID
String conversationID;
/// [ConversationType]
/// 会话类型[ConversationType]
int? conversationType;
/// 参与会话的userID
String? userID;
/// 参与会话的groupID
String? groupID;
/// 昵称
String? showName;
/// 头像
String? faceURL;
/// 免打扰 0正常1不接受消息2接受在线消息不接受离线消息
int? recvMsgOpt;
/// 未读消息数
int? unreadCount;
/// 强制提示,[GroupAtType]包含@所有人,@个人以及公告提示
int? groupAtType;
/// 会话最新消息内容
Message? latestMsg;
/// 最新消息发送时间
int? latestMsgSendTime;
/// 草稿
String? draftText;
/// 草稿生成时间
int? draftTextTime;
/// 是否置顶
bool? isPinned;
/// 是否开启了私聊(阅后即焚)
bool? isPrivateChat;
/// 可阅读期限 s
int? burnDuration;
/// 附加内容
String? ext;
ConversationInfo(
{required this.conversationID,
this.conversationType,
this.userID,
this.groupID,
this.showName,
this.faceURL,
this.recvMsgOpt,
this.unreadCount,
this.latestMsg,
this.latestMsgSendTime,
this.draftText,
this.draftTextTime,
this.isPinned});
/// 附加内容
String? ex;
/// 是否还在组内如果退群返回true
bool? isNotInGroup;
ConversationInfo({
required this.conversationID,
this.conversationType,
this.userID,
this.groupID,
this.showName,
this.faceURL,
this.recvMsgOpt,
this.unreadCount,
this.latestMsg,
this.latestMsgSendTime,
this.draftText,
this.draftTextTime,
this.isPrivateChat,
this.burnDuration,
this.isPinned,
this.isNotInGroup,
this.ex,
this.ext,
});
ConversationInfo.fromJson(Map<String, dynamic> json)
: conversationID = json['conversationID'] {
@@ -56,6 +101,12 @@ class ConversationInfo {
draftText = json['draftText'];
draftTextTime = json['draftTextTime'];
isPinned = json['isPinned'];
isPrivateChat = json['isPrivateChat'];
burnDuration = json['burnDuration'];
isNotInGroup = json['isNotInGroup'];
groupAtType = json['groupAtType'];
ex = json['ex'];
ext = json['ext'];
}
Map<String, dynamic> toJson() {
@@ -73,12 +124,25 @@ class ConversationInfo {
data['draftText'] = this.draftText;
data['draftTextTime'] = this.draftTextTime;
data['isPinned'] = this.isPinned;
data['isPrivateChat'] = this.isPrivateChat;
data['burnDuration'] = this.burnDuration;
data['isNotInGroup'] = this.isNotInGroup;
data['groupAtType'] = this.groupAtType;
data['ex'] = this.ex;
data['ext'] = this.ext;
return data;
}
/// 是单聊
bool get isSingleChat => conversationType == ConversationType.single;
bool get isGroupChat => conversationType == ConversationType.group;
/// 是群聊
bool get isGroupChat =>
conversationType == ConversationType.group ||
conversationType == ConversationType.superGroup;
/// 是有效的
bool get isValid => isSingleChat || isGroupChat && !isNotInGroup!;
@override
bool operator ==(Object other) =>

View File

@@ -1,17 +1,58 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 群信息
class GroupInfo {
/// 群ID
String groupID;
/// 群名
String? groupName;
/// 群公告
String? notification;
/// 群简介
String? introduction;
/// 群头像
String? faceURL;
/// 拥有者ID
String? ownerUserID;
/// 创建时间
int? createTime;
/// 群成员数
int? memberCount;
/// 群状态0正常1被封2解散3禁言
int? status;
/// 创建者ID
String? creatorUserID;
/// 群类型[GroupType]
int? groupType;
/// 扩展字段
String? ex;
/// 进群验证方式[GroupVerification]
int? needVerification;
/// 不允许通过群获取成员资料 0关闭1打开
int? lookMemberInfo;
/// 不允许通过群添加好友 0关闭1打开
int? applyMemberFriend;
/// 通知更新时间
int? notificationUpdateTime;
/// 通知发起人
String? notificationUserID;
GroupInfo({
required this.groupID,
this.groupName,
@@ -25,6 +66,11 @@ class GroupInfo {
this.creatorUserID,
this.groupType,
this.ex,
this.needVerification,
this.lookMemberInfo,
this.applyMemberFriend,
this.notificationUpdateTime,
this.notificationUserID,
});
GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] {
@@ -40,6 +86,11 @@ class GroupInfo {
creatorUserID = json['creatorUserID'];
groupType = json['groupType'];
ex = json['ex'];
needVerification = json['needVerification'];
lookMemberInfo = json['lookMemberInfo'];
applyMemberFriend = json['applyMemberFriend'];
notificationUpdateTime = json['notificationUpdateTime'];
notificationUserID = json['notificationUserID'];
}
Map<String, dynamic> toJson() {
@@ -56,20 +107,67 @@ class GroupInfo {
data['creatorUserID'] = this.creatorUserID;
data['groupType'] = this.groupType;
data['ex'] = this.ex;
data['needVerification'] = this.needVerification;
data['lookMemberInfo'] = this.lookMemberInfo;
data['applyMemberFriend'] = this.applyMemberFriend;
data['notificationUpdateTime'] = this.notificationUpdateTime;
data['notificationUserID'] = this.notificationUserID;
return data;
}
/// 群类型对应的会话类型
int get sessionType => groupType == GroupType.general
? ConversationType.group
: ConversationType.superGroup;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GroupInfo &&
runtimeType == other.runtimeType &&
groupID == other.groupID;
@override
int get hashCode => groupID.hashCode;
}
/// 群成员信息
class GroupMembersInfo {
/// 群id
String? groupID;
/// 用户id
String? userID;
/// 昵称
String? nickname;
/// 头像
String? faceURL;
/// 角色[GroupRoleLevel]
int? roleLevel;
/// 加入时间
int? joinTime;
/// 入群方式 2邀请加入 3搜索加入 4通过二维码加入
int? joinSource;
/// 操作者id
String? operatorUserID;
String? ext;
/// 扩展字段
String? ex;
/// 禁言时间s
int? muteEndTime;
///
int? appMangerLevel;
/// 邀请人id
String? inviterUserID;
GroupMembersInfo({
this.groupID,
@@ -78,9 +176,12 @@ class GroupMembersInfo {
this.joinTime,
this.nickname,
this.faceURL,
this.ext,
this.ex,
this.joinSource,
this.operatorUserID,
this.muteEndTime,
this.appMangerLevel,
this.inviterUserID,
});
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
@@ -90,9 +191,12 @@ class GroupMembersInfo {
joinTime = json['joinTime'];
nickname = json['nickname'];
faceURL = json['faceURL'];
ext = json['ext'];
ex = json['ex'];
joinSource = json['joinSource'];
operatorUserID = json['operatorUserID'];
muteEndTime = json['muteEndTime'];
appMangerLevel = json['appMangerLevel'];
inviterUserID = json['inviterUserID'];
}
Map<String, dynamic> toJson() {
@@ -103,18 +207,33 @@ class GroupMembersInfo {
data['joinTime'] = this.joinTime;
data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL;
data['ext'] = this.ext;
data['ex'] = this.ex;
data['joinSource'] = this.joinSource;
data['operatorUserID'] = this.operatorUserID;
data['muteEndTime'] = this.muteEndTime;
data['appMangerLevel'] = this.appMangerLevel;
data['inviterUserID'] = this.inviterUserID;
return data;
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GroupMembersInfo &&
runtimeType == other.runtimeType &&
groupID == other.groupID &&
userID == other.userID;
@override
int get hashCode => groupID.hashCode ^ userID.hashCode;
}
/// 群成员角色
class GroupMemberRole {
/// 用户ID
String? userID;
/// 1 ordinary member, 2 group owners, 3 administrators
/// 1普通成员, 2群主3管理员
/// [GroupRoleLevel] 1普通成员, 2群主3管理员
int? roleLevel;
GroupMemberRole({this.userID, this.roleLevel = 1});
@@ -132,33 +251,80 @@ class GroupMemberRole {
}
}
/// 群申请信息
class GroupApplicationInfo {
/// 群ID
String? groupID;
/// 群昵称
String? groupName;
/// 群公告
String? notification;
/// 群介绍
String? introduction;
/// 群头像
String? groupFaceURL;
/// 群创建时间
int? createTime;
/// 群状态
int? status;
/// 创建者id
String? creatorUserID;
/// 群类型
int? groupType;
/// 拥有者id
String? ownerUserID;
/// 成员数量
int? memberCount;
/// 发起入群申请的用户id
String? userID;
/// 发起入群申请的用户昵称
String? nickname;
/// 发起入群申请的用户头像
String? userFaceURL;
/// 发起入群申请的用户性别
int? gender;
/// REFUSE = -1, AGREE = 1
/// -1拒绝1同意
/// 处理结果:-1拒绝1同意
int? handleResult;
/// 请求说明
String? reqMsg;
/// 处理结果说明
String? handledMsg;
/// 请求时间
int? reqTime;
/// 处理者用户ID
String? handleUserID;
/// 处理时间
int? handledTime;
/// 扩展信息
String? ex;
/// 2通过邀请 3通过搜索 4通过二维码
int? joinSource;
/// 邀请进群用户ID
String? inviterUserID;
GroupApplicationInfo({
this.groupID,
this.groupName,
@@ -182,6 +348,8 @@ class GroupApplicationInfo {
this.handleUserID,
this.handledTime,
this.ex,
this.inviterUserID,
this.joinSource,
});
GroupApplicationInfo.fromJson(Map<String, dynamic> json) {
@@ -207,6 +375,8 @@ class GroupApplicationInfo {
handleUserID = json['handleUserID'];
handledTime = json['handledTime'];
ex = json['ex'];
inviterUserID = json['inviterUserID'];
joinSource = json['joinSource'];
}
Map<String, dynamic> toJson() {
@@ -233,6 +403,8 @@ class GroupApplicationInfo {
data['handleUserID'] = this.handleUserID;
data['handledTime'] = this.handledTime;
data['ex'] = this.ex;
data['inviterUserID'] = this.inviterUserID;
data['joinSource'] = this.joinSource;
return data;
}
}

View File

@@ -0,0 +1,106 @@
class MeetingInfoList {
List<MeetingInfo>? meetingInfoList;
MeetingInfoList({this.meetingInfoList});
MeetingInfoList.fromJson(Map<String, dynamic> json) {
if (json['meetingInfoList'] != null) {
meetingInfoList = <MeetingInfo>[];
json['meetingInfoList'].forEach((v) {
meetingInfoList!.add(MeetingInfo.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.meetingInfoList != null) {
data['meetingInfoList'] =
this.meetingInfoList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class MeetingInfo {
String? meetingID;
String? meetingName;
String? hostUserID;
int? createTime;
int? startTime;
int? endTime;
bool? participantCanEnableVideo;
bool? onlyHostInviteUser;
bool? joinDisableVideo;
bool? participantCanUnmuteSelf;
bool? isMuteAllMicrophone;
List<String>? inviteeUserIDList;
MeetingInfo(
{this.meetingID,
this.meetingName,
this.hostUserID,
this.createTime,
this.startTime,
this.endTime,
this.participantCanEnableVideo,
this.onlyHostInviteUser,
this.joinDisableVideo,
this.participantCanUnmuteSelf,
this.isMuteAllMicrophone,
this.inviteeUserIDList});
MeetingInfo.fromJson(Map<String, dynamic> json) {
meetingID = json['meetingID'];
meetingName = json['meetingName'];
hostUserID = json['hostUserID'];
createTime = json['createTime'];
startTime = json['startTime'];
endTime = json['endTime'];
participantCanEnableVideo = json['participantCanEnableVideo'];
onlyHostInviteUser = json['onlyHostInviteUser'];
joinDisableVideo = json['joinDisableVideo'];
participantCanUnmuteSelf = json['participantCanUnmuteSelf'];
isMuteAllMicrophone = json['isMuteAllMicrophone'];
inviteeUserIDList = json['inviteeUserIDList']?.cast<String>();
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['meetingID'] = this.meetingID;
data['meetingName'] = this.meetingName;
data['hostUserID'] = this.hostUserID;
data['createTime'] = this.createTime;
data['startTime'] = this.startTime;
data['endTime'] = this.endTime;
data['participantCanEnableVideo'] = this.participantCanEnableVideo;
data['onlyHostInviteUser'] = this.onlyHostInviteUser;
data['joinDisableVideo'] = this.joinDisableVideo;
data['participantCanUnmuteSelf'] = this.participantCanUnmuteSelf;
data['isMuteAllMicrophone'] = this.isMuteAllMicrophone;
data['inviteeUserIDList'] = this.inviteeUserIDList;
return data;
}
}
class MeetingStreamEvent {
String? meetingID;
String? streamType;
bool? mute;
MeetingStreamEvent({this.meetingID, this.streamType, this.mute});
MeetingStreamEvent.fromJson(Map<String, dynamic> json) {
meetingID = json['meetingID'];
streamType = json['streamType'];
mute = json['mute'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['meetingID'] = this.meetingID;
data['streamType'] = this.streamType;
data['mute'] = this.mute;
return data;
}
}

View File

@@ -1,42 +1,114 @@
import 'dart:io';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class Message {
/// 消息id唯一标识
String? clientMsgID;
/// 服务端生成的id
String? serverMsgID;
/// 创建时间
int? createTime;
/// 发送时间
int? sendTime;
/// [ConversationType]
/// 会话类型[ConversationType]
int? sessionType;
/// 发送者id
String? sendID;
/// 接收者id
String? recvID;
/// 来源
int? msgFrom;
/// [MessageType]
/// 消息类型[MessageType]
int? contentType;
/// 平台[Platform]
int? platformID;
/// 发送者昵称
String? senderNickname;
/// 发送者头像
String? senderFaceUrl;
/// 群ID
String? groupID;
/// 消息内容
String? content;
/// 消息的seq
int? seq;
/// 是否已读
bool? isRead;
/// [MessageStatus]
/// 已读时间
int? hasReadTime;
/// 消息发送状态[MessageStatus]
int? status;
/// 离线显示内容
OfflinePushInfo? offlinePush;
/// 附加信息
String? attachedInfo;
/// 扩展信息
String? ex;
/// 自定义扩展信息,目前用于客服端处理消息时间分段
dynamic ext;
/// 图片
PictureElem? pictureElem;
/// 语音
SoundElem? soundElem;
/// 视频
VideoElem? videoElem;
/// 文件
FileElem? fileElem;
/// @信息
AtElem? atElem;
/// 位置
LocationElem? locationElem;
/// 自定义
CustomElem? customElem;
/// 引用
QuoteElem? quoteElem;
/// 合并
MergeElem? mergeElem;
/// 通知
NotificationElem? notificationElem;
/// 自定义表情
FaceElem? faceElem;
/// 附加信息
AttachedInfoElem? attachedInfoElem;
bool? isReact;
bool? isExternal;
Message({
this.clientMsgID,
this.serverMsgID,
@@ -54,6 +126,7 @@ class Message {
this.content,
this.seq,
this.isRead,
this.hasReadTime,
this.status,
this.offlinePush,
this.attachedInfo,
@@ -69,6 +142,10 @@ class Message {
this.quoteElem,
this.mergeElem,
this.notificationElem,
this.faceElem,
this.attachedInfoElem,
this.isExternal,
this.isReact,
});
Message.fromJson(Map<String, dynamic> json) {
@@ -123,6 +200,14 @@ class Message {
notificationElem = json['notificationElem'] != null
? NotificationElem.fromJson(json['notificationElem'])
: null;
faceElem =
json['faceElem'] != null ? FaceElem.fromJson(json['faceElem']) : null;
attachedInfoElem = json['attachedInfoElem'] != null
? AttachedInfoElem.fromJson(json['attachedInfoElem'])
: null;
hasReadTime = json['hasReadTime'] ?? attachedInfoElem?.hasReadTime;
isExternal = json['isExternal'];
isReact = json['isReact'];
}
Map<String, dynamic> toJson() {
@@ -142,6 +227,7 @@ class Message {
data['content'] = this.content;
data['seq'] = this.seq;
data['isRead'] = this.isRead;
data['hasReadTime'] = this.hasReadTime;
data['status'] = this.status;
data['offlinePush'] = this.offlinePush?.toJson();
data['attachedInfo'] = this.attachedInfo;
@@ -158,6 +244,10 @@ class Message {
data['quoteElem'] = this.quoteElem?.toJson();
data['mergeElem'] = this.mergeElem?.toJson();
data['notificationElem'] = this.notificationElem?.toJson();
data['faceElem'] = this.faceElem?.toJson();
data['attachedInfoElem'] = this.attachedInfoElem?.toJson();
data['isExternal'] = this.isExternal;
data['isReact'] = this.isReact;
return data;
}
@@ -172,8 +262,7 @@ class Message {
int get hashCode => clientMsgID.hashCode;
void update(Message message) {
if (clientMsgID != message.clientMsgID) return;
// clientMsgID = message.clientMsgID;
if (this != message) return;
serverMsgID = message.serverMsgID;
createTime = message.createTime;
sendTime = message.sendTime;
@@ -188,6 +277,7 @@ class Message {
content = message.content;
seq = message.seq;
isRead = message.isRead;
hasReadTime = message.hasReadTime;
status = message.status;
offlinePush = message.offlinePush;
attachedInfo = message.attachedInfo;
@@ -204,13 +294,31 @@ class Message {
quoteElem = message.quoteElem;
mergeElem = message.mergeElem;
notificationElem = message.notificationElem;
faceElem = message.faceElem;
attachedInfoElem = message.attachedInfoElem;
}
/// 单聊消息
bool get isSingleChat => sessionType == ConversationType.single;
/// 群聊消息
bool get isGroupChat =>
sessionType == ConversationType.group ||
sessionType == ConversationType.superGroup;
}
/// 图片消息内容
class PictureElem {
/// 原路径
String? sourcePath;
/// 原图对象
PictureInfo? sourcePicture;
/// 大图对象
PictureInfo? bigPicture;
/// 缩率图对象
PictureInfo? snapshotPicture;
PictureElem(
@@ -248,12 +356,24 @@ class PictureElem {
}
}
/// 图片信息
class PictureInfo {
/// id
String? uuid;
/// 图片mime类型
String? type;
/// 大小
int? size;
/// 宽度
int? width;
/// 长度
int? height;
/// 图片URL地址
String? url;
PictureInfo(
@@ -280,11 +400,21 @@ class PictureInfo {
}
}
/// 语音消息内容
class SoundElem {
/// id
String? uuid;
/// 原路径
String? soundPath;
/// url地址
String? sourceUrl;
/// 大小
int? dataSize;
/// 时间s
int? duration;
SoundElem(
@@ -313,18 +443,42 @@ class SoundElem {
}
}
/// 视频消息内容
class VideoElem {
/// 视频路径
String? videoPath;
/// uuid
String? videoUUID;
/// 视频的url地址
String? videoUrl;
/// mime类型
String? videoType;
/// 大小
int? videoSize;
/// 时长s
int? duration;
/// 缩率图路径
String? snapshotPath;
/// 缩率图uuid
String? snapshotUUID;
/// 缩率图大小
int? snapshotSize;
/// 缩率图URL地址
String? snapshotUrl;
/// 缩率图宽度
int? snapshotWidth;
/// 缩率图高度
int? snapshotHeight;
VideoElem(
@@ -374,11 +528,21 @@ class VideoElem {
}
}
/// 文件消息内容
class FileElem {
/// 文件路径
String? filePath;
/// uuid
String? uuid;
/// 文件URL地址
String? sourceUrl;
/// 文件名
String? fileName;
/// 文件大小
int? fileSize;
FileElem(
@@ -403,12 +567,30 @@ class FileElem {
}
}
/// @消息内容
class AtElem {
/// 消息内容
String? text;
/// 被@的用户ID列表
List<String>? atUserList;
/// 是否包含自己
bool? isAtSelf;
AtElem({this.text, this.atUserList, this.isAtSelf});
/// 被@的用户ID跟昵称关系列表用于将消息内容里的用户id替换为昵称显示
List<AtUserInfo>? atUsersInfo;
/// 被回复的消息体,回复别人并@了人
Message? quoteMessage;
AtElem({
this.text,
this.atUserList,
this.isAtSelf,
this.atUsersInfo,
this.quoteMessage,
});
AtElem.fromJson(Map<String, dynamic> json) {
text = json['text'];
@@ -416,6 +598,14 @@ class AtElem {
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
}
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() {
@@ -423,13 +613,21 @@ class AtElem {
data['text'] = this.text;
data['atUserList'] = this.atUserList;
data['isAtSelf'] = this.isAtSelf;
data['atUsersInfo'] = this.atUsersInfo?.map((e) => e.toJson()).toList();
data['quoteMessage'] = this.quoteMessage?.toJson();
return data;
}
}
/// 位置消息内日
class LocationElem {
/// 位置描述
String? description;
/// 经度
double? longitude;
/// 纬度
double? latitude;
LocationElem({this.description, this.longitude, this.latitude});
@@ -458,9 +656,15 @@ class LocationElem {
}
}
/// 自定义消息
class CustomElem {
/// 自定义数据
String? data;
/// 扩展内容
String? extension;
/// 描述内容
String? description;
CustomElem({this.data, this.extension, this.description});
@@ -480,8 +684,12 @@ class CustomElem {
}
}
/// 引用消息(被回复的消息)
class QuoteElem {
/// 回复内容内容
String? text;
/// 被回复的消息体
Message? quoteMessage;
QuoteElem({this.text, this.quoteMessage});
@@ -501,9 +709,15 @@ class QuoteElem {
}
}
/// 合并消息体
class MergeElem {
/// 标题
String? title;
/// 摘要
List<String>? abstractList;
/// 具体选择合并的消息列表
List<Message>? multiMessage;
MergeElem({this.title, this.abstractList, this.multiMessage});
@@ -529,8 +743,12 @@ class MergeElem {
}
}
/// 通知
class NotificationElem {
/// 详情
String? detail;
/// 提示
String? defaultTips;
NotificationElem({this.detail, this.defaultTips});
@@ -548,16 +766,132 @@ class NotificationElem {
}
}
/// 表情
class FaceElem {
/// 位置表情,用户端对端自定义内嵌的表情包
int? index;
/// 其他表情如URL表情直接返回url
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;
/// 阅读时长 s
/// 即从hasReadTime时间算起超过了burnDuration秒触发销毁
int? burnDuration;
/// 离线不发送推送
bool? notSenderNotificationPush;
AttachedInfoElem({
this.groupHasReadInfo,
this.isPrivateChat,
this.hasReadTime,
this.burnDuration,
this.notSenderNotificationPush,
});
AttachedInfoElem.fromJson(Map<String, dynamic> json) {
groupHasReadInfo = json['groupHasReadInfo'] == null
? null
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
isPrivateChat = json['isPrivateChat'];
hasReadTime = json['hasReadTime'];
burnDuration = json['burnDuration'];
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['burnDuration'] = this.burnDuration;
data['notSenderNotificationPush'] = this.notSenderNotificationPush;
return data;
}
}
/// 群消息已读信息
class GroupHasReadInfo {
/// 已读的用户id列表
List<String>? hasReadUserIDList;
/// 已读总数
int? hasReadCount;
/// 发送此条消息时的群人数
int? groupMemberCount;
GroupHasReadInfo.fromJson(Map<String, dynamic> json) {
if (json['hasReadUserIDList'] == null) {
hasReadUserIDList = <String>[];
} else {
hasReadUserIDList = (json['hasReadUserIDList'] as List).cast<String>();
}
hasReadCount = json['hasReadCount'] ?? 0;
groupMemberCount = json['groupMemberCount'] ?? 0;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['hasReadUserIDList'] = this.hasReadUserIDList;
data['hasReadCount'] = this.hasReadCount;
data['groupMemberCount'] = this.groupMemberCount;
return data;
}
}
/// 消息已读回执信息
class ReadReceiptInfo {
String? uid;
/// 发送者id
String? userID;
/// 群id
String? groupID;
/// 已读消息的clientMsgID集合
List<String>? msgIDList;
/// 读时间
int? readTime;
/// 消息来源
int? msgFrom;
/// 消息类型[MessageType]
int? contentType;
/// 会话类型[ConversationType]
int? sessionType;
ReadReceiptInfo(
{this.uid,
{this.userID,
this.groupID,
this.msgIDList,
this.readTime,
this.msgFrom,
@@ -565,7 +899,8 @@ class ReadReceiptInfo {
this.sessionType});
ReadReceiptInfo.fromJson(Map<String, dynamic> json) {
uid = json['uid'];
userID = json['uid'] ?? json['userID'];
groupID = json['groupID'];
if (json['msgIDList'] is List) {
msgIDList = (json['msgIDList'] as List).map((e) => '$e').toList();
}
@@ -577,7 +912,7 @@ class ReadReceiptInfo {
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['uid'] = this.uid;
data['userID'] = this.userID;
data['msgIDList'] = this.msgIDList;
data['readTime'] = this.readTime;
data['msgFrom'] = this.msgFrom;
@@ -587,11 +922,21 @@ class ReadReceiptInfo {
}
}
/// 离线推送信息
class OfflinePushInfo {
/// 通知标题
String? title;
/// 通知描述
String? desc;
/// 扩展内容
String? ex;
/// 仅ios有效
String? iOSPushSound;
/// 仅ios有效
bool? iOSBadgeCount;
OfflinePushInfo(
@@ -615,3 +960,336 @@ class OfflinePushInfo {
return data;
}
}
/// @消息用户id跟昵称关系对象
class AtUserInfo {
/// 被@的用户id
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;
}
}
/// 消息撤回具体信息
class RevokedInfo {
/// 撤回者ID
String? revokerID;
/// 撤回者群角色 [GroupRoleLevel]
int? revokerRole;
/// 撤回者昵称
String? revokerNickname;
/// 消息id
String? clientMsgID;
/// 撤回时间
int? revokeTime;
/// 消息发送时间
int? sourceMessageSendTime;
/// 消息发送者
String? sourceMessageSendID;
/// 消息发送者昵称
String? sourceMessageSenderNickname;
/// 会话类型 [ConversationType]
int? sessionType;
RevokedInfo({
this.revokerID,
this.revokerRole,
this.revokerNickname,
this.clientMsgID,
this.revokeTime,
this.sourceMessageSendTime,
this.sourceMessageSendID,
this.sourceMessageSenderNickname,
this.sessionType,
});
RevokedInfo.fromJson(Map<String, dynamic> json) {
revokerID = json['revokerID'];
revokerRole = json['revokerRole'];
revokerNickname = json['revokerNickname'];
clientMsgID = json['clientMsgID'];
revokeTime = json['revokeTime'];
sourceMessageSendTime = json['sourceMessageSendTime'];
sourceMessageSendID = json['sourceMessageSendID'];
sourceMessageSenderNickname = json['sourceMessageSenderNickname'];
sessionType = json['sessionType'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['revokerID'] = this.revokerID;
data['revokerRole'] = this.revokerRole;
data['revokerNickname'] = this.revokerNickname;
data['clientMsgID'] = this.clientMsgID;
data['revokeTime'] = this.revokeTime;
data['sourceMessageSendTime'] = this.sourceMessageSendTime;
data['sourceMessageSendID'] = this.sourceMessageSendID;
data['sourceMessageSenderNickname'] = this.sourceMessageSenderNickname;
data['sessionType'] = this.sessionType;
return data;
}
}
class AdvancedMessage {
List<Message>? messageList;
bool? isEnd;
int? errCode;
String? errMsg;
int? lastMinSeq;
AdvancedMessage({
this.messageList,
this.isEnd,
this.errCode,
this.errMsg,
this.lastMinSeq,
});
AdvancedMessage.fromJson(Map<String, dynamic> json) {
messageList = json['messageList'] == null
? null
: (json['messageList'] as List)
.map((e) => Message.fromJson(e))
.toList();
isEnd = json['isEnd'];
errCode = json['errCode'];
errMsg = json['errMsg'];
lastMinSeq = json['lastMinSeq'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['messageList'] = this.messageList?.map((e) => e.toJson()).toList();
data['isEnd'] = this.isEnd;
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
data['lastMinSeq'] = this.lastMinSeq;
return data;
}
}
class RichMessageInfo {
String? type;
int? offset;
int? length;
String? url;
String? info;
RichMessageInfo({
this.type,
this.offset,
this.length,
this.url,
this.info,
});
RichMessageInfo.fromJson(Map<String, dynamic> json) {
type = json['type'];
offset = json['offset'];
length = json['length'];
url = json['url'];
info = json['info'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['type'] = this.type;
data['offset'] = this.offset;
data['length'] = this.length;
data['url'] = this.url;
data['info'] = this.info;
return data;
}
}
///////////////////// 消息修改相关/////////////////////
////////////////////////////////////////////////////
class KeyValue {
String? typeKey;
String? value;
int? latestUpdateTime;
KeyValue({this.typeKey, this.value, this.latestUpdateTime});
KeyValue.fromJson(Map<String, dynamic> json) {
typeKey = json['typeKey'];
value = json['value'];
latestUpdateTime = json['latestUpdateTime'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['typeKey'] = this.typeKey;
data['value'] = this.value;
data['latestUpdateTime'] = this.latestUpdateTime;
return data;
}
}
class UserExInfo {
String? userID;
String? ex;
UserExInfo({this.userID, this.ex});
UserExInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
ex = json['ex'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['userID'] = this.userID;
data['ex'] = this.ex;
return data;
}
}
class SingleTypeKeyInfoSum {
String? typeKey;
int? counter;
List<UserExInfo>? infoList;
bool? isContainSelf;
SingleTypeKeyInfoSum({
this.typeKey,
this.counter,
this.infoList,
this.isContainSelf,
});
SingleTypeKeyInfoSum.fromJson(Map<String, dynamic> json) {
typeKey = json['typeKey'];
counter = json['counter'];
infoList = json['infoList'] == null
? null
: (json['infoList'] as List)
.map((e) => UserExInfo.fromJson(e))
.toList();
isContainSelf = json['isContainSelf'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['typeKey'] = this.typeKey;
data['counter'] = this.counter;
data['infoList'] = this.infoList?.map((e) => e.toJson()).toList();
data['isContainSelf'] = this.isContainSelf;
return data;
}
}
class MessageKv {
String? clientMsgID;
List<SingleTypeKeyInfoSum>? changedKvList;
MessageKv({this.clientMsgID, this.changedKvList});
MessageKv.fromJson(Map<String, dynamic> json) {
clientMsgID = json['clientMsgID'];
changedKvList = json['changedKvList'] == null
? null
: (json['changedKvList'] as List)
.map((e) => SingleTypeKeyInfoSum.fromJson(e))
.toList();
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['clientMsgID'] = this.clientMsgID;
data['changedKvList'] = this.changedKvList?.map((e) => e.toJson()).toList();
return data;
}
}
class TypeKeySetResult {
int? errCode;
String? errMsg;
String? typeKey;
int? latestUpdateTime;
String? value;
TypeKeySetResult(
{this.errCode,
this.errMsg,
this.typeKey,
this.latestUpdateTime,
this.value});
TypeKeySetResult.fromJson(Map<String, dynamic> json) {
errCode = json['errCode'];
errMsg = json['errMsg'];
typeKey = json['typeKey'];
latestUpdateTime = json['latestUpdateTime'];
value = json['value'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
data['typeKey'] = this.typeKey;
data['latestUpdateTime'] = this.latestUpdateTime;
data['value'] = this.value;
return data;
}
}
class MessageTypeKeyMapping {
int? errCode;
String? errMsg;
Map<String, KeyValue>? reactionExtensionList;
String? clientMsgID;
MessageTypeKeyMapping(
{this.errCode,
this.errMsg,
this.reactionExtensionList,
this.clientMsgID});
MessageTypeKeyMapping.fromJson(Map<String, dynamic> json) {
errCode = json['errCode'];
errMsg = json['errMsg'];
reactionExtensionList = json['reactionExtensionList'] != null
? (json['reactionExtensionList'] as Map)
.map((key, value) => MapEntry(key, KeyValue.fromJson(value)))
: null;
clientMsgID = json['clientMsgID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
if (this.reactionExtensionList != null) {
data['reactionExtensionList'] = this
.reactionExtensionList!
.map((key, value) => MapEntry(key, value.toJson()));
}
data['clientMsgID'] = this.clientMsgID;
return data;
}
}

View File

@@ -0,0 +1,453 @@
import '../../flutter_openim_sdk.dart';
/// oa 通知
class OANotification {
/// 标题
String? notificationName;
/// 头像
String? notificationFaceURL;
/// 类型
int? notificationType;
/// 文本内容
String? text;
/// 跳转链接
String? externalUrl;
/// 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;
}
}
/// 群事件通知
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;
}
}
/// 用户被邀请进群通知
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;
}
}
/// 组踢出成员通知
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;
}
}
/// 退出群通知
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;
}
}
/// 进群通知
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;
}
}
/// 群权转让通知
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;
}
}
/// 禁言成员通知
class MuteMemberNotification {
/// 群信息
GroupInfo? group;
/// 操作者信息
GroupMembersInfo? opUser;
/// 被禁言的成员信息
GroupMembersInfo? mutedUser;
/// 禁言时间s
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;
}
}
/// 阅后即焚通知
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;
}
}
/// 群成员信息发送变化通知
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;
}
}

View File

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

View File

@@ -0,0 +1,116 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class SearchResult {
/// 获取到的总的消息数量
int? totalCount;
/// 搜索到的具体内容
List<SearchResultItems>? searchResultItems;
List<SearchResultItems>? findResultItems;
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));
});
}
if (json['findResultItems'] != null) {
findResultItems = <SearchResultItems>[];
json['findResultItems'].forEach((v) {
findResultItems!.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();
}
if (this.findResultItems != null) {
data['findResultItems'] =
this.findResultItems!.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;
}
}
class SearchParams {
String? conversationID;
List<String>? clientMsgIDList;
SearchParams({
this.conversationID,
this.clientMsgIDList,
});
SearchParams.fromJson(Map<String, dynamic> json) {
conversationID = json['conversationID'];
if (json['clientMsgIDList'] != null) {
clientMsgIDList = json['clientMsgIDList'].cast<String>();
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['conversationID'] = this.conversationID;
data['clientMsgIDList'] = this.clientMsgIDList;
return data;
}
}

View File

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

View File

@@ -5,24 +5,69 @@
/// Not a friend is not on the blacklist
/// 不是好友不在黑名单
class UserInfo {
/// 用户id
String? userID;
/// 用户昵称
String? nickname;
/// 头像
String? faceURL;
/// 性别
int? gender;
/// 手机号
String? phoneNumber;
@deprecated
int? birth;
/// 出生时间
String? birthTime;
/// 邮箱
String? email;
/// 扩展字段
String? ex;
/// 创建时间
int? createTime;
/// 备注
String? remark;
/// 用户公开的资料
PublicUserInfo? publicInfo;
/// 好友才能查看的资料
FriendInfo? friendInfo;
/// 黑名单资料
BlacklistInfo? blackInfo;
/// 是否好友关系
bool? isFriendship;
/// 是否黑名单
bool? isBlacklist;
/// 全局免打扰 0正常1不接受消息2接受在线消息不接受离线消息
int? globalRecvMsgOpt;
/// 是允许添加为好友 1允许2
int? allowAddFriend;
/// 新消息铃声 1允许2
int? allowBeep;
/// 新消息震动 1允许2
int? allowVibration;
/// 禁止登录
int? forbidden;
UserInfo({
this.publicInfo,
this.friendInfo,
@@ -35,11 +80,17 @@ class UserInfo {
this.faceURL,
this.phoneNumber,
this.birth,
this.birthTime,
this.gender,
this.email,
this.ex,
this.createTime,
this.remark,
this.globalRecvMsgOpt,
this.allowAddFriend,
this.allowBeep,
this.allowVibration,
this.forbidden,
});
// UserInfo.self(Map<String, dynamic> json) {
@@ -74,10 +125,16 @@ class UserInfo {
gender = json['gender'] ?? _gender;
phoneNumber = json['phoneNumber'] ?? _phoneNumber;
birth = json['birth'] ?? _birth;
birthTime = json['birthTime'] ?? _birthTime;
email = json['email'] ?? _email;
remark = json['remark'] ?? _remark;
ex = json['ex'];
ex = json['ex'] ?? _ex;
createTime = json['createTime'];
globalRecvMsgOpt = json['globalRecvMsgOpt'];
allowAddFriend = json['allowAddFriend'];
allowBeep = json['allowBeep'];
allowVibration = json['allowVibration'];
forbidden = json['forbidden'];
}
Map<String, dynamic> toJson() {
@@ -94,10 +151,16 @@ class UserInfo {
data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['birthTime'] = this.birthTime;
data['email'] = this.email;
data['ex'] = this.ex;
data['createTime'] = this.createTime;
data['remark'] = this.remark;
data['globalRecvMsgOpt'] = this.globalRecvMsgOpt;
data['allowAddFriend'] = this.allowAddFriend;
data['allowBeep'] = this.allowBeep;
data['allowVibration'] = this.allowVibration;
data['forbidden'] = this.forbidden;
return data;
}
@@ -123,35 +186,65 @@ class UserInfo {
? friendInfo?.gender
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
String? get _ex => isFriendship!
? friendInfo?.ex
: (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
String? get _phoneNumber => friendInfo?.phoneNumber;
int? get _birth => friendInfo?.birth;
String? get _birthTime => friendInfo?.birthTime;
String? get _email => friendInfo?.email;
String? get _remark => friendInfo?.remark;
String getShowName() => _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;
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 {
/// 用户id
String? userID;
/// 昵称
String? nickname;
/// 头像
String? faceURL;
/// 性别
int? gender;
/// AppOrdinaryUsers = 1 AppAdmin = 2
int? appMangerLevel;
/// 扩展信息
String? ex;
PublicUserInfo({
this.userID,
this.nickname,
this.faceURL,
this.gender,
this.appMangerLevel,
this.ex,
});
PublicUserInfo.fromJson(Map<String, dynamic> json) {
@@ -160,6 +253,7 @@ class PublicUserInfo {
faceURL = json['faceURL'];
gender = json['gender'];
appMangerLevel = json['appMangerLevel'];
ex = json['ex'];
}
Map<String, dynamic> toJson() {
@@ -169,22 +263,50 @@ class PublicUserInfo {
data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['appMangerLevel'] = this.appMangerLevel;
data['ex'] = this.ex;
return data;
}
}
/// 好友信息
class FriendInfo {
/// 用户id
String? userID;
/// 昵称
String? nickname;
/// 头像
String? faceURL;
/// 性别
int? gender;
/// 手机号
String? phoneNumber;
/// 出生日期
String? birthTime;
@deprecated
int? birth;
/// 邮箱
String? email;
/// 备注
String? remark;
/// 扩展字段
String? ex;
/// 创建时间
int? createTime;
/// 添加方式
int? addSource;
/// 操作者id
String? operatorUserID;
FriendInfo({
@@ -194,6 +316,7 @@ class FriendInfo {
this.gender,
this.phoneNumber,
this.birth,
this.birthTime,
this.email,
this.remark,
this.ex,
@@ -214,6 +337,7 @@ class FriendInfo {
gender = json['gender'];
phoneNumber = json['phoneNumber'];
birth = json['birth'];
birthTime = json['birthTime'];
email = json['email'];
ex = json['ex'];
}
@@ -231,20 +355,44 @@ class FriendInfo {
data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['birthTime'] = this.birthTime;
data['email'] = this.email;
data['ex'] = this.ex;
return data;
}
String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!;
static String? _isNull(String? value) {
if (value == null || value.trim().isEmpty) return null;
return value;
}
}
/// 黑名单信息
class BlacklistInfo {
/// 用户id
String? userID;
/// 昵称
String? nickname;
/// 头像
String? faceURL;
/// 性别
int? gender;
/// 创建时间
int? createTime;
/// 添加方式
int? addSource;
/// 操作者
String? operatorUserID;
/// 扩展信息
String? ex;
BlacklistInfo({
@@ -283,10 +431,11 @@ class BlacklistInfo {
}
}
/// 关系
class FriendshipInfo {
/// 用户id
String? userID;
/// 1 means friend (and not blacklist)
/// 1表示好友并且不是黑名单
int? result;
@@ -305,21 +454,51 @@ class FriendshipInfo {
}
}
/// 好友申请信息
class FriendApplicationInfo {
/// 发起者用户id
String? fromUserID;
/// 发起者用户昵称
String? fromNickname;
/// 发起者用户头像
String? fromFaceURL;
/// 发起者性别
int? fromGender;
/// 接收者用户id
String? toUserID;
/// 接收者用户昵称
String? toNickname;
/// 接收者头像
String? toFaceURL;
/// 接收者性别
int? toGender;
/// 处理结果
int? handleResult;
/// 请求消息
String? reqMsg;
/// 创建时间
int? createTime;
/// 处理者id
String? handlerUserID;
/// 处理备注
String? handleMsg;
/// 处理时间
int? handleTime;
/// 扩展字段
String? ex;
FriendApplicationInfo(
@@ -377,12 +556,12 @@ class FriendApplicationInfo {
return data;
}
/// friend application waiting handle
/// 等待处理
bool get isWaitingHandle => handleResult == 0;
/// friend application agreed
/// 已同意
bool get isAgreed => handleResult == 1;
/// friend application rejected
/// 已拒绝
bool get isRejected => handleResult == -1;
}

View 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;
}
}

View File

@@ -2,10 +2,11 @@ import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OpenIM {
static const MethodChannel _channel =
const MethodChannel('flutter_openim_sdk');
static const version = '2.3.5+2';
static IMManager iMManager = IMManager(_channel);
static const _channel = const MethodChannel('flutter_openim_sdk');
static final iMManager = IMManager(_channel);
OpenIM._();
}

View File

@@ -2,14 +2,14 @@ import 'dart:convert';
class Utils {
static List<T> toList<T>(String value, T f(Map<String, dynamic> map)) =>
(_formatJson(value) as List).map((e) => f(e)).toList();
(formatJson(value) as List).map((e) => f(e)).toList();
static T toObj<T>(String value, T f(Map<String, dynamic> map)) =>
f(_formatJson(value));
f(formatJson(value));
static List<dynamic> toListMap(String value) => _formatJson(value);
static List<dynamic> toListMap(String value) => formatJson(value);
static dynamic _formatJson(String value) => jsonDecode(value);
static dynamic formatJson(String value) => jsonDecode(value);
static String checkOperationID(String? obj) =>
obj ?? DateTime.now().millisecondsSinceEpoch.toString();

View File

@@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.8.2"
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
@@ -21,35 +21,28 @@ packages:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0"
version: "1.16.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@@ -66,28 +59,28 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0"
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
@@ -99,7 +92,7 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
@@ -120,35 +113,28 @@ packages:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "0.4.12"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0"

View File

@@ -1,6 +1,6 @@
name: flutter_openim_sdk
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.3.5+2
homepage: https://www.rentsoft.cn
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter