Compare commits
140 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39727feb8a | ||
|
|
c6d1669bdd | ||
|
|
02202051e1 | ||
|
|
d0a4530314 | ||
|
|
958c118e84 | ||
|
|
cdef7ffda8 | ||
|
|
bac4bd0884 | ||
|
|
377b07ef05 | ||
|
|
025487fbf3 | ||
|
|
ba3767da42 | ||
|
|
fc6fd3dd93 | ||
|
|
c6d9815e64 | ||
|
|
8e0c736d29 | ||
|
|
15854a2c27 | ||
|
|
3e1ee249c9 | ||
|
|
29eac1bf91 | ||
|
|
bea820ff27 | ||
|
|
a85062ce79 | ||
|
|
98b2774dc1 | ||
|
|
e823df62a8 | ||
|
|
2c40b626e4 | ||
|
|
3b5f47c9f0 | ||
|
|
4c540fbff5 | ||
|
|
b8a51374a3 | ||
|
|
099cb9849a | ||
|
|
025334d32f | ||
|
|
5adc50b963 | ||
|
|
ebbe5c882f | ||
|
|
eb3361c4b3 | ||
|
|
9c5aa56609 | ||
|
|
3e03460300 | ||
|
|
788ab524c2 | ||
|
|
eed59f468c | ||
|
|
d758f3fca1 | ||
|
|
b8ee9276a2 | ||
|
|
a77c86e87a | ||
|
|
c99d1e4d67 | ||
|
|
b53d4dfcfd | ||
|
|
bb49d6b27a | ||
|
|
2b78f83b20 | ||
|
|
38a899d32c | ||
|
|
0a0635bb71 | ||
|
|
c44575ec0e | ||
|
|
14624c717b | ||
|
|
0900df2aa2 | ||
|
|
cd06c3bb5a | ||
|
|
a6aea5496a | ||
|
|
72111053bd | ||
|
|
18f099c437 | ||
|
|
cff0a4cce2 | ||
|
|
e415961d64 | ||
|
|
b3aebeb318 | ||
|
|
c76bfeb07a | ||
|
|
a9343bf892 | ||
|
|
bf354c4103 | ||
|
|
644c52ae0e | ||
|
|
80048bcd18 | ||
|
|
cc6c1bdc22 | ||
|
|
7233b2e298 | ||
|
|
cd61ebba7f | ||
|
|
3a294dd856 | ||
|
|
45e0c82ea3 | ||
|
|
2de606d13e | ||
|
|
7a68e13398 | ||
|
|
4132338633 | ||
|
|
485bf58f14 | ||
|
|
6ad47216fb | ||
|
|
3c62315cfd | ||
|
|
7247f6b982 | ||
|
|
6a771f8035 | ||
|
|
4726055b6f | ||
|
|
2a9d4a0587 | ||
|
|
cce41e0991 | ||
|
|
599c25b099 | ||
|
|
6c3311cce1 | ||
|
|
9a359ca9a0 | ||
|
|
cc2211c36d | ||
|
|
ccf4d4fec1 | ||
|
|
0b8762a754 | ||
|
|
28a911022c | ||
|
|
996281e49a | ||
|
|
e2b546f400 | ||
|
|
8abc8e4399 | ||
|
|
ed20b4915a | ||
|
|
8b1f4dc320 | ||
|
|
f7416290fb | ||
|
|
f0b28099bf | ||
|
|
d5d11af7ce | ||
|
|
9cd717c67c | ||
|
|
c7218cb94c | ||
|
|
e4c78e0106 | ||
|
|
7457f182f3 | ||
|
|
952cb82417 | ||
|
|
3cb2c6d514 | ||
|
|
90be2f74ac | ||
|
|
53ef6c2173 | ||
|
|
373171aded | ||
|
|
58702fcbaf | ||
|
|
8b8c9d5923 | ||
|
|
d5e3947878 | ||
|
|
6edf9b74fa | ||
|
|
fcc8373560 | ||
|
|
7e8d72929a | ||
|
|
03fa70c585 | ||
|
|
8b4a35e6b7 | ||
|
|
71897bcb4e | ||
|
|
57340e52a7 | ||
|
|
197f0b482f | ||
|
|
e009224256 | ||
|
|
ad0563aee4 | ||
|
|
d120312ac9 | ||
|
|
d64b426c90 | ||
|
|
3a845dc40b | ||
|
|
700265c685 | ||
|
|
73b9eb776f | ||
|
|
372e573ea0 | ||
|
|
8ea08f9ce6 | ||
|
|
40b65f52a5 | ||
|
|
6c0676fbe5 | ||
|
|
80152e2314 | ||
|
|
2381d26729 | ||
|
|
b25f0d8547 | ||
|
|
f4e7eaf50e | ||
|
|
f40d4148a8 | ||
|
|
23fa27d2cc | ||
|
|
6a1dc1f62a | ||
|
|
07212474fe | ||
|
|
8655088af6 | ||
|
|
b7aa083f48 | ||
|
|
514fb53eca | ||
|
|
9345c6465a | ||
|
|
b05e68355e | ||
|
|
3746652552 | ||
|
|
e323eea8cd | ||
|
|
f111d0c69e | ||
|
|
ba661a516e | ||
|
|
43016d5e86 | ||
|
|
4c43d54a1a | ||
|
|
b71cd22dce | ||
|
|
f3261d2ce4 |
15
.idea/flutter_openim_sdk.iml
generated
15
.idea/flutter_openim_sdk.iml
generated
@@ -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" />
|
||||
|
||||
1
.idea/libraries/Dart_SDK.xml
generated
1
.idea/libraries/Dart_SDK.xml
generated
@@ -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
1
.idea/misc.xml
generated
@@ -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
1
.idea/modules.xml
generated
@@ -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>
|
||||
252
CHANGELOG.md
252
CHANGELOG.md
@@ -1,3 +1,233 @@
|
||||
## 2.3.5+3
|
||||
|
||||
- Fix bug for signaling
|
||||
- Add networkChanged method
|
||||
- Add setListenerForService method
|
||||
|
||||
## 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>
|
||||
2.Fix sending picture flashback bug </br>
|
||||
3.Fix other bug
|
||||
|
||||
## 2.0.0
|
||||
|
||||
1.Refactor mobile sdk, server sdk (2022-2-21)
|
||||
|
||||
## 1.1.1
|
||||
|
||||
1.Update sdk maven url
|
||||
@@ -13,13 +243,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
|
||||
|
||||
@@ -57,36 +287,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
|
||||
|
||||
@@ -95,11 +334,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.
|
||||
|
||||
|
||||
3046
README.zh-cn.md
3046
README.zh-cn.md
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,21 @@
|
||||
group 'io.openim.flutter_openim_sdk'
|
||||
version '1.0'
|
||||
|
||||
def dir = getCurrentProjectDir()
|
||||
|
||||
// 将aar放到libs,本地仓库替换远程仓库
|
||||
def getCurrentProjectDir() {
|
||||
String result = ""
|
||||
rootProject.allprojects { project ->
|
||||
if (project.properties.get("name").toString() == "flutter_openim_sdk") {
|
||||
result = project.properties.get("projectDir").toString()
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
allowInsecureProtocol = true
|
||||
url 'http://121.37.25.71:8081/repository/maven-releases/'
|
||||
}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -18,10 +27,9 @@ buildscript {
|
||||
|
||||
rootProject.allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
allowInsecureProtocol = true
|
||||
url 'http://121.37.25.71:8081/repository/maven-releases/'
|
||||
}
|
||||
// 将aar放到libs,本地仓库替换远程仓库
|
||||
// maven { url "$dir/libs" }
|
||||
maven { url 'https://open-im-online.rentsoft.cn:51000/repository/maven2/' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -40,6 +48,9 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'io.openim:client-sdk:1.4.5@aar'
|
||||
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
||||
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
||||
api 'io.openim:core-sdk:2.3.5-t34@aar'
|
||||
}
|
||||
9
android/libs/io/openim/core-sdk/0.0.1/core-sdk-0.0.1.pom
Normal file
9
android/libs/io/openim/core-sdk/0.0.1/core-sdk-0.0.1.pom
Normal file
@@ -0,0 +1,9 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>io.openim</groupId>
|
||||
<artifactId>core-sdk</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</project>
|
||||
@@ -18,6 +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;
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,20 +35,28 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
|
||||
public static MethodChannel channel;
|
||||
private static IMManager imManager;
|
||||
private static UserManager userManager;
|
||||
private static FriendshipManager friendshipManager;
|
||||
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() {
|
||||
}
|
||||
|
||||
private FlutterOpenimSdkPlugin(Context context) {
|
||||
FlutterOpenimSdkPlugin.imManager = new IMManager();
|
||||
FlutterOpenimSdkPlugin.userManager = new UserManager();
|
||||
FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager();
|
||||
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
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnAdvancedMsgListener;
|
||||
|
||||
public class AdvancedMsgListener implements OnAdvancedMsgListener {
|
||||
// final Map<String, String> values = new HashMap<>();
|
||||
private final String id;
|
||||
|
||||
public AdvancedMsgListener(String listenerId) {
|
||||
this.id = listenerId;
|
||||
// this.values.put("id", listenerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("haveReadMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvMessageRevoked(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("newMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Base;
|
||||
|
||||
public class BaseListener implements Base {
|
||||
|
||||
MethodChannel.Result result;
|
||||
|
||||
public BaseListener(MethodChannel.Result result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(long l, String s) {
|
||||
// Log.e("F-OpenIMSD(callback)", s);
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
// Log.i("F-OpenIMSDK(callback)", s);
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnFriendshipListener;
|
||||
|
||||
public class FriendshipListener implements OnFriendshipListener {
|
||||
|
||||
@Override
|
||||
public void onBlackListAdd(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlackListAdd", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlackListDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlackListDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListAccept(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAccept", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationListReject(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationListReject", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendListAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendListAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendListDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendListDeleted", s);
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnGroupListener;
|
||||
|
||||
public class GroupListener implements OnGroupListener {
|
||||
@Override
|
||||
public void onApplicationProcessed(String s, String s1, int i, String s2) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("opUser", s1);
|
||||
map.put("agreeOrReject", i);
|
||||
map.put("opReason", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onApplicationProcessed", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupCreated(String s) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
CommonUtil.emitEvent("groupListener", "onGroupCreated", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupInfoChanged(String s, String s1) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("groupInfo", s1);
|
||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberEnter(String s, String s1) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("memberList", s1);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberEnter", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberInvited(String s, String s1, String s2) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("opUser", s1);
|
||||
map.put("memberList", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberInvited", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberKicked(String s, String s1, String s2) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("opUser", s1);
|
||||
map.put("memberList", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberKicked", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberLeave(String s, String s1) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("member", s1);
|
||||
CommonUtil.emitEvent("groupListener", "onMemberLeave", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveJoinApplication(String s, String s1, String s2) {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("groupId", s);
|
||||
map.put("member", s1);
|
||||
map.put("opReason", s2);
|
||||
CommonUtil.emitEvent("groupListener", "onReceiveJoinApplication", map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsgListener {
|
||||
private final String id;
|
||||
|
||||
public OnAdvancedMsgListener(String listenerId) {
|
||||
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("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<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("newMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
|
||||
public class OnBaseListener implements Base {
|
||||
|
||||
MethodChannel.Result result;
|
||||
MethodCall call;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
|
||||
public class OnConnListener implements open_im_sdk_callback.OnConnListener {
|
||||
|
||||
@Override
|
||||
public void onConnectFailed(int i, String s) {
|
||||
CommonUtil.emitEvent("connectListener", "onConnectFailed", i, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
CommonUtil.emitEvent("connectListener", "onConnectSuccess", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnecting() {
|
||||
CommonUtil.emitEvent("connectListener", "onConnecting", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
CommonUtil.emitEvent("connectListener", "onKickedOffline", null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUserTokenExpired() {
|
||||
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.OnConversationListener;
|
||||
|
||||
public class ConversationListener implements OnConversationListener {
|
||||
|
||||
public class OnConversationListener implements open_im_sdk_callback.OnConversationListener {
|
||||
|
||||
@Override
|
||||
public void onConversationChanged(String s) {
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipListener {
|
||||
|
||||
@Override
|
||||
public void onBlackAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlackDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationAccepted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationRejected(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendApplicationRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnGroupListener implements open_im_sdk_callback.OnGroupListener {
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationAccepted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationAdded(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationDeleted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationRejected(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberAdded(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupMemberAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberDeleted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupMemberDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMemberInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupMemberInfoChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinedGroupAdded(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onJoinedGroupAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinedGroupDeleted(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onJoinedGroupDeleted", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnListenerForService implements open_im_sdk_callback.OnListenerForService {
|
||||
@Override
|
||||
public void onFriendApplicationAccepted(String s) {
|
||||
CommonUtil.emitEvent("listenerForService", "onFriendApplicationAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFriendApplicationAdded(String s) {
|
||||
CommonUtil.emitEvent("listenerForService", "onFriendApplicationAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationAccepted(String s) {
|
||||
CommonUtil.emitEvent("listenerForService", "onGroupApplicationAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupApplicationAdded(String s) {
|
||||
CommonUtil.emitEvent("listenerForService", "onGroupApplicationAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -7,31 +7,33 @@ import java.util.Map;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.SendMsgCallBack;
|
||||
import open_im_sdk_callback.SendMsgCallBack;
|
||||
|
||||
public class MsgSendProgressListener implements SendMsgCallBack {
|
||||
public class OnMsgSendListener implements SendMsgCallBack {
|
||||
final private MethodChannel.Result result;
|
||||
// final private MethodCall call;
|
||||
final private Object clientMsgID;
|
||||
private Object clientMsgID;
|
||||
|
||||
public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) {
|
||||
public OnMsgSendListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
// this.call = call;
|
||||
Map<String, Object> args = call.argument("message");
|
||||
this.clientMsgID = args.get("clientMsgID");
|
||||
if (null != args) {
|
||||
this.clientMsgID = args.get("clientMsgID");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(long l, String s) {
|
||||
public void onError(int l, String s) {
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(long l) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("clientMsgID", clientMsgID);
|
||||
values.put("progress", l);
|
||||
CommonUtil.emitEvent("msgSendProgressListener", "onProgress", values);
|
||||
if (null != clientMsgID) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("clientMsgID", clientMsgID);
|
||||
values.put("progress", l);
|
||||
CommonUtil.emitEvent("msgSendProgressListener", "onProgress", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,10 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnOrganizationListener implements open_im_sdk_callback.OnOrganizationListener {
|
||||
@Override
|
||||
public void onOrganizationUpdated() {
|
||||
CommonUtil.emitEvent("organizationListener", "onOrganizationUpdated", null);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnUserListener implements open_im_sdk_callback.OnUserListener {
|
||||
|
||||
@Override
|
||||
public void onSelfInfoUpdated(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnWorkMomentsListener implements open_im_sdk_callback.OnWorkMomentsListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void onRecvNewNotification() {
|
||||
CommonUtil.emitEvent("workMomentsListener", "OnRecvNewNotification", null);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.IMSDKListener;
|
||||
|
||||
public class SDKListener implements IMSDKListener {
|
||||
|
||||
@Override
|
||||
public void onConnectFailed(long l, String s) {
|
||||
CommonUtil.emitEvent("initSDKListener", "onConnectFailed", l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onConnectSuccess", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnecting() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onConnecting", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKickedOffline() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onKickedOffline", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfInfoUpdated(String s) {
|
||||
CommonUtil.emitEvent("initSDKListener", "onSelfInfoUpdated", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserTokenExpired() {
|
||||
CommonUtil.emitEvent("initSDKListener", "onUserTokenExpired", null);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,74 +2,100 @@ 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.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.ConversationListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnConversationListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class ConversationManager extends BaseManager {
|
||||
|
||||
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationListener(new ConversationListener());
|
||||
Open_im_sdk.setConversationListener(new OnConversationListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
|
||||
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAllConversationList(new BaseListener(result));
|
||||
Open_im_sdk.getAllConversationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getConversationListSplit(new BaseListener(result),
|
||||
Open_im_sdk.getConversationListSplit(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count"));
|
||||
int2long(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getOneConversation(
|
||||
value(methodCall, "sourceID"),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "sessionType"),
|
||||
new BaseListener(result));
|
||||
value(methodCall, "sourceID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getMultipleConversation(
|
||||
jsonValue(methodCall, "conversationIDList"),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversation(
|
||||
value(methodCall, "conversationID"),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationDraft(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "draftText"),
|
||||
new BaseListener(result));
|
||||
value(methodCall, "draftText")
|
||||
);
|
||||
}
|
||||
|
||||
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.pinConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isPinned"),
|
||||
new BaseListener(result));
|
||||
value(methodCall, "isPinned")
|
||||
);
|
||||
}
|
||||
|
||||
public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markSingleMessageHasRead(
|
||||
new BaseListener(result),
|
||||
value(methodCall, "userID"));
|
||||
}
|
||||
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.markSingleMessageHasRead(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// value(methodCall, "userID")
|
||||
// );
|
||||
// }
|
||||
|
||||
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageHasRead(
|
||||
new BaseListener(result),
|
||||
value(methodCall, "groupID"));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result));
|
||||
Open_im_sdk.getTotalUnreadMsgCount(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -80,7 +106,8 @@ public class ConversationManager extends BaseManager {
|
||||
|
||||
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationRecvMessageOpt(
|
||||
new BaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList"),
|
||||
int2long(methodCall, "status")
|
||||
);
|
||||
@@ -88,8 +115,62 @@ public class ConversationManager extends BaseManager {
|
||||
|
||||
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getConversationRecvMessageOpt(
|
||||
new BaseListener(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")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,83 +2,124 @@ 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.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.FriendshipListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnFriendshipListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class FriendshipManager extends BaseManager {
|
||||
|
||||
|
||||
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendListener(new FriendshipListener());
|
||||
Open_im_sdk.setFriendListener(new OnFriendshipListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendsInfo(new BaseListener(result),
|
||||
jsonValue(methodCall, "uidList"));
|
||||
Open_im_sdk.getDesignatedFriendsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addFriend(new BaseListener(result),
|
||||
jsonValue(methodCall));
|
||||
Open_im_sdk.addFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationList(new BaseListener(result));
|
||||
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvFriendApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendFriendApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendList(new BaseListener(result));
|
||||
Open_im_sdk.getFriendList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendInfo(
|
||||
jsonValue(methodCall), new BaseListener(result));
|
||||
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendRemark(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addToBlackList(new BaseListener(result),
|
||||
jsonValue(methodCall, "uid"));
|
||||
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addBlack(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void getBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getBlackList(new BaseListener(result));
|
||||
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getBlackList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFromBlackList(new BaseListener(result),
|
||||
jsonValue(methodCall, "uid"));
|
||||
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.removeBlack(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.checkFriend(new BaseListener(result),
|
||||
jsonValue(methodCall, "uidList"));
|
||||
Open_im_sdk.checkFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFromFriendList(
|
||||
jsonValue(methodCall, "uid"), new BaseListener(result));
|
||||
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.acceptFriendApplication(new BaseListener(result),
|
||||
jsonValue(methodCall, "uid"));
|
||||
Open_im_sdk.acceptFriendApplication(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.refuseFriendApplication(new BaseListener(result),
|
||||
jsonValue(methodCall, "uid"));
|
||||
Open_im_sdk.refuseFriendApplication(
|
||||
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")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,120 +2,261 @@ 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.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.GroupListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnGroupListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class GroupManager extends BaseManager {
|
||||
|
||||
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupListener(new GroupListener());
|
||||
Open_im_sdk.setGroupListener(new OnGroupListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.inviteUserToGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList"),
|
||||
new BaseListener(result));
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.kickGroupMember(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList"),
|
||||
new BaseListener(result));
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMembersInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "uidList"),
|
||||
new BaseListener(result));
|
||||
jsonValue(methodCall, "uidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMemberList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "filter"),
|
||||
value(methodCall, "next"),
|
||||
new BaseListener(result));
|
||||
value(methodCall, "offset"),
|
||||
value(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getJoinedGroupList(new BaseListener(result));
|
||||
Open_im_sdk.getJoinedGroupList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.createGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gInfo"),
|
||||
jsonValue(methodCall, "memberList"),
|
||||
new BaseListener(result));
|
||||
jsonValue(methodCall, "memberList")
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupInfo(jsonValue(methodCall, "gInfo"), new BaseListener(result));
|
||||
Open_im_sdk.setGroupInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "gInfo")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupsInfo(jsonValue(methodCall, "gidList"), new BaseListener(result));
|
||||
Open_im_sdk.getGroupsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gidList")
|
||||
);
|
||||
}
|
||||
|
||||
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.joinGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason"),
|
||||
new BaseListener(result));
|
||||
value(methodCall, "joinSource")
|
||||
);
|
||||
}
|
||||
|
||||
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.quitGroup(
|
||||
value(methodCall, "gid"),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
);
|
||||
}
|
||||
|
||||
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.transferGroupOwner(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
new BaseListener(result));
|
||||
value(methodCall, "uid")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationList(new BaseListener(result));
|
||||
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvGroupApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendGroupApplicationList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.acceptGroupApplication(
|
||||
jsonValue(methodCall, "application"),
|
||||
value(methodCall, "reason"),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.refuseGroupApplication(
|
||||
jsonValue(methodCall, "application"),
|
||||
value(methodCall, "reason"),
|
||||
new BaseListener(result));
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// 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")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,9 @@ 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.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.SDKListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnConnListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnListenerForService;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
@@ -11,47 +12,77 @@ public class IMManager extends BaseManager {
|
||||
|
||||
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
|
||||
jsonValue(methodCall), new SDKListener()));
|
||||
// CommonUtil.runMainThreadReturn(result, null);
|
||||
new OnConnListener(),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall))
|
||||
);
|
||||
}
|
||||
|
||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.login(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "token"), new BaseListener(result));
|
||||
value(methodCall, "token")
|
||||
);
|
||||
}
|
||||
|
||||
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.logout(new BaseListener(result));
|
||||
Open_im_sdk.logout(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
|
||||
}
|
||||
|
||||
// public void getLoginUid(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
|
||||
// }
|
||||
|
||||
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInfo(
|
||||
jsonValue(methodCall, "uidList"), new BaseListener(result));
|
||||
public void wakeUp(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.wakeUp(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSelfInfo(
|
||||
jsonValue(methodCall), 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 forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.forceSyncLoginUerInfo();
|
||||
public void updateFcmToken(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.updateFcmToken(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "fcmToken")
|
||||
);
|
||||
}
|
||||
|
||||
// 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")
|
||||
);
|
||||
}
|
||||
|
||||
public void networkChanged(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.networkChanged(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setListenerForService(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setListenerForService(new OnListenerForService());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
package io.openim.flutter_openim_sdk.manager;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.AdvancedMsgListener;
|
||||
import io.openim.flutter_openim_sdk.listener.BaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.MsgSendProgressListener;
|
||||
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.OnAdvancedMsgListener;
|
||||
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 static boolean initializedListener = false;
|
||||
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
|
||||
|
||||
// protected void clearListeners() {
|
||||
// initializedListener = false;
|
||||
// listeners.clear();
|
||||
// }
|
||||
protected void clearListeners() {
|
||||
initializedListener = false;
|
||||
listeners.clear();
|
||||
}
|
||||
|
||||
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
|
||||
@Override
|
||||
@@ -50,21 +49,21 @@ public class MessageManager extends BaseManager {
|
||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
|
||||
// listeners.put(key, new AdvancedMsgListener(key));
|
||||
// if (!initializedListener) {
|
||||
// initializedListener = true;
|
||||
// Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
|
||||
// }
|
||||
listeners.put(key, new AdvancedMsgListener(key));
|
||||
if (!initializedListener) {
|
||||
initializedListener = true;
|
||||
Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// String key = methodCall.argument(KEY_ID);
|
||||
// listeners.remove(key);
|
||||
// if (listeners.isEmpty()) {
|
||||
// initializedListener = false;
|
||||
// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
||||
// }
|
||||
}
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
listeners.remove(key);
|
||||
if (listeners.isEmpty()) {
|
||||
initializedListener = false;
|
||||
Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
|
||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -83,81 +82,135 @@ 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) {
|
||||
MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall);
|
||||
Open_im_sdk.sendMessage(listener,
|
||||
Open_im_sdk.sendMessage(
|
||||
new OnMsgSendListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "onlineUserOnly"));
|
||||
jsonValue(methodCall, "offlinePushInfo")
|
||||
);
|
||||
}
|
||||
|
||||
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getHistoryMessageList(new BaseListener(result), jsonValue(methodCall));
|
||||
Open_im_sdk.getHistoryMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.revokeMessage(new BaseListener(result), jsonValue(methodCall));
|
||||
Open_im_sdk.revokeMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), jsonValue(methodCall));
|
||||
Open_im_sdk.deleteMessageFromLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessages(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
}
|
||||
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessages(new OnBaseListener(result, methodCall), CommonUtil.getSDKJsonParam(methodCall));
|
||||
// }
|
||||
|
||||
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result),
|
||||
Open_im_sdk.insertSingleMessageToLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "receiverID"),
|
||||
value(methodCall, "senderID"));
|
||||
value(methodCall, "senderID")
|
||||
);
|
||||
}
|
||||
|
||||
public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.findMessages(new BaseListener(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 BaseListener(result),
|
||||
Open_im_sdk.markC2CMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
jsonValue(methodCall, "messageIDList"));
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void markGroupMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.typingStatusUpdate(value(methodCall, "userID"),
|
||||
value(methodCall, "typing"));
|
||||
Open_im_sdk.typingStatusUpdate(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "msgTip")
|
||||
);
|
||||
}
|
||||
|
||||
public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createTextMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "text")));
|
||||
}
|
||||
|
||||
public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
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) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createImageMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "imagePath")));
|
||||
}
|
||||
|
||||
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createImageMessageFromFullPath(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "imagePath")));
|
||||
}
|
||||
|
||||
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createSoundMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "soundPath"),
|
||||
int2long(methodCall, "duration")));
|
||||
}
|
||||
@@ -165,6 +218,7 @@ public class MessageManager extends BaseManager {
|
||||
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createSoundMessageFromFullPath(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "soundPath"),
|
||||
int2long(methodCall, "duration")));
|
||||
}
|
||||
@@ -172,6 +226,7 @@ public class MessageManager extends BaseManager {
|
||||
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createVideoMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "videoPath"),
|
||||
value(methodCall, "videoType"),
|
||||
int2long(methodCall, "duration"),
|
||||
@@ -181,6 +236,7 @@ public class MessageManager extends BaseManager {
|
||||
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createVideoMessageFromFullPath(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "videoPath"),
|
||||
value(methodCall, "videoType"),
|
||||
int2long(methodCall, "duration"),
|
||||
@@ -190,6 +246,7 @@ public class MessageManager extends BaseManager {
|
||||
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createFileMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "filePath"),
|
||||
value(methodCall, "fileName")));
|
||||
}
|
||||
@@ -197,6 +254,7 @@ public class MessageManager extends BaseManager {
|
||||
public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createFileMessageFromFullPath(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "filePath"),
|
||||
value(methodCall, "fileName")));
|
||||
}
|
||||
@@ -204,6 +262,7 @@ public class MessageManager extends BaseManager {
|
||||
public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createMergerMessage(
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "messageList"),
|
||||
value(methodCall, "title"),
|
||||
jsonValue(methodCall, "summaryList")));
|
||||
@@ -213,11 +272,13 @@ public class MessageManager extends BaseManager {
|
||||
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createForwardMessage(
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message")));
|
||||
}
|
||||
|
||||
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "description"),
|
||||
value(methodCall, "longitude"),
|
||||
value(methodCall, "latitude")
|
||||
@@ -226,6 +287,7 @@ public class MessageManager extends BaseManager {
|
||||
|
||||
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "data"),
|
||||
value(methodCall, "extension"),
|
||||
value(methodCall, "description")
|
||||
@@ -234,6 +296,7 @@ public class MessageManager extends BaseManager {
|
||||
|
||||
public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "quoteText"),
|
||||
jsonValue(methodCall, "quoteMessage")
|
||||
));
|
||||
@@ -241,21 +304,235 @@ public class MessageManager extends BaseManager {
|
||||
|
||||
public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage(
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "cardMessage")
|
||||
));
|
||||
}
|
||||
|
||||
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 BaseListener(result),
|
||||
value(methodCall, "userID"));
|
||||
Open_im_sdk.clearC2CHistoryMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearGroupHistoryMessage(new BaseListener(result),
|
||||
value(methodCall, "groupID"));
|
||||
Open_im_sdk.clearGroupHistoryMessage(
|
||||
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")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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.OnUserListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
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, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList"));
|
||||
}
|
||||
|
||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSelfInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall));
|
||||
}
|
||||
|
||||
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSelfUserInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public class CommonUtil {
|
||||
runMainThreadReturnError(result, String.valueOf(errorCode), errorMessage, errorDetails);
|
||||
}
|
||||
|
||||
public synchronized static <T> void emitEvent(String method, String type, Long errCode, String errMsg, T data) {
|
||||
public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
|
||||
runMainThread(() -> {
|
||||
Map<String, Object> res = new ArrayMap<>();
|
||||
if (null != type) {
|
||||
|
||||
@@ -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("\"");
|
||||
|
||||
@@ -21,6 +21,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>9.0</string>
|
||||
<string>11.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 = (
|
||||
);
|
||||
@@ -155,7 +154,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1020;
|
||||
LastUpgradeCheck = 1300;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
@@ -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;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -41,5 +41,9 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
@@ -15,7 +13,6 @@ class MyApp extends StatefulWidget {
|
||||
class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
void initState() {
|
||||
_initSDK();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -28,81 +25,10 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
TextButton(onPressed: _login, child: Text('login')),
|
||||
TextButton(onPressed: () {}, child: Text('login')),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _login() {
|
||||
if (OpenIM.iMManager.isInitialized)
|
||||
OpenIM.iMManager.login(uid: '', token: '');
|
||||
}
|
||||
|
||||
void _initSDK() async {
|
||||
// Initialize SDK
|
||||
OpenIM.iMManager
|
||||
..initSDK(
|
||||
platform: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios,
|
||||
ipApi: '',
|
||||
ipWs: '',
|
||||
dbPath: '',
|
||||
listener: OnInitSDKListener(
|
||||
onConnecting: () {},
|
||||
onConnectFailed: (code, error) {},
|
||||
onConnectSuccess: () {},
|
||||
onKickedOffline: () {},
|
||||
onUserSigExpired: () {},
|
||||
onSelfInfoUpdated: (user) {},
|
||||
),
|
||||
)
|
||||
|
||||
// Add message listener (remove when not in use)
|
||||
..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
onRecvMessageRevoked: (msgId) {},
|
||||
onRecvC2CReadReceipt: (list) {},
|
||||
onRecvNewMessage: (msg) {},
|
||||
))
|
||||
|
||||
// Set up message sending progress listener
|
||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||
onProgress: (msgId, progress) {},
|
||||
))
|
||||
|
||||
// Set up friend relationship listener
|
||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||
onBlackListAdd: (u) {},
|
||||
onBlackListDeleted: (u) {},
|
||||
onFriendApplicationListAccept: (u) {},
|
||||
onFriendApplicationListAdded: (u) {},
|
||||
onFriendApplicationListDeleted: (u) {},
|
||||
onFriendApplicationListReject: (u) {},
|
||||
onFriendInfoChanged: (u) {},
|
||||
onFriendListAdded: (u) {},
|
||||
onFriendListDeleted: (u) {},
|
||||
))
|
||||
|
||||
// Set up conversation listener
|
||||
..conversationManager.setConversationListener(OnConversationListener(
|
||||
onConversationChanged: (list) {},
|
||||
onNewConversation: (list) {},
|
||||
onTotalUnreadMessageCountChanged: (count) {},
|
||||
onSyncServerFailed: () {},
|
||||
onSyncServerFinish: () {},
|
||||
onSyncServerStart: () {},
|
||||
))
|
||||
|
||||
// Set up group listener
|
||||
..groupManager.setGroupListener(OnGroupListener(
|
||||
onApplicationProcessed: (groupId, opUser, agreeOrReject, opReason) {},
|
||||
onGroupCreated: (groupId) {},
|
||||
onGroupInfoChanged: (groupId, info) {},
|
||||
onMemberEnter: (groupId, list) {},
|
||||
onMemberInvited: (groupId, opUser, list) {},
|
||||
onMemberKicked: (groupId, opUser, list) {},
|
||||
onMemberLeave: (groupId, info) {},
|
||||
onReceiveJoinApplication: (groupId, info, opReason) {},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,33 +68,52 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.0.9"
|
||||
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.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
|
||||
@@ -104,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.3"
|
||||
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"
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
//
|
||||
// BaseCallback.swift
|
||||
// flutter_openim_sdk
|
||||
//
|
||||
// Created by willem on 2021/10/9.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class BaseCallback: NSObject, Open_im_sdkBaseProtocol {
|
||||
public class BaseCallback: NSObject, Open_im_sdk_callbackBaseProtocol {
|
||||
|
||||
private let result:FlutterResult
|
||||
|
||||
@@ -16,7 +9,7 @@ public class BaseCallback: NSObject, Open_im_sdkBaseProtocol {
|
||||
self.result = result
|
||||
}
|
||||
|
||||
public func onError(_ errCode: Int, errMsg: String?) {
|
||||
public func onError(_ errCode: Int32, errMsg: String?) {
|
||||
print("BaseResult: " + errMsg!)
|
||||
safeMainAsync { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class CommonUtil {
|
||||
|
||||
public static func emitEvent(channel: FlutterMethodChannel, method: String, type: String, errCode: Int?, errMsg: String?, data: Any?){
|
||||
public static func emitEvent(channel: FlutterMethodChannel, method: String, type: String, errCode: Int32?, errMsg: String?, data: Any?){
|
||||
safeMainAsync {
|
||||
var res: [String: Any] = [:]
|
||||
res["type"] = type
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
//
|
||||
// JsonUtil.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/28.
|
||||
//
|
||||
|
||||
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: "\\\"")
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// BaseServiceManager.swift
|
||||
// flutter_openim_sdk
|
||||
//
|
||||
// Created by willem on 2021/10/9.
|
||||
//
|
||||
|
||||
import Flutter
|
||||
import OpenIMCore
|
||||
import UIKit
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// ConversationManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -12,7 +5,6 @@ public class ConversationManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
|
||||
self["setConversationListener"] = setConversationListener
|
||||
self["getAllConversationList"] = getAllConversationList
|
||||
self["getConversationListSplit"] = getConversationListSplit
|
||||
@@ -21,12 +13,19 @@ public class ConversationManager: BaseServiceManager {
|
||||
self["deleteConversation"] = deleteConversation
|
||||
self["setConversationDraft"] = setConversationDraft
|
||||
self["pinConversation"] = pinConversation
|
||||
self["markSingleMessageHasRead"] = markSingleMessageHasRead
|
||||
// self["markSingleMessageHasRead"] = markSingleMessageHasRead
|
||||
self["markGroupMessageHasRead"] = markGroupMessageHasRead
|
||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||
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){
|
||||
@@ -35,43 +34,43 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetAllConversationList(BaseCallback(result: result))
|
||||
Open_im_sdkGetAllConversationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[int: "offset"], methodCall[int: "count"])
|
||||
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetOneConversation(methodCall[string: "sourceID"], methodCall[int: "sessionType"], BaseCallback(result: result))
|
||||
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "sessionType"], methodCall[string: "sourceID"])
|
||||
}
|
||||
|
||||
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetMultipleConversation(methodCall[jsonString: "conversationIDList"], BaseCallback(result: result))
|
||||
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversation(methodCall[string: "conversationID"], BaseCallback(result: result))
|
||||
Open_im_sdkDeleteConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationDraft(methodCall[string: "conversationID"], methodCall[string: "draftText"], BaseCallback(result: result))
|
||||
Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"])
|
||||
}
|
||||
|
||||
func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkPinConversation(methodCall[string: "conversationID"], methodCall[bool: "isPinned"], BaseCallback(result: result))
|
||||
Open_im_sdkPinConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isPinned"])
|
||||
}
|
||||
|
||||
func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"])
|
||||
}
|
||||
// func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"])
|
||||
// }
|
||||
|
||||
func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "groupID"])
|
||||
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result))
|
||||
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -80,16 +79,44 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
|
||||
}
|
||||
|
||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"])
|
||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func setOneConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetOneConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||
}
|
||||
|
||||
func deleteConversationFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversationFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteAllConversationFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func resetConversationGroupAtType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkResetConversationGroupAtType(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkGetAtAllTag())
|
||||
}
|
||||
|
||||
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"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ConversationListener: NSObject, Open_im_sdkOnConversationListenerProtocol {
|
||||
public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// FriendshipManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -15,16 +8,18 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["getFriendsInfo"] = getFriendsInfo
|
||||
self["addFriend"] = addFriend
|
||||
self["getFriendApplicationList"] = getFriendApplicationList
|
||||
self["getRecvFriendApplicationList"] = getRecvFriendApplicationList
|
||||
self["getSendFriendApplicationList"] = getSendFriendApplicationList
|
||||
self["getFriendList"] = getFriendList
|
||||
self["setFriendInfo"] = setFriendInfo
|
||||
self["addToBlackList"] = addToBlackList
|
||||
self["getBlackList"] = getBlackList
|
||||
self["deleteFromBlackList"] = deleteFromBlackList
|
||||
self["setFriendRemark"] = setFriendRemark
|
||||
self["addBlacklist"] = addBlacklist
|
||||
self["getBlacklist"] = getBlacklist
|
||||
self["removeBlacklist"] = removeBlacklist
|
||||
self["checkFriend"] = checkFriend
|
||||
self["deleteFromFriendList"] = deleteFromFriendList
|
||||
self["deleteFriend"] = deleteFriend
|
||||
self["acceptFriendApplication"] = acceptFriendApplication
|
||||
self["refuseFriendApplication"] = refuseFriendApplication
|
||||
self["searchFriends"] = searchFriends
|
||||
// self["forceSyncFriendApplication"] = forceSyncFriendApplication
|
||||
// self["forceSyncFriend"] = forceSyncFriend
|
||||
// self["forceSyncBlackList"] = forceSyncBlackList
|
||||
@@ -36,53 +31,60 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendsInfo(BaseCallback(result: result), methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetDesignatedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationList(BaseCallback(result: result))
|
||||
func getRecvFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
|
||||
func getSendFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendList(BaseCallback(result: result))
|
||||
Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func setFriendInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendInfo(methodCall.toJsonString(), BaseCallback(result: result))
|
||||
func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func addToBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddToBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func getBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetBlackList(BaseCallback(result: result))
|
||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func deleteFromBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFromBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func deleteFromFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFromFriendList(methodCall[jsonString: "uid"], BaseCallback(result: result))
|
||||
func deleteFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"])
|
||||
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)
|
||||
@@ -99,48 +101,47 @@ public class FriendshipManager: BaseServiceManager {
|
||||
// }
|
||||
}
|
||||
|
||||
public class FriendshipListener: NSObject, Open_im_sdkOnFriendshipListenerProtocol {
|
||||
public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol {
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onBlackListAdd(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListAdd", errCode: nil, errMsg: nil, data: userInfo)
|
||||
public func onBlackAdded(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistAdded", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onBlackListDeleted(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListDeleted", errCode: nil, errMsg: nil, data: userInfo)
|
||||
public func onBlackDeleted(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistDeleted", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListAccept(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAccept", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationAccepted(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAccepted", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListAdded(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAdded", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationAdded(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAdded", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListDeleted(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListDeleted", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationDeleted(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationDeleted", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendApplicationListReject(_ applyUserInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListReject", errCode: nil, errMsg: nil, data: applyUserInfo)
|
||||
public func onFriendApplicationRejected(_ friendApplication: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationRejected", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendInfoChanged(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendListAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
public func onFriendAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendListDeleted(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListDeleted", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
public func onFriendDeleted(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendDeleted", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// GroupManager.swift
|
||||
// flutter_openim_sdk
|
||||
//
|
||||
// Created by z1u24 on 2021/7/5.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -24,13 +17,23 @@ public class GroupManager: BaseServiceManager {
|
||||
self["joinGroup"] = joinGroup
|
||||
self["quitGroup"] = quitGroup
|
||||
self["transferGroupOwner"] = transferGroupOwner
|
||||
self["getGroupApplicationList"] = getGroupApplicationList
|
||||
self["getRecvGroupApplicationList"] = getRecvGroupApplicationList
|
||||
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){
|
||||
@@ -39,86 +42,122 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInviteUserToGroup(methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkKickGroupMember(methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMembersInfo(methodCall[string: "gid"], methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
Open_im_sdkGetGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMemberList(methodCall[string: "gid"], methodCall[int32: "filter"],
|
||||
methodCall[int32: "next"], BaseCallback(result: result))
|
||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[int32: "filter"],
|
||||
methodCall[int32: "offset"], methodCall[int32: "count"])
|
||||
}
|
||||
|
||||
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result))
|
||||
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCreateGroup(methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"], BaseCallback(result: result))
|
||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"])
|
||||
}
|
||||
|
||||
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupInfo(methodCall[jsonString: "gInfo"], BaseCallback(result: result))
|
||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "gInfo"])
|
||||
}
|
||||
|
||||
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupsInfo(methodCall[jsonString: "gidList"], BaseCallback(result: result))
|
||||
Open_im_sdkGetGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gidList"])
|
||||
}
|
||||
|
||||
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkJoinGroup(methodCall[string: "gid"], methodCall[string: "reason"], BaseCallback(result: result))
|
||||
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){
|
||||
Open_im_sdkQuitGroup(methodCall[string: "gid"], BaseCallback(result: result))
|
||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
}
|
||||
|
||||
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkTransferGroupOwner(methodCall[string: "gid"], methodCall[string: "uid"], BaseCallback(result: result))
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"])
|
||||
}
|
||||
|
||||
func getGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupApplicationList(BaseCallback(result: result))
|
||||
func getRecvGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result))
|
||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
}
|
||||
|
||||
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRefuseGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result))
|
||||
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_sdkOnGroupListenerProtocol {
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
@@ -126,73 +165,43 @@ public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onApplicationProcessed(_ groupId: String?, opUser: String?, agreeOrReject AgreeOrReject: Int32, opReason: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = groupId
|
||||
values["opUser"] = opUser
|
||||
values["agreeOrReject"] = AgreeOrReject
|
||||
values["opReason"] = opReason
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
// public func onApplicationProcessed(_ s: String?,s1: String?,i: Int?,s2: String?) {
|
||||
// let values: NSMutableDictionary = NSMutableDictionary(capacity: 0)
|
||||
// values.setValue(s, forKey: "groupId")
|
||||
// values.setValue(s1, forKey: "opUser")
|
||||
// values.setValue(i, forKey: "agreeOrReject")
|
||||
// values.setValue(s2, forKey: "opReason")
|
||||
// CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values)
|
||||
// }
|
||||
|
||||
public func onGroupCreated(_ s: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupCreated", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onGroupInfoChanged(_ s: String?, groupInfo s1: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["groupInfo"] = s1
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberEnter(_ s: String?, memberList s1: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["memberList"] = s1
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberEnter", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupApplicationRejected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberInvited(_ s: String?,opUser s1: String?, memberList s2: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["opUser"] = s1
|
||||
values["memberList"] = s2
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberInvited", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberKicked(_ s: String?,opUser s1: String?,memberList s2: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["opUser"] = s1
|
||||
values["memberList"] = s2
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberKicked", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupMemberAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onMemberLeave(_ s: String?,member s1: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["member"] = s1
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberLeave", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupMemberDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onReceiveJoinApplication(_ s: String?,member s1: String?,opReason s2: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["groupId"] = s
|
||||
values["member"] = s1
|
||||
values["opReason"] = s2
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinApplication", errCode: nil, errMsg: nil, data: values)
|
||||
public func onGroupMemberInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onJoinedGroupAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onJoinedGroupDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// IMManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/28.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
@@ -12,90 +5,74 @@ public class IMMananger: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
|
||||
self["initSDK"] = initSDK
|
||||
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(methodCall.toJsonString(), SDKListener(channel: self.channel))
|
||||
callBack(result)
|
||||
callBack(result,Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||
}
|
||||
|
||||
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkLogin(methodCall[string: "uid"], methodCall[string: "token"], BaseCallback(result: result))
|
||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"], methodCall[string: "token"])
|
||||
}
|
||||
|
||||
func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkLogout(BaseCallback(result: result))
|
||||
Open_im_sdkLogout(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
callBack(result, Open_im_sdkGetLoginStatus())
|
||||
}
|
||||
|
||||
// func getLoginUid(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// callBack(result, Open_im_sdkGetLoginUser())
|
||||
// }
|
||||
|
||||
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
func wakeUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetSelfInfo(methodCall.toJsonString(), 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 forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkForceSyncLoginUerInfo()
|
||||
callBack(result)
|
||||
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"])
|
||||
}
|
||||
|
||||
func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"])
|
||||
|
||||
func setAppBackgroundStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[bool: "isBackground"])
|
||||
}
|
||||
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceReConn()
|
||||
// callBack(result)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public class SDKListener: NSObject, Open_im_sdkIMSDKListenerProtocol {
|
||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onConnectFailed(_ errCode: Int, errMsg: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
||||
public func onConnectFailed(_ errCode: Int32, errMsg: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
||||
}
|
||||
|
||||
|
||||
public func onConnectSuccess() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onConnecting() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onKickedOffline() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onUserTokenExpired() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
//
|
||||
// MessageManager.swift
|
||||
// Runner
|
||||
//
|
||||
// Created by z1u24 on 2021/6/29.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class MessageManager: BaseServiceManager {
|
||||
private let KEY_ID: String = "id"
|
||||
private var listeners: [String: AdvancedMsgListener] = [:]
|
||||
// private var listeners: [String: AdvancedMsgListener] = [:]
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
|
||||
self["addAdvancedMsgListener"] = addAdvancedMsgListener
|
||||
self["removeAdvancedMsgListener"] = removeAdvancedMsgListener
|
||||
self["setAdvancedMsgListener"] = setAdvancedMsgListener
|
||||
self["sendMessage"] = sendMessage
|
||||
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
|
||||
@@ -35,242 +26,410 @@ public class MessageManager: BaseServiceManager {
|
||||
self["createVideoMessage"] = createVideoMessage
|
||||
self["createVideoMessageFromFullPath"] = createVideoMessageFromFullPath
|
||||
self["createFileMessage"] = createFileMessage
|
||||
self["createFileMessageFromFullPath"] = createFileMessageFromFullPath
|
||||
self["createMergerMessage"] = createMergerMessage
|
||||
self["createForwardMessage"] = createForwardMessage
|
||||
self["createLocationMessage"] = createLocationMessage
|
||||
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 addAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let key = methodCall[string: KEY_ID]
|
||||
if listeners[key] == nil {
|
||||
let lis = AdvancedMsgListener(channel: channel, id: key)
|
||||
listeners[key] = lis
|
||||
Open_im_sdkAddAdvancedMsgListener(lis)
|
||||
print("=================add msg listener======\n\(lis)")
|
||||
}
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func removeAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let key = methodCall[string: KEY_ID]
|
||||
if let lis = listeners[key] {
|
||||
listeners[key] = nil
|
||||
// Open_im_sdkRemoveAdvancedMsgListener(lis)
|
||||
}
|
||||
let lis = AdvancedMsgListener(channel: channel, id: key)
|
||||
Open_im_sdkSetAdvancedMsgListener(lis)
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||
// sendMsgProgressListener.setCall(methodCall: methodCall)
|
||||
// sendMsgProgressListener.setResult(result: result)
|
||||
print("===============sendMessage===============")
|
||||
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[jsonString: "message"], methodCall[string: "userID"],
|
||||
methodCall[string: "groupID"], methodCall[bool: "onlineUserOnly"])
|
||||
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
|
||||
}
|
||||
|
||||
func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall.toJsonString())
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
// deprecated
|
||||
func deleteMessages(methodCall: FlutterMethodCall, result: FlutterResult){
|
||||
}
|
||||
|
||||
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[jsonString: "message"],
|
||||
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 markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), 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(methodCall[string: "userID"], methodCall[string: "typing"])
|
||||
callBack(result)
|
||||
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: "text"]))
|
||||
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: "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){
|
||||
callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "imagePath"]))
|
||||
callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "operationID"], methodCall[string: "imagePath"]))
|
||||
}
|
||||
|
||||
func createImageMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "imagePath"]))
|
||||
callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "imagePath"]))
|
||||
}
|
||||
|
||||
func createSoundMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
}
|
||||
|
||||
func createSoundMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"]))
|
||||
}
|
||||
|
||||
func createVideoMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
}
|
||||
|
||||
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(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[jsonString: "messageList"], methodCall[string: "title"],
|
||||
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
||||
methodCall[jsonString: "summaryList"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createForwardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateForwardMessage(methodCall[jsonString: "message"]))
|
||||
callBack(result, Open_im_sdkCreateForwardMessage(methodCall[string: "operationID"], methodCall[jsonString: "message"]))
|
||||
}
|
||||
|
||||
func createLocationMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "description"],
|
||||
let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "operationID"], methodCall[string: "description"],
|
||||
methodCall[double: "longitude"], methodCall[double: "latitude"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createCustomMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "data"],
|
||||
let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "operationID"], methodCall[string: "data"],
|
||||
methodCall[string: "extension"], methodCall[string: "description"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"])
|
||||
let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "operationID"], methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateCardMessage(methodCall[jsonString: "cardMessage"]))
|
||||
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()
|
||||
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"])
|
||||
}
|
||||
|
||||
func searchLocalMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchLocalMessages(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "filter"])
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteAllMsgFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteAllMsgFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func markMessageAsReadByConID(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkMarkMessageAsReadByConID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func clearC2CHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func getHistoryMessageListReverse(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
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 clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "userID"])
|
||||
|
||||
func setMessageKvInfoListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetMessageKvInfoListener(MessageKvInfoListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "groupID"])
|
||||
|
||||
func setMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
|
||||
}
|
||||
|
||||
public class SendMsgProgressListener: NSObject, Open_im_sdkSendMsgCallBackProtocol {
|
||||
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
|
||||
}
|
||||
|
||||
// func setResult(result: @escaping FlutterResult){
|
||||
// self.result = result
|
||||
// }
|
||||
//
|
||||
// func setCall(methodCall: FlutterMethodCall){
|
||||
// self.call = methodCall
|
||||
// }
|
||||
|
||||
public func onError(_ errCode: Int, errMsg: String?) {
|
||||
print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)")
|
||||
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||
}
|
||||
|
||||
public func onProgress(_ progress: Int) {
|
||||
// guard let call = call else {
|
||||
// return
|
||||
// }
|
||||
var values: [String: Any] = [:]
|
||||
print("=================onProgress============\nprogress:\(progress)")
|
||||
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?) {
|
||||
print("=================onSuccess============\nsuccess:\(data!)")
|
||||
DispatchQueue.main.async { self.result(data) }
|
||||
}
|
||||
|
||||
|
||||
func deleteMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
|
||||
}
|
||||
|
||||
public class AdvancedMsgListener: NSObject, Open_im_sdkOnAdvancedMsgListenerProtocol {
|
||||
private let channel: FlutterMethodChannel
|
||||
private let id: String
|
||||
|
||||
// private var values: [String: Any] = [:]
|
||||
|
||||
init(channel: FlutterMethodChannel, id: String) {
|
||||
self.channel = channel
|
||||
self.id = id
|
||||
// values["id"] = id
|
||||
}
|
||||
|
||||
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 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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
59
ios/Classes/Module/OrganizationManager.swift
Normal file
59
ios/Classes/Module/OrganizationManager.swift
Normal 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)
|
||||
}
|
||||
|
||||
}
|
||||
148
ios/Classes/Module/SignalingManager.swift
Normal file
148
ios/Classes/Module/SignalingManager.swift
Normal 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)
|
||||
}
|
||||
|
||||
}
|
||||
43
ios/Classes/Module/UserManager.swift
Normal file
43
ios/Classes/Module/UserManager.swift
Normal file
@@ -0,0 +1,43 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class UserManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setUserListener"] = setUserListener
|
||||
self["getUsersInfo"] = getUsersInfo
|
||||
self["setSelfInfo"] = setSelfInfo
|
||||
self["getSelfUserInfo"] = getSelfUserInfo
|
||||
}
|
||||
|
||||
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetUserListener(UserListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
}
|
||||
|
||||
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetSelfInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||
}
|
||||
}
|
||||
44
ios/Classes/Module/WorkMomentsManager.swift
Normal file
44
ios/Classes/Module/WorkMomentsManager.swift
Normal file
@@ -0,0 +1,44 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class WorkMomentsManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setWorkMomentsListener"] = setWorkMomentsListener
|
||||
self["getWorkMomentsUnReadCount"] = getWorkMomentsUnReadCount
|
||||
self["getWorkMomentsNotification"] = getWorkMomentsNotification
|
||||
self["clearWorkMomentsNotification"] = clearWorkMomentsNotification
|
||||
}
|
||||
|
||||
func setWorkMomentsListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetWorkMomentsListener(WorkMomentsListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func getWorkMomentsUnReadCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetWorkMomentsUnReadCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func clearWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkClearWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class WorkMomentsListener: NSObject, Open_im_sdk_callbackOnWorkMomentsListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onRecvNewNotification() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "workMomentsListener", type: "OnRecvNewNotification", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,12 +2,15 @@ import Flutter
|
||||
import UIKit
|
||||
|
||||
public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
|
||||
let imManager: IMMananger
|
||||
let conversationManager: ConversationManager
|
||||
let friendshipManager: FriendshipManager
|
||||
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)
|
||||
@@ -15,6 +18,10 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
self.friendshipManager = FriendshipManager(channel: channel)
|
||||
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) {
|
||||
@@ -36,6 +43,14 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
friendshipManager.handleMethod(call: call, result: result)
|
||||
case "groupManager":
|
||||
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")
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
// Objective-C API for talking to the following Go packages
|
||||
//
|
||||
// open_im_sdk/open_im_sdk
|
||||
//
|
||||
// File is generated by gomobile bind. Do not edit.
|
||||
#ifndef __OpenIMCore_FRAMEWORK_H__
|
||||
#define __OpenIMCore_FRAMEWORK_H__
|
||||
|
||||
#include "Open_im_sdk.objc.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
// Objective-C API for talking to Go package.
|
||||
// gobind -lang=objc
|
||||
//
|
||||
// File is generated by gobind. Do not edit.
|
||||
|
||||
#ifndef __Universe_H__
|
||||
#define __Universe_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
|
||||
@protocol Universeerror;
|
||||
@class Universeerror;
|
||||
|
||||
@protocol Universeerror <NSObject>
|
||||
- (NSString* _Nonnull)error;
|
||||
@end
|
||||
|
||||
@class Universeerror;
|
||||
|
||||
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (NSString* _Nonnull)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
#ifndef __GO_REF_HDR__
|
||||
#define __GO_REF_HDR__
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
// GoSeqRef is an object tagged with an integer for passing back and
|
||||
// forth across the language boundary. A GoSeqRef may represent either
|
||||
// an instance of a Go object, or an Objective-C object passed to Go.
|
||||
// The explicit allocation of a GoSeqRef is used to pin a Go object
|
||||
// when it is passed to Objective-C. The Go seq package maintains a
|
||||
// reference to the Go object in a map keyed by the refnum along with
|
||||
// a reference count. When the reference count reaches zero, the Go
|
||||
// seq package will clear the corresponding entry in the map.
|
||||
@interface GoSeqRef : NSObject {
|
||||
}
|
||||
@property(readonly) int32_t refnum;
|
||||
@property(strong) id obj; // NULL when representing a Go object.
|
||||
|
||||
// new GoSeqRef object to proxy a Go object. The refnum must be
|
||||
// provided from Go side.
|
||||
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
|
||||
|
||||
- (int32_t)incNum;
|
||||
|
||||
@end
|
||||
|
||||
@protocol goSeqRefInterface
|
||||
-(GoSeqRef*) _ref;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,8 +0,0 @@
|
||||
framework module "OpenIMCore" {
|
||||
header "ref.h"
|
||||
header "Open_im_sdk.objc.h"
|
||||
header "Universe.objc.h"
|
||||
header "OpenIMCore.h"
|
||||
|
||||
export *
|
||||
}
|
||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -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'
|
||||
|
||||
@@ -1,32 +1,47 @@
|
||||
library flutter_openim_sdk;
|
||||
|
||||
export 'src/enum/conversation_type.dart';
|
||||
export 'src/enum/group_role.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/connect_listener.dart';
|
||||
export 'src/listener/conversation_listener.dart';
|
||||
export 'src/listener/custom_business_listener.dart';
|
||||
export 'src/listener/friendship_listener.dart';
|
||||
export 'src/listener/group_listener.dart';
|
||||
export 'src/listener/impl/advanced_msg_listener.dart';
|
||||
export 'src/listener/impl/conversation_listener.dart';
|
||||
export 'src/listener/impl/friendship_listener.dart';
|
||||
export 'src/listener/impl/group_listener.dart';
|
||||
export 'src/listener/impl/init_sdk_listener.dart';
|
||||
export 'src/listener/impl/msg_send_progress_listener.dart';
|
||||
export 'src/listener/init_sdk_listener.dart';
|
||||
export 'src/listener/listener_for_service.dart';
|
||||
export 'src/listener/message_kv_info_listener.dart';
|
||||
export 'src/listener/msg_send_progress_listener.dart';
|
||||
export 'src/listener/organization_listener.dart';
|
||||
export 'src/listener/signaling_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';
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
/// 会话类型
|
||||
class ConversationType {
|
||||
static const single_chat = 1;
|
||||
static const group_chat = 2;
|
||||
/// 单聊
|
||||
static const single = 1;
|
||||
|
||||
/// 群
|
||||
static const group = 2;
|
||||
|
||||
/// 大群
|
||||
static const superGroup = 3;
|
||||
|
||||
/// 通知
|
||||
static const notification = 4;
|
||||
}
|
||||
|
||||
17
lib/src/enum/group_at_type.dart
Normal file
17
lib/src/enum/group_at_type.dart
Normal 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;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
class GroupRole {
|
||||
static const member = 0;
|
||||
static const owner = 1;
|
||||
static const admin = 2;
|
||||
}
|
||||
11
lib/src/enum/group_role_level.dart
Normal file
11
lib/src/enum/group_role_level.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
/// 群成员角色
|
||||
class GroupRoleLevel {
|
||||
/// 普通成员
|
||||
static const member = 1;
|
||||
|
||||
/// 群主
|
||||
static const owner = 2;
|
||||
|
||||
/// 管理员
|
||||
static const admin = 3;
|
||||
}
|
||||
8
lib/src/enum/group_type.dart
Normal file
8
lib/src/enum/group_type.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
/// 组类型
|
||||
class GroupType {
|
||||
/// 普通群
|
||||
static const int general = 0;
|
||||
|
||||
/// 工作群
|
||||
static const int work = 2;
|
||||
}
|
||||
11
lib/src/enum/group_verification.dart
Normal file
11
lib/src/enum/group_verification.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
/// 进群验证设置选项
|
||||
class GroupVerification {
|
||||
/// 申请需要同意 邀请直接进
|
||||
static const int applyNeedVerificationInviteDirectly = 0;
|
||||
|
||||
/// 所有人进群需要验证,除了群主管理员邀
|
||||
static const int allNeedVerification = 1;
|
||||
|
||||
/// 直接进群
|
||||
static const int directly = 2;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
/// callback类型
|
||||
class ListenerType {
|
||||
static const simpleMsgListener = 'simpleMsgListener';
|
||||
static const initSDKListener = 'initSDKListener';
|
||||
static const connectListener = 'connectListener';
|
||||
static const userListener = 'userListener';
|
||||
static const groupListener = 'groupListener';
|
||||
static const advancedMsgListener = 'advancedMsgListener';
|
||||
static const conversationListener = 'conversationListener';
|
||||
static const friendListener = 'friendListener';
|
||||
static const signalingListener = 'signalingListener';
|
||||
static const msgSendProgressListener = "msgSendProgressListener";
|
||||
static const workMomentsListener = "workMomentsListener";
|
||||
static const organizationListener = "organizationListener";
|
||||
static const customBusinessListener = "customBusinessListener";
|
||||
static const messageKvInfoListener = "messageKvInfoListener";
|
||||
static const listenerForService = "listenerForService";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
/// 消息发送状态
|
||||
class MessageStatus {
|
||||
/// 发送中
|
||||
static const sending = 1;
|
||||
|
||||
/// 已发送成功
|
||||
static const succeeded = 2;
|
||||
|
||||
/// 发送失败
|
||||
static const failed = 3;
|
||||
|
||||
/// 已经删除
|
||||
static const deleted = 4;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
14
lib/src/enum/sdk_error_code.dart
Normal file
14
lib/src/enum/sdk_error_code.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
/// 消息发送失败
|
||||
class MessageFailedCode {
|
||||
/// 被对方拉黑
|
||||
static const int blockedByFriend = 600;
|
||||
|
||||
/// 被对方删除
|
||||
static const int deletedByFriend = 601;
|
||||
}
|
||||
|
||||
/// 添加好友失败
|
||||
class AddFriendFailedCode {
|
||||
/// 该用户已设置不可添加
|
||||
static const int refuseToAddFriends = 10007;
|
||||
}
|
||||
@@ -1,17 +1,68 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class AdvancedMsgListener {
|
||||
/// 消息监听
|
||||
class OnAdvancedMsgListener {
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CMessageReadReceipt;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
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
|
||||
final String id;
|
||||
String id;
|
||||
|
||||
AdvancedMsgListener() : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CMessageReadReceipt,
|
||||
this.onRecvGroupMessageReadReceipt,
|
||||
@deprecated this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvMessageRevokedV2,
|
||||
this.onRecvMessageExtensionsChanged,
|
||||
this.onRecvMessageExtensionsDeleted,
|
||||
this.onRecvMessageExtensionsAdded,
|
||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
|
||||
/// Receive new message
|
||||
void recvNewMessage(Message msg);
|
||||
/// C2C消息已读回执
|
||||
void recvC2CMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvC2CMessageReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// Message read receipt
|
||||
void recvC2CReadReceipt(List<HaveReadInfo> list);
|
||||
/// 群消息已读回执
|
||||
void recvGroupMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupMessageReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// A friend withdrew a message
|
||||
void recvMessageRevoked(String msgId);
|
||||
/// 消息被撤回
|
||||
void recvMessageRevoked(String msgId) {
|
||||
onRecvMessageRevoked?.call(msgId);
|
||||
}
|
||||
|
||||
/// 收到了一条新消息
|
||||
void recvNewMessage(Message 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);
|
||||
}
|
||||
}
|
||||
|
||||
41
lib/src/listener/connect_listener.dart
Normal file
41
lib/src/listener/connect_listener.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
/// SDK 连接状态监听
|
||||
class OnConnectListener {
|
||||
Function(int? code, String? errorMsg)? onConnectFailed;
|
||||
Function()? onConnectSuccess;
|
||||
Function()? onConnecting;
|
||||
Function()? onKickedOffline;
|
||||
Function()? onUserTokenExpired;
|
||||
|
||||
OnConnectListener({
|
||||
this.onConnectFailed,
|
||||
this.onConnectSuccess,
|
||||
this.onConnecting,
|
||||
this.onKickedOffline,
|
||||
this.onUserTokenExpired,
|
||||
});
|
||||
|
||||
/// SDK连接服务器失败
|
||||
void connectFailed(int? code, String? errorMsg) {
|
||||
onConnectFailed?.call(code, errorMsg);
|
||||
}
|
||||
|
||||
/// SDK连接服务器成功
|
||||
void connectSuccess() {
|
||||
onConnectSuccess?.call();
|
||||
}
|
||||
|
||||
/// SDK正在连接服务器
|
||||
void connecting() {
|
||||
onConnecting?.call();
|
||||
}
|
||||
|
||||
/// 账号已在其他地方登录,当前设备被踢下线
|
||||
void kickedOffline() {
|
||||
onKickedOffline?.call();
|
||||
}
|
||||
|
||||
/// 登录凭证过期,需要重新登录
|
||||
void userTokenExpired() {
|
||||
onUserTokenExpired?.call();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,47 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class ConversationListener {
|
||||
void conversationChanged(List<ConversationInfo> list);
|
||||
/// 会话监听
|
||||
class OnConversationListener {
|
||||
Function(List<ConversationInfo> list)? onConversationChanged;
|
||||
Function(List<ConversationInfo> list)? onNewConversation;
|
||||
Function(int count)? onTotalUnreadMessageCountChanged;
|
||||
Function()? onSyncServerFailed;
|
||||
Function()? onSyncServerFinish;
|
||||
Function()? onSyncServerStart;
|
||||
|
||||
void newConversation(List<ConversationInfo> list);
|
||||
OnConversationListener({
|
||||
this.onConversationChanged,
|
||||
this.onNewConversation,
|
||||
this.onTotalUnreadMessageCountChanged,
|
||||
this.onSyncServerFailed,
|
||||
this.onSyncServerFinish,
|
||||
this.onSyncServerStart,
|
||||
});
|
||||
|
||||
void syncServerFailed();
|
||||
/// 会话发生改变
|
||||
void conversationChanged(List<ConversationInfo> list) {
|
||||
onConversationChanged?.call(list);
|
||||
}
|
||||
|
||||
void syncServerFinish();
|
||||
/// 有新会话产生
|
||||
void newConversation(List<ConversationInfo> list) {
|
||||
onNewConversation?.call(list);
|
||||
}
|
||||
|
||||
void syncServerStart();
|
||||
/// 未读消息总数发送改变
|
||||
void totalUnreadMessageCountChanged(int i) {
|
||||
onTotalUnreadMessageCountChanged?.call(i);
|
||||
}
|
||||
|
||||
void totalUnreadMessageCountChanged(int i);
|
||||
void syncServerFailed() {
|
||||
onSyncServerFailed?.call();
|
||||
}
|
||||
|
||||
void syncServerFinish() {
|
||||
onSyncServerFinish?.call();
|
||||
}
|
||||
|
||||
void syncServerStart() {
|
||||
onSyncServerStart?.call();
|
||||
}
|
||||
}
|
||||
|
||||
9
lib/src/listener/custom_business_listener.dart
Normal file
9
lib/src/listener/custom_business_listener.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
class OnCustomBusinessListener {
|
||||
Function(String s)? onRecvCustomBusinessMessage;
|
||||
|
||||
OnCustomBusinessListener({this.onRecvCustomBusinessMessage});
|
||||
|
||||
void recvCustomBusinessMessage(String s) {
|
||||
onRecvCustomBusinessMessage?.call(s);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,71 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class FriendshipListener {
|
||||
void blackListAdd(UserInfo u);
|
||||
/// 好友关系监听
|
||||
class OnFriendshipListener {
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationRejected;
|
||||
Function(FriendInfo i)? onFriendAdded;
|
||||
Function(FriendInfo i)? onFriendDeleted;
|
||||
Function(FriendInfo i)? onFriendInfoChanged;
|
||||
Function(BlacklistInfo i)? onBlacklistAdded;
|
||||
Function(BlacklistInfo i)? onBlacklistDeleted;
|
||||
|
||||
void blackListDeleted(UserInfo u);
|
||||
OnFriendshipListener({
|
||||
this.onBlacklistAdded,
|
||||
this.onBlacklistDeleted,
|
||||
this.onFriendAdded,
|
||||
this.onFriendApplicationAccepted,
|
||||
this.onFriendApplicationAdded,
|
||||
this.onFriendApplicationDeleted,
|
||||
this.onFriendApplicationRejected,
|
||||
this.onFriendDeleted,
|
||||
this.onFriendInfoChanged,
|
||||
});
|
||||
|
||||
void friendApplicationListAccept(UserInfo u);
|
||||
/// 已被加入黑名单
|
||||
void blacklistAdded(BlacklistInfo u) {
|
||||
onBlacklistAdded?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationListAdded(UserInfo u);
|
||||
/// 已从黑名单移除
|
||||
void blacklistDeleted(BlacklistInfo u) {
|
||||
onBlacklistDeleted?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationListDeleted(UserInfo u);
|
||||
/// 好友已添加
|
||||
void friendAdded(FriendInfo u) {
|
||||
onFriendAdded?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationListReject(UserInfo u);
|
||||
/// 好友申请已被接受
|
||||
void friendApplicationAccepted(FriendApplicationInfo u) {
|
||||
onFriendApplicationAccepted?.call(u);
|
||||
}
|
||||
|
||||
void friendInfoChanged(UserInfo u);
|
||||
/// 已添加新的好友申请
|
||||
void friendApplicationAdded(FriendApplicationInfo u) {
|
||||
onFriendApplicationAdded?.call(u);
|
||||
}
|
||||
|
||||
void friendListAdded(UserInfo u);
|
||||
/// 好友申请已被删除
|
||||
void friendApplicationDeleted(FriendApplicationInfo u) {
|
||||
onFriendApplicationDeleted?.call(u);
|
||||
}
|
||||
|
||||
void friendListDeleted(UserInfo u);
|
||||
/// 好友申请已被拒绝
|
||||
void friendApplicationRejected(FriendApplicationInfo u) {
|
||||
onFriendApplicationRejected?.call(u);
|
||||
}
|
||||
|
||||
/// 好友已被删除
|
||||
void friendDeleted(FriendInfo u) {
|
||||
onFriendDeleted?.call(u);
|
||||
}
|
||||
|
||||
/// 好友资料发生改变
|
||||
void friendInfoChanged(FriendInfo u) {
|
||||
onFriendInfoChanged?.call(u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,78 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class GroupListener {
|
||||
void memberEnter(String groupId, List<GroupMembersInfo> list);
|
||||
/// 群组监听
|
||||
class OnGroupListener {
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationDeleted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationRejected;
|
||||
Function(GroupInfo info)? onGroupInfoChanged;
|
||||
Function(GroupMembersInfo info)? onGroupMemberAdded;
|
||||
Function(GroupMembersInfo info)? onGroupMemberDeleted;
|
||||
Function(GroupMembersInfo info)? onGroupMemberInfoChanged;
|
||||
Function(GroupInfo info)? onJoinedGroupAdded;
|
||||
Function(GroupInfo info)? onJoinedGroupDeleted;
|
||||
|
||||
void memberLeave(String groupId, GroupMembersInfo info);
|
||||
OnGroupListener({
|
||||
this.onGroupApplicationAccepted,
|
||||
this.onGroupApplicationAdded,
|
||||
this.onGroupApplicationDeleted,
|
||||
this.onGroupApplicationRejected,
|
||||
this.onGroupInfoChanged,
|
||||
this.onGroupMemberAdded,
|
||||
this.onGroupMemberDeleted,
|
||||
this.onGroupMemberInfoChanged,
|
||||
this.onJoinedGroupAdded,
|
||||
this.onJoinedGroupDeleted,
|
||||
});
|
||||
|
||||
void memberInvited(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list);
|
||||
/// 群申请已被接受
|
||||
void groupApplicationAccepted(GroupApplicationInfo info) {
|
||||
onGroupApplicationAccepted?.call(info);
|
||||
}
|
||||
|
||||
void memberKicked(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list);
|
||||
/// 群申请已被添加
|
||||
void groupApplicationAdded(GroupApplicationInfo info) {
|
||||
onGroupApplicationAdded?.call(info);
|
||||
}
|
||||
|
||||
void groupCreated(String groupId);
|
||||
/// 群申请已被删除
|
||||
void groupApplicationDeleted(GroupApplicationInfo info) {
|
||||
onGroupApplicationDeleted?.call(info);
|
||||
}
|
||||
|
||||
void groupInfoChanged(String groupId, GroupInfo info);
|
||||
/// 群申请已被拒绝
|
||||
void groupApplicationRejected(GroupApplicationInfo info) {
|
||||
onGroupApplicationRejected?.call(info);
|
||||
}
|
||||
|
||||
void receiveJoinApplication(
|
||||
String groupId, GroupMembersInfo info, String opReason);
|
||||
/// 群资料发生改变
|
||||
void groupInfoChanged(GroupInfo info) {
|
||||
onGroupInfoChanged?.call(info);
|
||||
}
|
||||
|
||||
void applicationProcessed(String groupId, GroupMembersInfo opUser,
|
||||
int agreeOrReject, String opReason);
|
||||
/// 群成员已添加
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnAdvancedMsgListener extends AdvancedMsgListener {
|
||||
Function(List<HaveReadInfo> list)? onRecvC2CReadReceipt;
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CReadReceipt,
|
||||
this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
});
|
||||
|
||||
@override
|
||||
void recvC2CReadReceipt(List<HaveReadInfo> list) {
|
||||
if (null != onRecvC2CReadReceipt) onRecvC2CReadReceipt!(list);
|
||||
}
|
||||
|
||||
@override
|
||||
void recvMessageRevoked(String msgId) {
|
||||
if (null != onRecvMessageRevoked) onRecvMessageRevoked!(msgId);
|
||||
}
|
||||
|
||||
@override
|
||||
void recvNewMessage(Message msg) {
|
||||
if (null != onRecvNewMessage) onRecvNewMessage!(msg);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnConversationListener extends ConversationListener {
|
||||
Function(List<ConversationInfo> list)? onConversationChanged;
|
||||
Function(List<ConversationInfo> list)? onNewConversation;
|
||||
Function(int count)? onTotalUnreadMessageCountChanged;
|
||||
Function()? onSyncServerFailed;
|
||||
Function()? onSyncServerFinish;
|
||||
Function()? onSyncServerStart;
|
||||
|
||||
OnConversationListener({
|
||||
this.onConversationChanged,
|
||||
this.onNewConversation,
|
||||
this.onTotalUnreadMessageCountChanged,
|
||||
this.onSyncServerFailed,
|
||||
this.onSyncServerFinish,
|
||||
this.onSyncServerStart,
|
||||
});
|
||||
|
||||
@override
|
||||
void conversationChanged(List<ConversationInfo> list) {
|
||||
if (onConversationChanged != null) onConversationChanged!(list);
|
||||
}
|
||||
|
||||
@override
|
||||
void newConversation(List<ConversationInfo> list) {
|
||||
if (onNewConversation != null) onNewConversation!(list);
|
||||
}
|
||||
|
||||
@override
|
||||
void syncServerFailed() {
|
||||
if (onSyncServerFailed != null) onSyncServerFailed!();
|
||||
}
|
||||
|
||||
@override
|
||||
void syncServerFinish() {
|
||||
if (onSyncServerFinish != null) onSyncServerFinish!();
|
||||
}
|
||||
|
||||
@override
|
||||
void syncServerStart() {
|
||||
if (onSyncServerStart != null) onSyncServerStart!();
|
||||
}
|
||||
|
||||
@override
|
||||
void totalUnreadMessageCountChanged(int i) {
|
||||
if (onTotalUnreadMessageCountChanged != null)
|
||||
onTotalUnreadMessageCountChanged!(i);
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnFriendshipListener extends FriendshipListener {
|
||||
Function(UserInfo u)? onBlackListAdd;
|
||||
Function(UserInfo u)? onBlackListDeleted;
|
||||
Function(UserInfo u)? onFriendApplicationListAccept;
|
||||
Function(UserInfo u)? onFriendApplicationListAdded;
|
||||
Function(UserInfo u)? onFriendApplicationListDeleted;
|
||||
Function(UserInfo u)? onFriendApplicationListReject;
|
||||
Function(UserInfo u)? onFriendInfoChanged;
|
||||
Function(UserInfo u)? onFriendListAdded;
|
||||
Function(UserInfo u)? onFriendListDeleted;
|
||||
|
||||
OnFriendshipListener({
|
||||
this.onBlackListAdd,
|
||||
this.onBlackListDeleted,
|
||||
this.onFriendApplicationListAccept,
|
||||
this.onFriendApplicationListAdded,
|
||||
this.onFriendApplicationListDeleted,
|
||||
this.onFriendApplicationListReject,
|
||||
this.onFriendInfoChanged,
|
||||
this.onFriendListAdded,
|
||||
this.onFriendListDeleted,
|
||||
});
|
||||
|
||||
@override
|
||||
void blackListAdd(UserInfo u) {
|
||||
if (null != onBlackListAdd) onBlackListAdd!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void blackListDeleted(UserInfo u) {
|
||||
if (null != onBlackListDeleted) onBlackListDeleted!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListAccept(UserInfo u) {
|
||||
if (null != onFriendApplicationListAccept)
|
||||
onFriendApplicationListAccept!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListAdded(UserInfo u) {
|
||||
if (null != onFriendApplicationListAdded) onFriendApplicationListAdded!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListDeleted(UserInfo u) {
|
||||
if (null != onFriendApplicationListDeleted)
|
||||
onFriendApplicationListDeleted!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendApplicationListReject(UserInfo u) {
|
||||
if (null != onFriendApplicationListReject)
|
||||
onFriendApplicationListReject!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendInfoChanged(UserInfo u) {
|
||||
if (null != onFriendInfoChanged) onFriendInfoChanged!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendListAdded(UserInfo u) {
|
||||
if (null != onFriendListAdded) onFriendListAdded!(u);
|
||||
}
|
||||
|
||||
@override
|
||||
void friendListDeleted(UserInfo u) {
|
||||
if (null != onFriendListDeleted) onFriendListDeleted!(u);
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnGroupListener extends GroupListener {
|
||||
Function(String groupId, GroupMembersInfo opUser, int agreeOrReject,
|
||||
String opReason)? onApplicationProcessed;
|
||||
Function(String groupId)? onGroupCreated;
|
||||
Function(String groupId, GroupInfo info)? onGroupInfoChanged;
|
||||
Function(String groupId, List<GroupMembersInfo> list)? onMemberEnter;
|
||||
Function(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)?
|
||||
onMemberInvited;
|
||||
Function(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)?
|
||||
onMemberKicked;
|
||||
Function(String groupId, GroupMembersInfo info)? onMemberLeave;
|
||||
Function(String groupId, GroupMembersInfo info, String opReason)?
|
||||
onReceiveJoinApplication;
|
||||
|
||||
OnGroupListener({
|
||||
this.onApplicationProcessed,
|
||||
this.onGroupCreated,
|
||||
this.onGroupInfoChanged,
|
||||
this.onMemberEnter,
|
||||
this.onMemberInvited,
|
||||
this.onMemberKicked,
|
||||
this.onMemberLeave,
|
||||
this.onReceiveJoinApplication,
|
||||
});
|
||||
|
||||
@override
|
||||
void applicationProcessed(String groupId, GroupMembersInfo opUser,
|
||||
int agreeOrReject, String opReason) {
|
||||
if (null != onApplicationProcessed)
|
||||
onApplicationProcessed!(groupId, opUser, agreeOrReject, opReason);
|
||||
}
|
||||
|
||||
@override
|
||||
void groupCreated(String groupId) {
|
||||
if (null != onGroupCreated) onGroupCreated!(groupId);
|
||||
}
|
||||
|
||||
@override
|
||||
void groupInfoChanged(String groupId, GroupInfo info) {
|
||||
if (null != onGroupInfoChanged) onGroupInfoChanged!(groupId, info);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberEnter(String groupId, List<GroupMembersInfo> list) {
|
||||
if (null != onMemberEnter) onMemberEnter!(groupId, list);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberInvited(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) {
|
||||
if (null != onMemberInvited) onMemberInvited!(groupId, opUser, list);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberKicked(
|
||||
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) {
|
||||
if (null != onMemberKicked) onMemberKicked!(groupId, opUser, list);
|
||||
}
|
||||
|
||||
@override
|
||||
void memberLeave(String groupId, GroupMembersInfo info) {
|
||||
if (null != onMemberLeave) onMemberLeave!(groupId, info);
|
||||
}
|
||||
|
||||
@override
|
||||
void receiveJoinApplication(
|
||||
String groupId, GroupMembersInfo info, String opReason) {
|
||||
if (null != onReceiveJoinApplication)
|
||||
onReceiveJoinApplication!(groupId, info, opReason);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnInitSDKListener extends InitSDKListener {
|
||||
Function(int? code, String? errorMsg)? onConnectFailed;
|
||||
Function()? onConnectSuccess;
|
||||
Function()? onConnecting;
|
||||
Function()? onKickedOffline;
|
||||
Function(UserInfo info)? onSelfInfoUpdated;
|
||||
Function()? onUserSigExpired;
|
||||
|
||||
OnInitSDKListener({
|
||||
this.onConnectFailed,
|
||||
this.onConnectSuccess,
|
||||
this.onConnecting,
|
||||
this.onKickedOffline,
|
||||
this.onSelfInfoUpdated,
|
||||
this.onUserSigExpired,
|
||||
});
|
||||
|
||||
@override
|
||||
void connectFailed(int? code, String? errorMsg) {
|
||||
if (null != onConnectFailed) onConnectFailed!(code, errorMsg);
|
||||
}
|
||||
|
||||
@override
|
||||
void connectSuccess() {
|
||||
if (null != onConnectSuccess) onConnectSuccess!();
|
||||
}
|
||||
|
||||
@override
|
||||
void connecting() {
|
||||
if (null != onConnecting) onConnecting!.call();
|
||||
}
|
||||
|
||||
@override
|
||||
void kickedOffline() {
|
||||
if (null != onKickedOffline) onKickedOffline!();
|
||||
}
|
||||
|
||||
@override
|
||||
void selfInfoUpdated(UserInfo info) {
|
||||
if (null != onSelfInfoUpdated) onSelfInfoUpdated!(info);
|
||||
}
|
||||
|
||||
@override
|
||||
void userSigExpired() {
|
||||
if (null != onUserSigExpired) onUserSigExpired!();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OnMsgSendProgressListener extends MsgSendProgressListener {
|
||||
Function(String msgID, int progress)? onProgress;
|
||||
|
||||
OnMsgSendProgressListener({this.onProgress});
|
||||
|
||||
void progress(String msgID, int progress) {
|
||||
if (null != onProgress) onProgress!(msgID, progress);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
abstract class InitSDKListener {
|
||||
/// SDK is connecting to the server
|
||||
void connecting();
|
||||
|
||||
/// SDK has successfully connected to the server
|
||||
void connectSuccess();
|
||||
|
||||
/// SDK failed to connect to the server
|
||||
void connectFailed(int? code, String? errorMsg);
|
||||
|
||||
/// 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.
|
||||
void kickedOffline();
|
||||
|
||||
/// Ticket expired when online.
|
||||
/// At this time, you need to generate a new userSig and call IMManager's login() function to log in again
|
||||
void userSigExpired();
|
||||
|
||||
/// The information of the logged-in user has been updated
|
||||
void selfInfoUpdated(UserInfo info);
|
||||
}
|
||||
38
lib/src/listener/listener_for_service.dart
Normal file
38
lib/src/listener/listener_for_service.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// 好友关系监听
|
||||
class OnListenerForService {
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
|
||||
OnListenerForService({
|
||||
this.onFriendApplicationAdded,
|
||||
this.onFriendApplicationAccepted,
|
||||
this.onGroupApplicationAccepted,
|
||||
this.onGroupApplicationAdded,
|
||||
this.onRecvNewMessage,
|
||||
});
|
||||
|
||||
void friendApplicationAccepted(FriendApplicationInfo u) {
|
||||
onFriendApplicationAccepted?.call(u);
|
||||
}
|
||||
|
||||
void friendApplicationAdded(FriendApplicationInfo u) {
|
||||
onFriendApplicationAdded?.call(u);
|
||||
}
|
||||
|
||||
void groupApplicationAccepted(GroupApplicationInfo info) {
|
||||
onGroupApplicationAccepted?.call(info);
|
||||
}
|
||||
|
||||
void groupApplicationAdded(GroupApplicationInfo info) {
|
||||
onGroupApplicationAdded?.call(info);
|
||||
}
|
||||
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
}
|
||||
11
lib/src/listener/message_kv_info_listener.dart
Normal file
11
lib/src/listener/message_kv_info_listener.dart
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
abstract class MsgSendProgressListener {
|
||||
void progress(String msgID, int progress);
|
||||
/// 消息发送进度监听
|
||||
class OnMsgSendProgressListener {
|
||||
Function(String clientMsgID, int progress)? onProgress;
|
||||
|
||||
OnMsgSendProgressListener({this.onProgress});
|
||||
|
||||
/// 消息发送进度
|
||||
void progress(String clientMsgID, int progress) {
|
||||
onProgress?.call(clientMsgID, progress);
|
||||
}
|
||||
}
|
||||
|
||||
11
lib/src/listener/organization_listener.dart
Normal file
11
lib/src/listener/organization_listener.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
/// 组织架构监听
|
||||
class OnOrganizationListener {
|
||||
Function()? onOrganizationUpdated;
|
||||
|
||||
OnOrganizationListener({this.onOrganizationUpdated});
|
||||
|
||||
/// 组织架构有更新
|
||||
void organizationUpdated() {
|
||||
onOrganizationUpdated?.call();
|
||||
}
|
||||
}
|
||||
88
lib/src/listener/signaling_listener.dart
Normal file
88
lib/src/listener/signaling_listener.dart
Normal 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);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user