Compare commits
200 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dec034a55 | ||
|
|
2b3f062e5c | ||
|
|
a4b52f5895 | ||
|
|
bf9cd3ca21 | ||
|
|
0e1473ff0f | ||
|
|
7e1969d8ad | ||
|
|
e6b479726b | ||
|
|
2aec080e2f | ||
|
|
0ef41147fd | ||
|
|
cd506801cf | ||
|
|
2cafa6bab8 | ||
|
|
ceba9e827f | ||
|
|
4fef487562 | ||
|
|
dc61665f13 | ||
|
|
67251ae7ea | ||
|
|
908d7dd7e7 | ||
|
|
d07495fff6 | ||
|
|
2f8b019d83 | ||
|
|
4a72a37e2b | ||
|
|
b6a71d0b6f | ||
|
|
627ee54a67 | ||
|
|
cc6d164985 | ||
|
|
29b66de9bf | ||
|
|
d419351170 | ||
|
|
8cd7278b50 | ||
|
|
46cc7ff229 | ||
|
|
1356f13fb3 | ||
|
|
1c7f1e7c19 | ||
|
|
034f95e96e | ||
|
|
946474ad02 | ||
|
|
6bd8ec0d2b | ||
|
|
de511cf90d | ||
|
|
a9f2e267cf | ||
|
|
642cc61a2e | ||
|
|
de8c192055 | ||
|
|
05cb6c430c | ||
|
|
b07d104799 | ||
|
|
207e0807e9 | ||
|
|
373e4ddc82 | ||
|
|
b3c0b16092 | ||
|
|
8c50207f7c | ||
|
|
3bf9570d8d | ||
|
|
2a8a6ff7d9 | ||
|
|
9c8b9990c9 | ||
|
|
705863ba66 | ||
|
|
fd39b328bc | ||
|
|
90b96cb413 | ||
|
|
7894327b2c | ||
|
|
96e90d3c0a | ||
|
|
8cc844a408 | ||
|
|
9856ac8281 | ||
|
|
c9fd5d6dfb | ||
|
|
056581f52e | ||
|
|
af0ca0932f | ||
|
|
c0618458fa | ||
|
|
27eb0f78d2 | ||
|
|
169da36d0b | ||
|
|
6bd36c424a | ||
|
|
7995c4af1d | ||
|
|
5bdb9879a7 | ||
|
|
79cbae718c | ||
|
|
61fb9b7dd9 | ||
|
|
bd364ea2fd | ||
|
|
d43259d171 | ||
|
|
ce0c6ff832 | ||
|
|
1f6312d9d3 | ||
|
|
63e5ecf896 | ||
|
|
70a46ed151 | ||
|
|
f04d45f6b8 | ||
|
|
80c79d0fc6 | ||
|
|
4d8ba65f9b | ||
|
|
9df556b837 | ||
|
|
96d6b755cd | ||
|
|
3af726a6f7 | ||
|
|
041d6656bc | ||
|
|
43afb8775a | ||
|
|
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 |
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" />
|
||||
|
||||
39
.idea/libraries/Dart_SDK.xml
generated
39
.idea/libraries/Dart_SDK.xml
generated
@@ -1,26 +1,25 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Dart SDK">
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/async" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/cli" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/collection" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/convert" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/core" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/developer" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/ffi" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/html" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/indexed_db" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/io" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/isolate" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/js" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/js_util" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/math" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
||||
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/svg" />
|
||||
<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" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/async" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/cli" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/collection" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/convert" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/core" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/developer" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/ffi" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/html" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/indexed_db" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/io" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/isolate" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/js" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/js_util" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/math" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/svg" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/typed_data" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/web_audio" />
|
||||
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/web_gl" />
|
||||
</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>
|
||||
263
CHANGELOG.md
263
CHANGELOG.md
@@ -1,3 +1,244 @@
|
||||
## 3.4.0+1
|
||||
|
||||
- Adjust some fields and APIs.
|
||||
|
||||
## 3.4.0
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.4.0)
|
||||
|
||||
## 3.3.0
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/OpenIMSDK/openim-sdk-core/releases/tag/v3.3.0)
|
||||
|
||||
## 3.0.0
|
||||
|
||||
- The super update is not compatible with the previous version
|
||||
|
||||
|
||||
## 2.3.5+4
|
||||
|
||||
- Fix bug
|
||||
|
||||
## 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>
|
||||
@@ -23,13 +264,13 @@
|
||||
## 1.0.8
|
||||
|
||||
1.Upgrade sdk to 1.4.4. </br>
|
||||
2.New and changed conversation return changed data and no longer return all data. </br>
|
||||
3.New conversation paging method.
|
||||
2.Add changed conversation return changed data and no longer return all data. </br>
|
||||
3.Add conversation paging method.
|
||||
|
||||
## 1.0.7
|
||||
|
||||
Upgrade sdk to 1.3.4 </br>
|
||||
New add method setConversationRecvMessageOpt and getConversationRecvMessageOpt
|
||||
Add method setConversationRecvMessageOpt and getConversationRecvMessageOpt
|
||||
|
||||
## 1.0.6
|
||||
|
||||
@@ -67,36 +308,45 @@ Fix bug
|
||||
## 0.0.9+5
|
||||
|
||||
1. Android upgrade sdk to 0.0.17 </br>
|
||||
2. New add createFileMessageFromFullPath method
|
||||
2. Add createFileMessageFromFullPath method
|
||||
|
||||
## 0.0.9+4
|
||||
|
||||
Fix ios friendship params error
|
||||
|
||||
## 0.0.9+3
|
||||
|
||||
Ios native remove method 'removeAdvancedMsgListener'
|
||||
|
||||
## 0.0.9+2
|
||||
|
||||
1. Fix bug
|
||||
2. Upgrade sdk
|
||||
|
||||
## 0.0.9+1
|
||||
|
||||
Fix bug
|
||||
|
||||
## 0.0.9
|
||||
|
||||
Add ios support
|
||||
|
||||
## 0.0.8
|
||||
|
||||
Upgrade sdk to 0.0.14 </br>
|
||||
Sending a message adds a retry mechanism
|
||||
|
||||
## 0.0.7
|
||||
|
||||
1. Add a new method to obtain conversation id based on user id or group id </br>
|
||||
2. Modify the type of conversation manager input parameter sessionType to int
|
||||
|
||||
## 0.0.6
|
||||
|
||||
Fix bug
|
||||
|
||||
## 0.0.5
|
||||
|
||||
Upgrade sdk </br>
|
||||
Fix message error bug
|
||||
|
||||
@@ -105,11 +355,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.
|
||||
|
||||
|
||||
164
README.md
164
README.md
@@ -1,23 +1,159 @@
|
||||
# flutter_openim_sdk
|
||||
[](https://pub.flutter-io.cn/packages/flutter_openim_sdk)
|
||||
[](https://pub.dev/packages/flutter_openim_sdk)
|
||||
[](https://github.com/OpenIMSDK/Open-IM-SDK-Flutter/blob/main/LICENSE)
|
||||
# Flutter Client SDK for OpenIM 👨💻💬
|
||||
|
||||
A flutter im plugin for android and ios.
|
||||
|
||||
#### [中文文档](README.zh-cn.md) | [demo(体验app源代码)](https://github.com/OpenIMSDK/Open-IM-Flutter-Demo.git) | [widget(聊天UI库)](https://github.com/hrxiang/flutter_openim_widget.git)
|
||||
|
||||

|
||||
Use this SDK to add instant messaging capabilities to your Flutter app. By connecting to a self-hosted [OpenIM](https://www.openim.online/) server, you can quickly integrate instant messaging capabilities into your app with just a few lines of code.
|
||||
|
||||
|
||||
The underlying SDK core is implemented in [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core). Using [gomobile](https://github.com/golang/mobile), it can be compiled into an AAR file for Android integration. Android interacts with the [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core) through JSON, and the SDK exposes a re-encapsulated API for easy usage. In terms of data storage, Android utilizes the SQLite layer provided internally by the [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core).
|
||||
|
||||
## Getting Started
|
||||
The underlying SDK core is implemented in [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core). Using [gomobile](https://github.com/golang/mobile), it can be compiled into an XCFramework for iOS integration. iOS interacts with the [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core) through JSON, and the SDK exposes a re-encapsulated API for easy usage. In terms of data storage, iOS utilizes the SQLite layer provided internally by the [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core).
|
||||
|
||||
Based on the above AAR and XCFramework packages, the IM SDK for Flutter is encapsulated through the Flutter plug-in.
|
||||
|
||||
## Documentation 📚
|
||||
|
||||
Visit [https://docs.openim.io/](https://docs.openim.io/) for detailed documentation and guides.
|
||||
|
||||
For the SDK reference, see [https://docs.openim.io/sdks/quickstart/flutter](https://docs.openim.io/sdks/quickstart/flutter).
|
||||
|
||||
## Installation 💻
|
||||
### Adding Dependencies
|
||||
```dart
|
||||
flutter_openim_sdk: lastest
|
||||
```
|
||||
|
||||
## Usage 🚀
|
||||
|
||||
The following examples demonstrate how to use the SDK.
|
||||
### Importing the SDK
|
||||
|
||||
```dart
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
```
|
||||
### Initialize
|
||||
```
|
||||
final success = await OpenIM.iMManager.initSDK(
|
||||
platform: 0, // Platform, referring to the IMPlatform class.
|
||||
apiAddr: "", // SDK's API interface address.
|
||||
wsAddr: "", // SDK's WebSocket address.
|
||||
dataDir: "", // Data storage path. For example, you can use getApplicationDocumentsDirectory() to get a path.
|
||||
objectStorage: 'cos', // Image server (default is 'cos').
|
||||
logLevel: 6, // Log level (default value is 6).
|
||||
listener: OnConnectListener(
|
||||
onConnectSuccess: () {
|
||||
// Successfully connected to the server.
|
||||
},
|
||||
onConnecting: () {
|
||||
// Connecting to the server, suitable for showing a "Connecting" status on the UI.
|
||||
},
|
||||
onConnectFailed: (code, errorMsg) {
|
||||
// Failed to connect to the server, you can notify the user that the current network connection is not available.
|
||||
},
|
||||
onUserSigExpired: () {
|
||||
// User's login token (UserSig) has expired, prompting the user to log in again with a new token.
|
||||
},
|
||||
onKickedOffline: () {
|
||||
// The current user has been kicked offline, and you can prompt the user to log in again with a message like "You have been logged in on another device. Do you want to log in again?"
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
```
|
||||
### Logging In and Listening for Connection Status
|
||||
|
||||
> Note1: You need to [deploy](https://github.com/openimsdk/open-im-server#rocket-quick-start) OpenIM Server first, the default port of OpenIM Server is 10001, 10002.
|
||||
> Note2: You need to set up the listeners first and then log in.
|
||||
|
||||
|
||||
#### 1,Add dependency in yaml
|
||||
```dart
|
||||
// Set listener
|
||||
OpenIM.iMManager
|
||||
//
|
||||
..userManager.setUserListener(OnUserListener(
|
||||
))
|
||||
// Add message listener (remove when not in use)
|
||||
..messageManager.setAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
))
|
||||
|
||||
flutter_openim_sdk: latest
|
||||
// Set up message sending progress listener
|
||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||
))
|
||||
..messageManager.setCustomBusinessListener(
|
||||
)
|
||||
// Set up friend relationship listener
|
||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||
))
|
||||
|
||||
#### 2,Import package
|
||||
// Set up conversation listener
|
||||
..conversationManager.setConversationListener(OnConversationListener(
|
||||
))
|
||||
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
// Set up group listener
|
||||
..groupManager.setGroupListener(OnGroupListener(
|
||||
));
|
||||
|
||||
// Retrieve the profile of the currently logged-in user
|
||||
final userInfo = await OpenIM.iMManager.login(
|
||||
userID: "", // userID is obtained from your own business server
|
||||
token: "", // The token should be acquired by your business server by exchanging with OpenIM server based on a secret key
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
To log into the IM server, you need to create an account and obtain a user ID and token. Refer to the [access token documentation](https://doc.rentsoft.cn/restapi/userManagement/userRegister) for details.
|
||||
|
||||
### Receiving and Sending Messages 💬
|
||||
|
||||
OpenIM makes it easy to send and receive messages. By default, there is no restriction on having a friend relationship to send messages (although you can configure other policies on the server). If you know the user ID of the recipient, you can conveniently send a message to them.
|
||||
|
||||
```dart
|
||||
//Send
|
||||
OpenIM.iMManager.messageManager.sendMessage(
|
||||
message: await OpenIM.iMManager.messageManager.createTextMessage(
|
||||
text: 'hello openim',
|
||||
),
|
||||
userID: userID
|
||||
).catchError((error, _){
|
||||
// Message sent successfully ✉️
|
||||
|
||||
} )
|
||||
.whenComplete(() {
|
||||
// Failed to send message ❌
|
||||
|
||||
});
|
||||
|
||||
//Receive
|
||||
OpenIM.iMManager.messageManager.setAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
onRecvNewMessage:(Message msg) {
|
||||
// Received new message 📨
|
||||
|
||||
}
|
||||
))
|
||||
```
|
||||
|
||||
## Examples 🌟
|
||||
|
||||
You can find a demo Flutter app that uses the SDK in the [open-im-flutter-demo](https://github.com/openimsdk/open-im-flutter-demo) repository.
|
||||
|
||||
|
||||
## Community :busts_in_silhouette:
|
||||
|
||||
- 📚 [OpenIM Community](https://github.com/OpenIMSDK/community)
|
||||
- 💕 [OpenIM Interest Group](https://github.com/Openim-sigs)
|
||||
- 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
|
||||
- :eyes: [Join our wechat (微信群)](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
|
||||
|
||||
## Community Meetings :calendar:
|
||||
|
||||
We want anyone to get involved in our community and contributing code, we offer gifts and rewards, and we welcome you to join us every Thursday night.
|
||||
|
||||
Our conference is in the [OpenIM Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) 🎯, then you can search the Open-IM-Server pipeline to join
|
||||
|
||||
We take notes of each [biweekly meeting](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) in [GitHub discussions](https://github.com/openimsdk/open-im-server/discussions/categories/meeting), Our historical meeting notes, as well as replays of the meetings are available at [Google Docs :bookmark_tabs:](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing).
|
||||
|
||||
## Who are using OpenIM :eyes:
|
||||
|
||||
Check out our [user case studies](https://github.com/OpenIMSDK/community/blob/main/ADOPTERS.md) page for a list of the project users. Don't hesitate to leave a [📝comment](https://github.com/openimsdk/open-im-server/issues/379) and share your use case.
|
||||
|
||||
## License :page_facing_up:
|
||||
|
||||
OpenIM is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/openimsdk/open-im-server/tree/main/LICENSE) for the full license text.
|
||||
|
||||
986
README.zh-cn.md
986
README.zh-cn.md
@@ -1,984 +1,18 @@
|
||||
## SDK使用步骤
|
||||
# flutter_openim_sdk
|
||||
<img src="https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg" alt="image" style="width: 350px; " />
|
||||
|
||||
##### 1,初始化
|
||||
[](https://pub.flutter-io.cn/packages/flutter_openim_sdk)
|
||||
[](https://pub.dev/packages/flutter_openim_sdk)
|
||||
[](https://github.com/OpenIMSDK/Open-IM-SDK-Flutter/blob/main/LICENSE)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.initSDK(
|
||||
platform: 0, // 平台,参照IMPlatform类,
|
||||
apiAddr: "", // SDK的API接口地址。如:http:xxx:10000
|
||||
wsAddr: "", // SDK的web socket地址。如: ws:xxx:17778
|
||||
dataDir: "", // 数据存储路径。如:var apath =(await getApplicationDocumentsDirectory()).path
|
||||
listener: OnConnectListener(
|
||||
onConnectSuccess: () {
|
||||
// 已经成功连接到服务器
|
||||
},
|
||||
onConnecting: () {
|
||||
// 正在连接到服务器,适合在 UI 上展示“正在连接”状态。
|
||||
},
|
||||
onConnectFailed: (code, errorMsg) {
|
||||
// 连接服务器失败,可以提示用户当前网络连接不可用
|
||||
},
|
||||
onUserSigExpired: () {
|
||||
// 登录票据已经过期,请使用新签发的 UserSig 进行登录。
|
||||
},
|
||||
onKickedOffline: () {
|
||||
// 当前用户被踢下线,此时可以 UI 提示用户“您已经在其他端登录了当前账号,是否重新登录?”
|
||||
},
|
||||
),
|
||||
).then((value){
|
||||
if(value == true){
|
||||
// 初始化成功
|
||||
}
|
||||
});
|
||||
```
|
||||
A flutter im plugin for android and ios.
|
||||
|
||||
##### 2,设置监听器
|
||||
#### [demo open source code](https://github.com/OpenIMSDK/Open-IM-Flutter-Demo.git) | [UI library source code](https://github.com/hrxiang/flutter_openim_widget.git)
|
||||
|
||||
```
|
||||
OpenIM.iMManager
|
||||
..userManager.setUserListener(OnUserListener(
|
||||
onSelfInfoUpdated: (userInfo) {
|
||||
// 当前登录用户资料变更回调
|
||||
},
|
||||
))
|
||||
..messageManager.setAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
onRecvNewMessage: (message) {
|
||||
// 收到新消息,界面添加新消息
|
||||
},
|
||||
onRecvMessageRevoked: (messageID) {
|
||||
// 消息成功撤回,从界面移除消息
|
||||
},
|
||||
onRecvC2CReadReceipt: (list) {
|
||||
// 消息被阅读回执,将消息标记为已读
|
||||
},
|
||||
))
|
||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||
onProgress: (messageID, progress) {
|
||||
// 消息发送进度回调
|
||||
},
|
||||
))
|
||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||
onFriendApplicationRejected: (applicationInfo) {
|
||||
// 发出或收到的好友申请被拒绝
|
||||
},
|
||||
onFriendApplicationDeleted: (applicationInfo) {
|
||||
// 发出或收到的好友申请被删除
|
||||
},
|
||||
onFriendApplicationAdded: (applicationInfo) {
|
||||
// 发出或收到的好友申请被添加
|
||||
},
|
||||
onFriendApplicationAccepted: (applicationInfo) {
|
||||
// 发出或收到的好友申请已同意
|
||||
},
|
||||
onFriendAdded: (frinedInfo) {
|
||||
// 好友被添加
|
||||
},
|
||||
onFriendDeleted: (frinedInfo) {
|
||||
// 好友被删除
|
||||
},
|
||||
onFriendInfoChanged: (frinedInfo) {
|
||||
// 朋友的资料发生变化
|
||||
},
|
||||
onBlacklistDeleted: (blackInfo) {
|
||||
// 从黑名单删除
|
||||
},
|
||||
onBlacklistAdded: (blackInfo) {
|
||||
// 拉入黑名单
|
||||
},
|
||||
))
|
||||
..conversationManager.setConversationListener(OnConversationListener(
|
||||
onNewConversation: (list) {
|
||||
// 新增会话
|
||||
},
|
||||
onConversationChanged: (list) {
|
||||
// 已添加的会话发送改变
|
||||
},
|
||||
onTotalUnreadMessageCountChanged: (count) {
|
||||
// 未读消息数发送变化
|
||||
},
|
||||
))
|
||||
..groupManager.setGroupListener(OnGroupListener(
|
||||
onGroupMemberInfoChanged: (memberInfo) {
|
||||
// 组成员信息发生变化
|
||||
},
|
||||
onGroupMemberDeleted: (memberInfo) {
|
||||
// 组成员退出
|
||||
},
|
||||
onGroupMemberAdded: (memberInfo) {
|
||||
// 组成员进入
|
||||
},
|
||||
onGroupApplicationRejected: (applicationInfo) {
|
||||
// 发出或收到的组申请被拒绝
|
||||
},
|
||||
onGroupApplicationDeleted: (applicationInfo) {
|
||||
// 发出或收到的组申请被删除
|
||||
},
|
||||
onGroupApplicationAdded: (applicationInfo) {
|
||||
// 发出或收到的组申请有新增
|
||||
},
|
||||
onGroupApplicationAccepted: (applicationInfo) {
|
||||
// 发出或收到的组申请被接受
|
||||
},
|
||||
onJoinedGroupDeleted: (groupInfo) {
|
||||
// 退出群:退出者收到;踢出群:被踢者收到
|
||||
},
|
||||
onJoinedGroupAdded: (groupInfo) {
|
||||
// 创建群: 初始成员收到;邀请进群:被邀请者收到
|
||||
},
|
||||
onGroupInfoChanged: (groupInfo) {
|
||||
// 组资料变更
|
||||
},
|
||||
));
|
||||
```
|
||||
Scan the QR code below to experience the SDK call example Demo
|
||||
|
||||
##### 3,登录
|
||||

|
||||
|
||||
```
|
||||
OpenIM.iMManager.login(
|
||||
uid: "", // uid来自于自身业务服务器
|
||||
token: "", // token需要业务服务器根据secret向OpenIM服务端交换获取
|
||||
).then((userInfo) {
|
||||
// 返回当前登录用户的资料
|
||||
});
|
||||
```
|
||||
# [SDK Documents](https://doc.rentsoft.cn/sdks/quickstart/flutter)
|
||||
|
||||
|
||||
|
||||
## 方法名、参数、返回值说明
|
||||
|
||||
- ##### logout( 登出)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.logout().then((_){
|
||||
// 退出成功
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getLoginUserInfo(获取当前登录用户的资料)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.getLoginUserInfo().then((userInfo){
|
||||
// 当前登录用户的信息
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getLoginUserID(获取当前登录用户的ID)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.getLoginUserID().then((userID){
|
||||
// 当前登录用户的ID
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getUsersInfo(根据用户ID批量获取用户信息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.userManager.getUsersInfo(
|
||||
uidList: [], // 用户ID集合
|
||||
).then((userInfoList) {
|
||||
// 用户信息列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getSelfUserInfo(获取当前登录用户的资料)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.userManager.getSelfUserInfo().then((userInfo){
|
||||
// 返回当前登录用户的资料
|
||||
});
|
||||
```
|
||||
|
||||
- ##### setSelfInfo(修改当前用登录户资料)
|
||||
|
||||
会触发当用户的onSelfInfoUpdated回调,以及好友的onFriendInfoChanged、onConversationChanged回调。
|
||||
|
||||
```
|
||||
OpenIM.iMManager.userManager.setSelfInfo(
|
||||
nickname: '', // 昵称
|
||||
faceURL: '', // 头像
|
||||
gender: 0, // 性别: 男1,女0
|
||||
phoneNumber: '', // 手机号
|
||||
email: '', //邮箱
|
||||
birth: 0, //生日
|
||||
ex: '', // 其他信息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### getAllConversationList(获取所有会话)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getAllConversationList().then((list) {
|
||||
// List<ConversationInfo> 会话列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getConversationListSplit(分页获取会话)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getConversationListSplit(
|
||||
offset: 0, // 偏移量,如:第1页,offet:0,count:20;第2页:offset:20;
|
||||
count: 0, // 每页数量
|
||||
).then((list) {
|
||||
// List<ConversationInfo> 会话列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getOneConversation(获取一个会话,如果不存在会自动创建)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getOneConversation(
|
||||
sourceID: "", // 如果是单聊值传userID,如果是群聊groupID
|
||||
sessionType: 1, // 如果是单聊值传1,如果是群聊值传2
|
||||
).then((info) {
|
||||
// 会话信息
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getMultipleConversation(根据会话id查询会话)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getMultipleConversation(
|
||||
conversationIDList: [], // 会话ID集合
|
||||
).then((list) {
|
||||
// 返回与id匹配的会话列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### deleteConversation(根据会话id删除指定会话)
|
||||
|
||||
会触onTotalUnreadMessageCountChanged回调
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.deleteConversation(
|
||||
conversationID: "", // 会话id
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### setConversationDraft(设置会话草稿)
|
||||
|
||||
会触onConversationChanged回调
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.setConversationDraft(
|
||||
conversationID: "", // 会话id
|
||||
draftText: "", // 草稿
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### pinConversation(置顶会话)
|
||||
|
||||
会触onConversationChanged回调
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.pinConversation(
|
||||
conversationID: "", // 会话id
|
||||
isPinned: true, // true:置顶;false:取消置顶
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### markGroupMessageHasRead(标记群会话已读,清除未读数)
|
||||
|
||||
会触onConversationChanged、onTotalUnreadMessageCountChanged回调
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.markGroupMessageHasRead(
|
||||
groupID: "", // 组id
|
||||
);
|
||||
```
|
||||
|
||||
- ##### getTotalUnreadMsgCount(获取未读消息总数)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount().then((count){
|
||||
// 总数
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getConversationIDBySessionType(查询会话id)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getConversationIDBySessionType(
|
||||
sourceID: "", // 如果是单聊值传userID,如果是群聊groupID
|
||||
sessionType: 1, // 如果是单聊值传1,如果是群聊值传2
|
||||
).then((conversationID){
|
||||
// 会话ID
|
||||
});
|
||||
```
|
||||
|
||||
- ##### setConversationRecvMessageOpt(设置免打扰模式)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.setConversationRecvMessageOpt(
|
||||
conversationIDList: [], // 会话id列表
|
||||
status: 1, // 1:不接受消息;2:接受在线消息不接受离线消息;0:正常
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getConversationRecvMessageOpt(查询免打扰状态)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.conversationManager.getConversationRecvMessageOpt(
|
||||
conversationIDList: [], // 会话id列表
|
||||
).then((list) {
|
||||
// 返回列表 [{"conversationId":"single_13922222222","result":0}]
|
||||
// result: 1:不接受消息;2:接受在线消息不接受离线消息;0:正常
|
||||
});
|
||||
```
|
||||
|
||||
- ##### simpleSort(自定义会话排序规则)
|
||||
|
||||
```
|
||||
var list = OpenIM.iMManager.conversationManager.simpleSort([]);// 返回排序好的列表
|
||||
```
|
||||
|
||||
- ##### getFriendsInfo(根据userID查询好友资料)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.getFriendsInfo(
|
||||
uidList: [], // userId列表
|
||||
).then((list) {
|
||||
// List<UserInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### addFriend(发起好友申请)
|
||||
|
||||
主动申请者收到OnFriendApplicationAdded
|
||||
|
||||
被添加者收到OnFriendApplicationAdded
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.addFriend(
|
||||
uid: "", // 用户id
|
||||
reason: '', // 发起好友申请的描述信息
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### checkFriend(检查是否是好友)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.checkFriend(
|
||||
uidList: [], // userID 列表
|
||||
).then((list) {
|
||||
// List<FriendshipInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### deleteFriend(删除好友)
|
||||
|
||||
操作者收到OnFriendDeleted
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.deleteFriend(
|
||||
uid: '', // userID
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### setFriendRemark(好友备注设置)
|
||||
|
||||
操作者收到OnFriendInfoChanged
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.setFriendRemark(
|
||||
uid: '', // 好友userID
|
||||
remark: '', // 备注名
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getFriendList(好友列表)
|
||||
|
||||
返回的数据里包含已拉入黑名单的好友,可以根据isBlacklist字段筛选。
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.getFriendList().then((list){
|
||||
// List<UserInfo> 好友信息列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getRecvFriendApplicationList(收到的好友申请)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.getRecvFriendApplicationList().then((list) {
|
||||
// List<FriendApplicationInfo> 申请列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getSendFriendApplicationList(发出的好友申请)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.getSendFriendApplicationList().then((list){
|
||||
// List<FriendApplicationInfo> 申请列表
|
||||
});
|
||||
```
|
||||
|
||||
- ##### addBlacklist(拉黑好友)
|
||||
|
||||
操作者收到OnBlackAdded
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.addBlacklist(
|
||||
uid: "", // 好友userID
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getBlacklist(黑名单)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.getBlacklist().then((list){
|
||||
// List<UserInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### removeBlacklist(移除黑名单)
|
||||
|
||||
操作者收到OnBlackDeleted
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.removeBlacklist(
|
||||
uid: "", // userID
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### acceptFriendApplication(接受好友申请)
|
||||
|
||||
操作者收到OnFriendApplicationAccepted、OnFriendAdded
|
||||
|
||||
申请者收到OnFriendApplicationAccepted、OnFriendAdded
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
||||
uid: "", // userID
|
||||
handleMsg: '', // 备注信息
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### refuseFriendApplication(拒绝好友申请)
|
||||
|
||||
操作者收到OnFriendApplicationRejected
|
||||
|
||||
申请者收到OnFriendApplicationRejected
|
||||
|
||||
```
|
||||
OpenIM.iMManager.friendshipManager.refuseFriendApplication(
|
||||
uid: "", // userID
|
||||
handleMsg: '', // 备注信息
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### inviteUserToGroup(邀请进组)
|
||||
|
||||
直接进组无需同意。
|
||||
|
||||
被邀请者收到OnJoinedGroupAdded
|
||||
|
||||
群成员(不包括被邀请者)收到OnGroupMemberAdded
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.inviteUserToGroup(
|
||||
groupId: '', // 组ID
|
||||
uidList: [], // 成员 userID 列表
|
||||
reason: '', // 备注信息
|
||||
).then((list){
|
||||
// List<GroupInviteResult>
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
- ##### kickGroupMember(移除组成员)
|
||||
|
||||
被踢者收到OnJoinedGroupDeleted
|
||||
|
||||
群成员收到OnGroupMemberDeleted
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.kickGroupMember(
|
||||
groupId: '', // 组ID
|
||||
uidList: [], // 成员 userID 列表
|
||||
reason: '', // 备注信息
|
||||
).then((list){
|
||||
// List<GroupInviteResult>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getGroupMembersInfo(查询组成员信息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.getGroupMembersInfo(
|
||||
groupId: '', // 组ID
|
||||
uidList: [], // 成员 userID 列表
|
||||
).then((list){
|
||||
// List<GroupMembersInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getGroupMemberList(组成员列表)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.getGroupMemberList(
|
||||
groupId: '', // 组ID
|
||||
filter: 0, // 1普通成员, 2群主,3管理员
|
||||
offset: 0, // 偏移量,每次开始的index值
|
||||
count: 0, // 每次拉取的数量
|
||||
).then((list){
|
||||
// List<GroupMembersInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getJoinedGroupList(获取已加入的群组)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.getJoinedGroupList().then((list){
|
||||
// List<GroupInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### isJoinedGroup(检查是否已入群)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.isJoinedGroup(
|
||||
gid: '', // 组ID
|
||||
).then((joned) {
|
||||
// true已加入;false未加入
|
||||
});
|
||||
```
|
||||
|
||||
- ##### createGroup(创建组)
|
||||
|
||||
初始成员收到OnJoinedGroupAdded
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.createGroup(
|
||||
groupName: '', // 组名
|
||||
faceUrl: '', // 头像
|
||||
notification: '', // 群公告
|
||||
introduction: '', // 群简介
|
||||
groupType: 0, // 类型
|
||||
ex: '', // 扩展信息
|
||||
list: [], // 成员角色集合 List<GroupMemberRole>
|
||||
).then((groupInfo){
|
||||
// 返回组信息 GroupInfo
|
||||
});
|
||||
```
|
||||
|
||||
- ##### setGroupInfo(修改组信息)
|
||||
|
||||
群成员收到OnGroupInfoChanged
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.setGroupInfo(
|
||||
groupID: '',
|
||||
groupName: '', // 组名
|
||||
faceUrl: '', // 头像
|
||||
notification: '', // 群公告
|
||||
introduction: '', // 群简介
|
||||
ex: '', // 扩展信息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### getGroupsInfo(根据id查询组信息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.getGroupsInfo(
|
||||
gidList: [], // 组id集合
|
||||
).then((list){
|
||||
// List<GroupInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### joinGroup(申请入群组)
|
||||
|
||||
需要通过管理员同意。
|
||||
|
||||
申请者收到OnGroupApplicationAdded
|
||||
|
||||
群主+管理员收到OnGroupApplicationAdded
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.joinGroup(
|
||||
gid: '', // 组id
|
||||
reason: '', // 入群备注信息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### quitGroup(退出组)
|
||||
|
||||
退出者收到OnJoinedGroupDeleted
|
||||
|
||||
群成员收到OnGroupMemberDeleted
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.quitGroup(
|
||||
gid: '', // 组id
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### transferGroupOwner(群转让)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.transferGroupOwner(
|
||||
gid: '', // 组ID
|
||||
uid: '', // 新 owner userID
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getRecvGroupApplicationList(收到的入群申请)
|
||||
|
||||
作为群主或者管理员,获取收到的群成员申请进群列表。
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.getRecvGroupApplicationList().then((list){
|
||||
// List<GroupApplicationInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getSendGroupApplicationList(发出的入群申请)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.getSendGroupApplicationList().then((list){
|
||||
// List<GroupApplicationInfo>
|
||||
});
|
||||
```
|
||||
|
||||
- ##### acceptGroupApplication(接受入群申请)
|
||||
|
||||
申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
|
||||
|
||||
群成员(不包括申请者)收到OnGroupMemberAdded
|
||||
|
||||
审批者(群主或者管理员)收到OnGroupMemberAdded OnGroupApplicationAccepted
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.acceptGroupApplication(
|
||||
gid: '', // 组ID
|
||||
uid: '', // 申请人userID
|
||||
handleMsg: '', // 备注信息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### refuseGroupApplication(拒绝入群申请)
|
||||
|
||||
申请者收到OnGroupApplicationRejected
|
||||
|
||||
审批者(群主或者管理员)收到OnGroupApplicationRejected
|
||||
|
||||
```
|
||||
OpenIM.iMManager.groupManager.refuseGroupApplication(
|
||||
gid: '', // 组ID
|
||||
uid: '', // 申请人userID
|
||||
handleMsg: '', // 备注信息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### sendMessage(发送消息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.sendMessage(
|
||||
message: Message(), // 消息体
|
||||
userID: '', // 接受消息的userID
|
||||
groupID: '', // 接受消息的群ID
|
||||
offlinePushInfo: OfflinePushInfo(), // 离线推送的消息备注
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### getHistoryMessageList(获取聊天记录)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.getHistoryMessageList(
|
||||
userID: '', // 单聊对象的userID
|
||||
groupID: '', // 群聊的组id
|
||||
startMsg: null, // 消息体
|
||||
count: 0, // 每次拉取的数量
|
||||
).then((list){
|
||||
// List<Message>
|
||||
});
|
||||
```
|
||||
|
||||
注:消息列表list,index == list.length -1 是最新的一条消息。 index == 0 是从最新的这条记录后的第19条。所以startMsg首次传null,
|
||||
|
||||
下次就是list.first(index == 0),以此类推。
|
||||
|
||||
- ##### revokeMessage(撤回消息)
|
||||
|
||||
撤回成功需要当前用户从列表里移除Message然后更新ui,而另外一方通过撤回监听(onRecvMessageRevoked)移除。
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.revokeMessage(
|
||||
message: Message(), // 消息体
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### deleteMessageFromLocalStorage(删除单条消息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.deleteMessageFromLocalStorage(
|
||||
message: Message(),
|
||||
).then((_) {
|
||||
// 成功,从列表里移除Message,然后更新ui
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### insertSingleMessageToLocalStorage(向本地插入一条消息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.insertSingleMessageToLocalStorage(
|
||||
receiverID: '', // 接收者userID
|
||||
senderID: '', // 发送者userID
|
||||
message: Message(), // 消息体
|
||||
);
|
||||
```
|
||||
|
||||
- ##### markC2CMessageAsRead(标记c2c消息已读)
|
||||
|
||||
当调用此方法后,已读的消息会通过已读回执(onRecvC2CReadReceipt)告诉对方。
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.markC2CMessageAsRead(
|
||||
userID: '', // 接收者 userID
|
||||
messageIDList: [], // 已读的消息id列表
|
||||
);
|
||||
```
|
||||
|
||||
- ##### typingStatusUpdate(正在输入提示)
|
||||
|
||||
会通过onRecvNewMessage回调
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.typingStatusUpdate(
|
||||
userID: '', // 接收者 userID
|
||||
msgTip: '', // 自定义提示内容
|
||||
);
|
||||
```
|
||||
|
||||
- ##### clearC2CHistoryMessage(清空c2c聊天记录)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.clearC2CHistoryMessage(
|
||||
uid: "", // userID
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### clearGroupHistoryMessage(清空群聊天记录)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.clearGroupHistoryMessage(
|
||||
gid: '', // 群ID
|
||||
).then((_) {
|
||||
// 成功
|
||||
}).catchError((_){
|
||||
// 失败
|
||||
});
|
||||
```
|
||||
|
||||
- ##### createTextMessage(文本消息)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createTextMessage(
|
||||
text: '', // 发送的内容
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createTextAtMessage(@消息)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createTextAtMessage(
|
||||
text: '', // 发送的内容
|
||||
atUidList: [], // 被@到的userID集合
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createImageMessage(图片消息,相对路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createImageMessage(
|
||||
imagePath: '', // 相对路径
|
||||
);
|
||||
```
|
||||
|
||||
注:initSDK时传入了数据缓存(dataDir)路径,如路径:A,这时需要你将图片复制到A路径下后,如 A/pic/a.png路径,imagePath的值:“/pic/a.png”。同以下其他消息的相对路径。
|
||||
|
||||
- ##### createImageMessageFromFullPath(图片消息全路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createImageMessageFromFullPath(
|
||||
imagePath: '', // 绝对路径
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createSoundMessage(语音消息,相对路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createSoundMessage(
|
||||
soundPath: '', // 相对路径
|
||||
duration: 0, // 时长s
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createSoundMessageFromFullPath(语音消息全路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createSoundMessageFromFullPath(
|
||||
soundPath: '', // 绝对路径
|
||||
duration: 0, // 时长s
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createVideoMessage(视频消息,相对路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createVideoMessage(
|
||||
videoPath: '', // 相对路径
|
||||
videoType: '', // minetype
|
||||
duration: 0, // 时长s
|
||||
snapshotPath: '', // 站位缩略图
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createVideoMessageFromFullPath(视频消息全路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createVideoMessageFromFullPath(
|
||||
videoPath: '', // 绝对路径
|
||||
videoType: '', // minetype
|
||||
duration: 0, // 时长s
|
||||
snapshotPath: '', // 站位缩略图
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createFileMessage(文件消息,相对路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createFileMessage(
|
||||
filePath: '', // 相对路径
|
||||
fileName: '', // 文件名
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createFileMessageFromFullPath(文件消息全路径)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createFileMessageFromFullPath(
|
||||
filePath: '', // 绝对路径
|
||||
fileName: '', // 文件名
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createForwardMessage(转发消息)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createForwardMessage(
|
||||
message: Message(), // 被转发的消息体
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createMergerMessage(合并消息)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createMergerMessage(
|
||||
messageList: [], // 被转发的消息列表
|
||||
title: '', // 标题
|
||||
summaryList: [], // 每一条消息摘要
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createLocationMessage(位置消息)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createLocationMessage(
|
||||
latitude: 0,// 纬度
|
||||
longitude: 0, // 经度
|
||||
description: '', // 位置描述信息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createCustomMessage(自定义消息)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createCustomMessage(
|
||||
data: '', // 自定义内容
|
||||
extension: '', // 扩展信息
|
||||
description: '', // 描述消息
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createQuoteMessage(引用消息/消息回复)
|
||||
|
||||
```
|
||||
var message = await OpenIM.iMManager.messageManager.createQuoteMessage(
|
||||
text: '', // 回复内容
|
||||
quoteMsg: Message(), // 被回复的消息体
|
||||
);
|
||||
```
|
||||
|
||||
- ##### createCardMessage(名片消息)
|
||||
|
||||
```
|
||||
OpenIM.iMManager.messageManager.createCardMessage(
|
||||
data: {}, // 自定义内容
|
||||
);
|
||||
```
|
||||
@@ -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:2.0.4@aar'
|
||||
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
||||
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
||||
implementation 'io.openim:core-sdk:3.4.0@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>
|
||||
@@ -1,3 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.openim.flutter_openim_sdk">
|
||||
</manifest>
|
||||
package="io.openim.flutter_openim_sdk">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.openim.flutter_openim_sdk;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -9,10 +10,14 @@ import java.lang.reflect.Method;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
|
||||
import io.flutter.plugin.common.MethodChannel.Result;
|
||||
import io.openim.flutter_openim_sdk.connectivity.ConnectivityListener;
|
||||
import io.openim.flutter_openim_sdk.connectivity.VisibilityListener;
|
||||
import io.openim.flutter_openim_sdk.manager.ConversationManager;
|
||||
import io.openim.flutter_openim_sdk.manager.FriendshipManager;
|
||||
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
||||
@@ -24,12 +29,12 @@ import io.openim.flutter_openim_sdk.manager.UserManager;
|
||||
/**
|
||||
* FlutterOpenimSdkPlugin
|
||||
*/
|
||||
public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler {
|
||||
public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware {
|
||||
/// The MethodChannel that will the communication between Flutter and native Android
|
||||
///
|
||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
|
||||
/// when the Flutter Engine is detached from the Activity
|
||||
|
||||
private static final String CHANNEL_NAME = "flutter_openim_sdk";
|
||||
public static MethodChannel channel;
|
||||
private static IMManager imManager;
|
||||
private static UserManager userManager;
|
||||
@@ -37,11 +42,13 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
private static MessageManager messageManager;
|
||||
private static ConversationManager conversationManager;
|
||||
private static GroupManager groupManager;
|
||||
private static Activity activity;
|
||||
private static Context context;
|
||||
private ConnectivityListener connectivityListener;
|
||||
private VisibilityListener visibilityListener;
|
||||
public static boolean isInitialized;
|
||||
|
||||
public FlutterOpenimSdkPlugin() {
|
||||
}
|
||||
|
||||
private FlutterOpenimSdkPlugin(Context context) {
|
||||
FlutterOpenimSdkPlugin.imManager = new IMManager();
|
||||
FlutterOpenimSdkPlugin.userManager = new UserManager();
|
||||
FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager();
|
||||
@@ -50,11 +57,15 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
FlutterOpenimSdkPlugin.groupManager = new GroupManager();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
|
||||
FlutterOpenimSdkPlugin.channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "flutter_openim_sdk");
|
||||
FlutterOpenimSdkPlugin.channel.setMethodCallHandler(new FlutterOpenimSdkPlugin(flutterPluginBinding.getApplicationContext()));
|
||||
// channel.setMethodCallHandler(this);
|
||||
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), CHANNEL_NAME);
|
||||
context = flutterPluginBinding.getApplicationContext();
|
||||
channel.setMethodCallHandler(this);
|
||||
connectivityListener = new ConnectivityListener(context);
|
||||
visibilityListener = new VisibilityListener();
|
||||
connectivityListener.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,6 +76,30 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
@Override
|
||||
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
|
||||
FlutterOpenimSdkPlugin.channel.setMethodCallHandler(null);
|
||||
connectivityListener.unregisterReceiver();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
|
||||
visibilityListener.register(activity = binding.getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivityForConfigChanges() {
|
||||
visibilityListener.unregisterReceiver(activity);
|
||||
activity = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) {
|
||||
visibilityListener.register(activity = binding.getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivity() {
|
||||
visibilityListener.unregisterReceiver(activity);
|
||||
activity = null;
|
||||
}
|
||||
|
||||
void parse(@NonNull MethodCall call, @NonNull Result result) {
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package io.openim.flutter_openim_sdk.connectivity;
|
||||
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.os.Build;
|
||||
|
||||
public class Connectivity {
|
||||
static final String CONNECTIVITY_NONE = "none";
|
||||
static final String CONNECTIVITY_WIFI = "wifi";
|
||||
static final String CONNECTIVITY_MOBILE = "mobile";
|
||||
static final String CONNECTIVITY_ETHERNET = "ethernet";
|
||||
static final String CONNECTIVITY_BLUETOOTH = "bluetooth";
|
||||
static final String CONNECTIVITY_VPN = "vpn";
|
||||
private final ConnectivityManager connectivityManager;
|
||||
|
||||
public Connectivity(ConnectivityManager connectivityManager) {
|
||||
this.connectivityManager = connectivityManager;
|
||||
}
|
||||
|
||||
String getNetworkType() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
Network network = connectivityManager.getActiveNetwork();
|
||||
NetworkCapabilities capabilities = connectivityManager.getNetworkCapabilities(network);
|
||||
if (capabilities == null) {
|
||||
return CONNECTIVITY_NONE;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
|
||||
return CONNECTIVITY_WIFI;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) {
|
||||
return CONNECTIVITY_ETHERNET;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
|
||||
return CONNECTIVITY_VPN;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)) {
|
||||
return CONNECTIVITY_MOBILE;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_BLUETOOTH)) {
|
||||
return CONNECTIVITY_BLUETOOTH;
|
||||
}
|
||||
}
|
||||
|
||||
return getNetworkTypeLegacy();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private String getNetworkTypeLegacy() {
|
||||
// handle type for Android versions less than Android 6
|
||||
android.net.NetworkInfo info = connectivityManager.getActiveNetworkInfo();
|
||||
if (info == null || !info.isConnected()) {
|
||||
return CONNECTIVITY_NONE;
|
||||
}
|
||||
int type = info.getType();
|
||||
switch (type) {
|
||||
case ConnectivityManager.TYPE_BLUETOOTH:
|
||||
return CONNECTIVITY_BLUETOOTH;
|
||||
case ConnectivityManager.TYPE_ETHERNET:
|
||||
return CONNECTIVITY_ETHERNET;
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
case ConnectivityManager.TYPE_WIMAX:
|
||||
return CONNECTIVITY_WIFI;
|
||||
case ConnectivityManager.TYPE_VPN:
|
||||
return CONNECTIVITY_VPN;
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
case ConnectivityManager.TYPE_MOBILE_DUN:
|
||||
case ConnectivityManager.TYPE_MOBILE_HIPRI:
|
||||
return CONNECTIVITY_MOBILE;
|
||||
default:
|
||||
return CONNECTIVITY_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public ConnectivityManager getConnectivityManager() {
|
||||
return connectivityManager;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package io.openim.flutter_openim_sdk.connectivity;
|
||||
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.os.Build;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
|
||||
public class ConnectivityListener implements open_im_sdk_callback.Base {
|
||||
public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
|
||||
private Context context;
|
||||
private ConnectivityManager connectivityManager;
|
||||
private Connectivity connectivity;
|
||||
private ConnectivityBroadcastReceiver receiver;
|
||||
private ConnectivityManager.NetworkCallback networkCallback;
|
||||
|
||||
public ConnectivityListener(Context context) {
|
||||
this.context = context;
|
||||
this.connectivityManager =
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
this.connectivity = new Connectivity(connectivityManager);
|
||||
this.receiver = new ConnectivityBroadcastReceiver(this);
|
||||
}
|
||||
|
||||
private void onChangedNetworkStatus() {
|
||||
String status = connectivity.getNetworkType();
|
||||
if (Connectivity.CONNECTIVITY_MOBILE.equals(status) || Connectivity.CONNECTIVITY_WIFI.equals(status)) {
|
||||
Log.i("ConnectivityListener", "networkStatusChanged: " + status);
|
||||
if (FlutterOpenimSdkPlugin.isInitialized) {
|
||||
Open_im_sdk.networkStatusChanged(this, String.valueOf(System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
networkCallback = new ConnectivityManager.NetworkCallback() {
|
||||
@Override
|
||||
public void onAvailable(Network network) {
|
||||
onChangedNetworkStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLost(Network network) {
|
||||
}
|
||||
};
|
||||
connectivity.getConnectivityManager().registerDefaultNetworkCallback(networkCallback);
|
||||
} else {
|
||||
context.registerReceiver(receiver, new IntentFilter(CONNECTIVITY_ACTION));
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterReceiver() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (networkCallback != null) {
|
||||
connectivity.getConnectivityManager().unregisterNetworkCallback(networkCallback);
|
||||
networkCallback = null;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
context.unregisterReceiver(receiver);
|
||||
receiver = null;
|
||||
} catch (Exception e) {
|
||||
//listen never called, ignore the error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int i, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
|
||||
}
|
||||
|
||||
public static class ConnectivityBroadcastReceiver extends BroadcastReceiver {
|
||||
ConnectivityListener listener;
|
||||
|
||||
public ConnectivityBroadcastReceiver(ConnectivityListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (null != listener && CONNECTIVITY_ACTION.equals(intent.getAction())) {
|
||||
listener.onChangedNetworkStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package io.openim.flutter_openim_sdk.connectivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class VisibilityListener implements Application.ActivityLifecycleCallbacks, open_im_sdk_callback.Base {
|
||||
public void register(Activity activity) {
|
||||
if (null != activity) {
|
||||
activity.getApplication().registerActivityLifecycleCallbacks(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterReceiver(Activity activity) {
|
||||
if (null != activity) {
|
||||
activity.getApplication().unregisterActivityLifecycleCallbacks(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
Log.i("VisibilityListener", "onActivityCreated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityStarted");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityResumed");
|
||||
if (FlutterOpenimSdkPlugin.isInitialized) {
|
||||
Open_im_sdk.setAppBackgroundStatus(this, String.valueOf(System.currentTimeMillis()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityPaused");
|
||||
if (FlutterOpenimSdkPlugin.isInitialized) {
|
||||
Open_im_sdk.setAppBackgroundStatus(this, String.valueOf(System.currentTimeMillis()), true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityStopped");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
|
||||
Log.i("VisibilityListener", "onActivitySaveInstanceState");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityDestroyed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int i, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,27 +13,79 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
this.id = listenerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgDeleted(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("message", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onMsgDeleted", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewRecvMessageRevoked(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("messageRevoked", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onNewRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("haveReadMessage", s);
|
||||
values.put("msgReceiptList", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvMessageRevoked(String s) {
|
||||
public void onRecvGroupReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||
values.put("groupMsgReceiptList", 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("reactionExtensionList", 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("reactionExtensionList", 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("reactionExtensionKeyList", s1);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsDeleted", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("newMessage", s);
|
||||
values.put("message", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvOfflineNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("message", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvOfflineNewMessage", values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk_callback.Base;
|
||||
@@ -8,18 +10,22 @@ import open_im_sdk_callback.Base;
|
||||
public class OnBaseListener implements Base {
|
||||
|
||||
MethodChannel.Result result;
|
||||
MethodCall call;
|
||||
|
||||
public OnBaseListener(MethodChannel.Result result) {
|
||||
public OnBaseListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int l, String s) {
|
||||
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onSuccess: " + s);
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnCustomBusinessListener implements open_im_sdk_callback.OnCustomBusinessListener {
|
||||
@Override
|
||||
public void onRecvCustomBusinessMessage(String s) {
|
||||
CommonUtil.emitEvent("customBusinessListener", "onRecvCustomBusinessMessage", s);
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,12 @@ public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipLi
|
||||
|
||||
@Override
|
||||
public void onBlackAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s);
|
||||
CommonUtil.emitEvent("friendListener", "onBlackAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlackDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s);
|
||||
CommonUtil.emitEvent("friendListener", "onBlackDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,11 @@ public class OnGroupListener implements open_im_sdk_callback.OnGroupListener {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupDismissed(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupDismissed", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", 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,110 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk_callback.UploadFileCallback;
|
||||
|
||||
public class OnUploadFileListener implements UploadFileCallback {
|
||||
final private MethodChannel.Result result;
|
||||
final private Object id;
|
||||
|
||||
public OnUploadFileListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
this.id = call.argument("id");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(long size, String url, long type) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("size", size);
|
||||
values.put("url", url);
|
||||
values.put("type", type);
|
||||
CommonUtil.emitEvent("uploadFileListener", "complete", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hashPartComplete(String partHash, String fileHash) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("partHash", partHash);
|
||||
values.put("fileHash", fileHash);
|
||||
CommonUtil.emitEvent("uploadFileListener", "hashPartComplete", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hashPartProgress(long index, long size, String partHash) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("index", index);
|
||||
values.put("size", size);
|
||||
values.put("partHash", partHash);
|
||||
CommonUtil.emitEvent("uploadFileListener", "hashPartProgress", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(long size) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("size", size);
|
||||
CommonUtil.emitEvent("uploadFileListener", "open", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partSize(long partSize, long num) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("partSize", partSize);
|
||||
values.put("num", num);
|
||||
CommonUtil.emitEvent("uploadFileListener", "partSize", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadComplete(long fileSize, long streamSize, long storageSize) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("fileSize", fileSize);
|
||||
values.put("streamSize", streamSize);
|
||||
values.put("storageSize", storageSize);
|
||||
CommonUtil.emitEvent("uploadFileListener", "uploadProgress", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadID(String uploadID) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("uploadID", uploadID);
|
||||
CommonUtil.emitEvent("uploadFileListener", "uploadID", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadPartComplete(long index, long partSize, String partHash) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("index", index);
|
||||
values.put("partSize", partSize);
|
||||
values.put("partHash", partHash);
|
||||
CommonUtil.emitEvent("uploadFileListener", "uploadPartComplete", values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,9 @@ public class OnUserListener implements open_im_sdk_callback.OnUserListener {
|
||||
public void onSelfInfoUpdated(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserStatusChanged(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onUserStatusChanged", s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,21 @@ public class ConversationManager extends BaseManager {
|
||||
|
||||
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationListener(new OnConversationListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
|
||||
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAllConversationList(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getConversationListSplit(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count")
|
||||
@@ -32,32 +34,25 @@ public class ConversationManager extends BaseManager {
|
||||
|
||||
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getOneConversation(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "sessionType"),
|
||||
value(methodCall, "sessionType"),
|
||||
value(methodCall, "sourceID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getMultipleConversation(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversation(
|
||||
new OnBaseListener(result),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationDraft(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "draftText")
|
||||
@@ -66,56 +61,139 @@ public class ConversationManager extends BaseManager {
|
||||
|
||||
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.pinConversation(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isPinned")
|
||||
);
|
||||
}
|
||||
|
||||
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.markSingleMessageHasRead(
|
||||
// new OnBaseListener(result),
|
||||
// value(methodCall, "operationID"),
|
||||
// value(methodCall, "userID")
|
||||
// );
|
||||
// }
|
||||
|
||||
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageHasRead(
|
||||
new OnBaseListener(result),
|
||||
public void hideConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.hideConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void markConversationMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markConversationMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getTotalUnreadMsgCount(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getConversationIDBySessionType(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "sourceID"),
|
||||
int2long(methodCall, "sessionType")));
|
||||
}
|
||||
|
||||
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationRecvMessageOpt(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList"),
|
||||
value(methodCall, "conversationID"),
|
||||
int2long(methodCall, "status")
|
||||
);
|
||||
}
|
||||
|
||||
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getConversationRecvMessageOpt(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationPrivateChat(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isPrivate")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversationAndDeleteAllMsg(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllConversationFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
||||
}
|
||||
|
||||
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(value(methodCall, "operationID")));
|
||||
}
|
||||
|
||||
public void setGlobalRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGlobalRecvMessageOpt(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "status")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationBurnDuration(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationBurnDuration(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "burnDuration")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationIsMsgDestruct(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationIsMsgDestruct(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isMsgDestruct")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationMsgDestructTime(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationMsgDestructTime(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
int2long(methodCall, "duration")
|
||||
);
|
||||
}
|
||||
|
||||
public void hideAllConversations(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.hideAllConversations(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,48 +11,50 @@ public class FriendshipManager extends BaseManager {
|
||||
|
||||
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendListener(new OnFriendshipListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getDesignatedFriendsInfo(
|
||||
new OnBaseListener(result),
|
||||
Open_im_sdk.getSpecifiedFriendsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addFriend(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvFriendApplicationList(
|
||||
new OnBaseListener(result),
|
||||
public void getFriendApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendFriendApplicationList(
|
||||
new OnBaseListener(result),
|
||||
public void getFriendApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendList(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendRemark(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
@@ -60,46 +62,46 @@ public class FriendshipManager extends BaseManager {
|
||||
|
||||
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addBlack(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getBlackList(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.removeBlack(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.checkFriend(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteFriend(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.acceptFriendApplication(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
@@ -107,21 +109,17 @@ public class FriendshipManager extends BaseManager {
|
||||
|
||||
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.refuseFriendApplication(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncFriendApplication();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncFriend();
|
||||
// }
|
||||
//
|
||||
// public void forceSyncBlackList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncBlackList();
|
||||
// }
|
||||
public void searchFriends(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchFriends(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "searchParam")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,42 +10,44 @@ public class GroupManager extends BaseManager {
|
||||
|
||||
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupListener(new OnGroupListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.inviteUserToGroup(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.kickGroupMember(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMembersInfo(
|
||||
new OnBaseListener(result),
|
||||
Open_im_sdk.getSpecifiedGroupMembersInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMemberList(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "filter"),
|
||||
value(methodCall, "offset"),
|
||||
value(methodCall, "count")
|
||||
@@ -55,83 +57,82 @@ public class GroupManager extends BaseManager {
|
||||
|
||||
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getJoinedGroupList(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.createGroup(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gInfo"),
|
||||
jsonValue(methodCall, "memberList")
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupInfo(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "gInfo")
|
||||
jsonValue(methodCall, "groupInfo")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupsInfo(
|
||||
new OnBaseListener(result),
|
||||
Open_im_sdk.getSpecifiedGroupsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gidList")
|
||||
jsonValue(methodCall, "groupIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.joinGroup(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason")
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "reason"),
|
||||
value(methodCall, "joinSource")
|
||||
);
|
||||
}
|
||||
|
||||
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.quitGroup(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.transferGroupOwner(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvGroupApplicationList(
|
||||
new OnBaseListener(result),
|
||||
public void getGroupApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendGroupApplicationList(
|
||||
new OnBaseListener(result),
|
||||
public void getGroupApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.acceptGroupApplication(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
@@ -139,28 +140,128 @@ public class GroupManager extends BaseManager {
|
||||
|
||||
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.refuseGroupApplication(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
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, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void changeGroupMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeGroupMute(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "mute")
|
||||
);
|
||||
}
|
||||
|
||||
public void changeGroupMemberMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeGroupMemberMute(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
int2long(methodCall, "seconds")
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupMemberNickname(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupMemberNickname(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
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")
|
||||
);
|
||||
}
|
||||
|
||||
public void isJoinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.isJoinGroup(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,64 +2,87 @@ 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.FlutterOpenimSdkPlugin;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnConnListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnUploadFileListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class IMManager extends BaseManager {
|
||||
|
||||
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
|
||||
boolean initialized = Open_im_sdk.initSDK(
|
||||
new OnConnListener(),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall))
|
||||
);
|
||||
jsonValue(methodCall));
|
||||
FlutterOpenimSdkPlugin.isInitialized = initialized;
|
||||
CommonUtil.runMainThreadReturn(result, initialized);
|
||||
}
|
||||
|
||||
public void unInitSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.unInitSDK(value(methodCall, "operationID"));
|
||||
}
|
||||
|
||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.login(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "token")
|
||||
);
|
||||
}
|
||||
|
||||
public void logout(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.logout(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus(value(methodCall, "operationID")));
|
||||
}
|
||||
|
||||
// public void getLoginUid(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
|
||||
public void uploadFile(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.uploadFile(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall),
|
||||
new OnUploadFileListener(result, methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void updateFcmToken(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.updateFcmToken(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "fcmToken"),
|
||||
int2long(methodCall, "expireTime")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setAppBackgroundStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "isBackground")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void networkStatusChanged(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.networkStatusChanged(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
// public void setListenerForService(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.setListenerForService(new OnListenerForService());
|
||||
//
|
||||
// result.success(null);
|
||||
// }
|
||||
|
||||
// public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.getUsersInfo(
|
||||
// jsonValue(methodCall, "uidList"), new BaseListener(result));
|
||||
// }
|
||||
|
||||
// public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.setSelfInfo(
|
||||
// jsonValue(methodCall), new BaseListener(result));
|
||||
// }
|
||||
|
||||
// public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncLoginUerInfo();
|
||||
// }
|
||||
|
||||
// public void forceReConn(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceReConn();
|
||||
// }
|
||||
|
||||
// public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.setSdkLog(value(methodCall, "sdkLog"));
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnCustomBusinessListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
@@ -11,77 +12,12 @@ import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class MessageManager extends BaseManager {
|
||||
private final static String KEY_ID = "id";
|
||||
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
|
||||
/* private static boolean initializedListener = false;
|
||||
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
|
||||
|
||||
protected void clearListeners() {
|
||||
initializedListener = false;
|
||||
listeners.clear();
|
||||
}
|
||||
|
||||
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
for (AdvancedMsgListener l : listeners.values()) {
|
||||
l.onRecvC2CReadReceipt(s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvMessageRevoked(String s) {
|
||||
for (AdvancedMsgListener l : listeners.values()) {
|
||||
l.onRecvMessageRevoked(s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
for (AdvancedMsgListener l : listeners.values()) {
|
||||
l.onRecvNewMessage(s);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
|
||||
listeners.put(key, new AdvancedMsgListener(key));
|
||||
if (!initializedListener) {
|
||||
initializedListener = true;
|
||||
Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
listeners.remove(key);
|
||||
if (listeners.isEmpty()) {
|
||||
initializedListener = false;
|
||||
Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
|
||||
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
if (!listeners.containsKey(key)) {
|
||||
AdvancedMsgListener listener = new AdvancedMsgListener(key);
|
||||
listeners.put(methodCall.argument(KEY_ID), listener);
|
||||
Open_im_sdk.addAdvancedMsgListener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
OnAdvancedMsgListener listener = listeners.remove(key);
|
||||
Open_im_sdk.removeAdvancedMsgListener(listener);
|
||||
}
|
||||
|
||||
*/
|
||||
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
String key = methodCall.argument(KEY_ID);
|
||||
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -95,37 +31,50 @@ public class MessageManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getHistoryMessageList(
|
||||
new OnBaseListener(result),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.revokeMessage(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessageFromLocalStorage(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID")
|
||||
);
|
||||
}
|
||||
|
||||
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessages(new OnBaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
|
||||
// }
|
||||
public void deleteMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID")
|
||||
);
|
||||
}
|
||||
|
||||
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 insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.insertSingleMessageToLocalStorage(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "receiverID"),
|
||||
@@ -133,22 +82,28 @@ public class MessageManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
// public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.findMessages(new OnBaseListener(result), jsonValue(methodCall, "messageIDList"));
|
||||
// }
|
||||
|
||||
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markC2CMessageAsRead(
|
||||
new OnBaseListener(result),
|
||||
public void insertGroupMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.insertGroupMessageToLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "senderID")
|
||||
);
|
||||
}
|
||||
|
||||
public void markMessagesAsReadByMsgID(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markMessagesAsReadByMsgID(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.typingStatusUpdate(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "msgTip")
|
||||
@@ -167,7 +122,10 @@ public class MessageManager extends BaseManager {
|
||||
Open_im_sdk.createTextAtMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "text"),
|
||||
jsonValue(methodCall, "atUserList")));
|
||||
jsonValue(methodCall, "atUserIDList"),
|
||||
jsonValue(methodCall, "atUserInfoList"),
|
||||
jsonValue(methodCall, "quoteMessage")
|
||||
));
|
||||
}
|
||||
|
||||
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -183,6 +141,7 @@ public class MessageManager extends BaseManager {
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "imagePath")));
|
||||
}
|
||||
|
||||
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createSoundMessage(
|
||||
@@ -285,23 +244,138 @@ public class MessageManager extends BaseManager {
|
||||
));
|
||||
}
|
||||
|
||||
// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.forceSyncMsg();
|
||||
// }
|
||||
|
||||
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearC2CHistoryMessage(
|
||||
new OnBaseListener(result),
|
||||
public void createFaceMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFaceMessage(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
int2long(methodCall, "index"),
|
||||
value(methodCall, "data")
|
||||
));
|
||||
}
|
||||
|
||||
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 searchLocalMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchLocalMessages(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "filter")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearGroupHistoryMessage(
|
||||
new OnBaseListener(result),
|
||||
|
||||
public void clearConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void getAdvancedHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAdvancedHistoryMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void getAdvancedHistoryMessageListReverse(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAdvancedHistoryMessageListReverse(
|
||||
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 setMessageLocalEx(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setMessageLocalEx(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID"),
|
||||
value(methodCall, "localEx")
|
||||
);
|
||||
}
|
||||
|
||||
public void setAppBadge(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setAppBadge(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
|
||||
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"),
|
||||
value(methodCall, "sourcePath"),
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,26 +10,63 @@ public class UserManager extends BaseManager {
|
||||
|
||||
public void setUserListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setUserListener(new OnUserListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInfo(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList"));
|
||||
jsonValue(methodCall, "userIDList"));
|
||||
}
|
||||
|
||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSelfInfo(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall));
|
||||
}
|
||||
|
||||
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSelfUserInfo(
|
||||
new OnBaseListener(result),
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
public void subscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.subscribeUsersStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"));
|
||||
}
|
||||
|
||||
public void unsubscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.unsubscribeUsersStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"));
|
||||
}
|
||||
|
||||
public void getSubscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSubscribeUsersStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getUserStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUserStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"));
|
||||
}
|
||||
|
||||
public void getUsersInfoWithCache(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInfoWithCache(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"),
|
||||
value(methodCall, "groupID"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,14 +3,14 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 51;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
6F7F8B794B6D663E7A65A104 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
79CF11091A38454F94DA1EB4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F48A41A58786A29BEEBCFE3 /* Pods_Runner.framework */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
@@ -30,16 +30,16 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2F48A41A58786A29BEEBCFE3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
3F8F3496860058CED33C418C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
564E6205C72C7CB32AC49601 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
7CF14C3CACE83F04F858C9EC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
85A1617DD2AFC45DFFDD8B11 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -54,17 +54,17 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6F7F8B794B6D663E7A65A104 /* Pods_Runner.framework in Frameworks */,
|
||||
79CF11091A38454F94DA1EB4 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
4B877210D623EE0FDE18A08F /* Frameworks */ = {
|
||||
0EDFEBEB76AE7FAFA44EF2AF /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */,
|
||||
2F48A41A58786A29BEEBCFE3 /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -87,7 +87,7 @@
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
E653626F5A38799455FF26C4 /* Pods */,
|
||||
4B877210D623EE0FDE18A08F /* Frameworks */,
|
||||
0EDFEBEB76AE7FAFA44EF2AF /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -117,9 +117,9 @@
|
||||
E653626F5A38799455FF26C4 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7CF14C3CACE83F04F858C9EC /* Pods-Runner.debug.xcconfig */,
|
||||
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */,
|
||||
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */,
|
||||
85A1617DD2AFC45DFFDD8B11 /* Pods-Runner.debug.xcconfig */,
|
||||
3F8F3496860058CED33C418C /* Pods-Runner.release.xcconfig */,
|
||||
564E6205C72C7CB32AC49601 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
@@ -131,14 +131,13 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
FA9CAD2EF743D14467F7D993 /* [CP] Check Pods Manifest.lock */,
|
||||
DFE84742E2B41158E8703A14 /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -197,25 +196,9 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
@@ -230,6 +213,7 @@
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
@@ -242,7 +226,7 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
FA9CAD2EF743D14467F7D993 /* [CP] Check Pods Manifest.lock */ = {
|
||||
DFE84742E2B41158E8703A14 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
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;
|
||||
@@ -363,7 +348,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -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;
|
||||
@@ -493,7 +480,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@@ -517,7 +504,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -1,122 +1,103 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "83.5x83.5"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,19 @@
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -22,6 +24,8 @@
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
@@ -15,6 +14,13 @@ class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
OpenIM.iMManager.initSDK(
|
||||
platformID: 1,
|
||||
apiAddr: '',
|
||||
wsAddr: '',
|
||||
dataDir: '/',
|
||||
objectStorage: 'minio',
|
||||
listener: OnConnectListener());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -32,520 +38,4 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void initSDK() {
|
||||
OpenIM.iMManager
|
||||
.initSDK(
|
||||
// "当前平台,参照IMPlatform类",
|
||||
platform: 0,
|
||||
// SDK的API接口地址。如:http:xxx:10000
|
||||
apiAddr: "",
|
||||
// SDK的web socket地址。如: ws:xxx:17778
|
||||
wsAddr: "",
|
||||
// 数据存储路径。如:var apath =(await getApplicationDocumentsDirectory()).path
|
||||
dataDir: "",
|
||||
listener: OnConnectListener(
|
||||
onConnectSuccess: () {
|
||||
// 已经成功连接到服务器
|
||||
},
|
||||
onConnecting: () {
|
||||
// 正在连接到服务器,适合在 UI 上展示“正在连接”状态。
|
||||
},
|
||||
onConnectFailed: (code, errorMsg) {
|
||||
// 连接服务器失败,可以提示用户当前网络连接不可用
|
||||
},
|
||||
onUserSigExpired: () {
|
||||
// 登录票据已经过期,请使用新签发的 UserSig 进行登录。
|
||||
},
|
||||
onKickedOffline: () {
|
||||
// 当前用户被踢下线,此时可以 UI 提示用户“您已经在其他端登录了当前账号,是否重新登录?”
|
||||
},
|
||||
),
|
||||
)
|
||||
.then((value) {
|
||||
if (value == true) {
|
||||
// 初始化成功
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void setLisenter() {
|
||||
OpenIM.iMManager
|
||||
..userManager.setUserListener(OnUserListener(
|
||||
onSelfInfoUpdated: (userInfo) {
|
||||
// 当前登录用户资料变更回调
|
||||
},
|
||||
))
|
||||
..messageManager.setAdvancedMsgListener(OnAdvancedMsgListener(
|
||||
onRecvNewMessage: (message) {
|
||||
// 收到新消息,界面添加新消息
|
||||
},
|
||||
onRecvMessageRevoked: (messageID) {
|
||||
// 消息成功撤回,从界面移除消息
|
||||
},
|
||||
onRecvC2CReadReceipt: (list) {
|
||||
// 消息被阅读回执,将消息标记为已读
|
||||
},
|
||||
))
|
||||
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener(
|
||||
onProgress: (messageID, progress) {
|
||||
// 消息发送进度回调
|
||||
},
|
||||
))
|
||||
..friendshipManager.setFriendshipListener(OnFriendshipListener(
|
||||
onFriendApplicationRejected: (applicationInfo) {
|
||||
// 发出或收到的好友申请被拒绝
|
||||
},
|
||||
onFriendApplicationDeleted: (applicationInfo) {
|
||||
// 发出或收到的好友申请被删除
|
||||
},
|
||||
onFriendApplicationAdded: (applicationInfo) {
|
||||
// 发出或收到的好友申请被添加
|
||||
},
|
||||
onFriendApplicationAccepted: (applicationInfo) {
|
||||
// 发出或收到的好友申请已同意
|
||||
},
|
||||
onFriendAdded: (frinedInfo) {
|
||||
// 好友被添加
|
||||
},
|
||||
onFriendDeleted: (frinedInfo) {
|
||||
// 好友被删除
|
||||
},
|
||||
onFriendInfoChanged: (frinedInfo) {
|
||||
// 朋友的资料发生变化
|
||||
},
|
||||
onBlacklistDeleted: (blackInfo) {
|
||||
// 从黑名单删除
|
||||
},
|
||||
onBlacklistAdded: (blackInfo) {
|
||||
// 拉入黑名单
|
||||
},
|
||||
))
|
||||
..conversationManager.setConversationListener(OnConversationListener(
|
||||
onNewConversation: (list) {
|
||||
// 新增会话
|
||||
},
|
||||
onConversationChanged: (list) {
|
||||
// 已添加的会话发送改变
|
||||
},
|
||||
onTotalUnreadMessageCountChanged: (count) {
|
||||
// 未读消息数发送变化
|
||||
},
|
||||
))
|
||||
..groupManager.setGroupListener(OnGroupListener(
|
||||
onGroupMemberInfoChanged: (memberInfo) {
|
||||
// 组成员信息发生变化
|
||||
},
|
||||
onGroupMemberDeleted: (memberInfo) {
|
||||
// 组成员退出
|
||||
},
|
||||
onGroupMemberAdded: (memberInfo) {
|
||||
// 组成员进入
|
||||
},
|
||||
onGroupApplicationRejected: (applicationInfo) {
|
||||
// 发出或收到的组申请被拒绝
|
||||
},
|
||||
onGroupApplicationDeleted: (applicationInfo) {
|
||||
// 发出或收到的组申请被删除
|
||||
},
|
||||
onGroupApplicationAdded: (applicationInfo) {
|
||||
// 发出或收到的组申请有新增
|
||||
},
|
||||
onGroupApplicationAccepted: (applicationInfo) {
|
||||
// 发出或收到的组申请被接受
|
||||
},
|
||||
onJoinedGroupDeleted: (groupInfo) {
|
||||
// 退出群:退出者收到;踢出群:被踢者收到
|
||||
},
|
||||
onJoinedGroupAdded: (groupInfo) {
|
||||
// 创建群: 初始成员收到;邀请进群:被邀请者收到
|
||||
},
|
||||
onGroupInfoChanged: (groupInfo) {
|
||||
// 组资料变更
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
void login() {
|
||||
OpenIM.iMManager
|
||||
.login(
|
||||
uid: "", // uid来自于自身业务服务器
|
||||
token: "", // token需要业务服务器根据secret向OpenIM服务端交换获取
|
||||
)
|
||||
.then((value) {
|
||||
// 返回当前登录用户的资料
|
||||
});
|
||||
}
|
||||
|
||||
void imMager() {
|
||||
OpenIM.iMManager.logout().then((_) {
|
||||
// 退出成功
|
||||
});
|
||||
|
||||
OpenIM.iMManager.getLoginUserInfo().then((userInfo) {
|
||||
// 当前登录用户的信息
|
||||
});
|
||||
|
||||
OpenIM.iMManager.getLoginUserID().then((userID) {
|
||||
// 当前登录用户的ID
|
||||
});
|
||||
}
|
||||
|
||||
void userManager() {
|
||||
OpenIM.iMManager.userManager.getUsersInfo(
|
||||
uidList: [], // 用户ID集合
|
||||
).then((userInfoList) {
|
||||
// 用户信息列表
|
||||
});
|
||||
|
||||
OpenIM.iMManager.userManager.getSelfUserInfo().then((userInfo) {
|
||||
// 返回当前登录用户的资料
|
||||
});
|
||||
|
||||
OpenIM.iMManager.userManager
|
||||
.setSelfInfo(
|
||||
nickname: '',
|
||||
// 昵称
|
||||
faceURL: '',
|
||||
// 头像
|
||||
gender: 0,
|
||||
// 性别: 男1,女0
|
||||
phoneNumber: '',
|
||||
// 手机号
|
||||
email: '',
|
||||
//邮箱
|
||||
birth: 0,
|
||||
//生日
|
||||
ex: '', // 其他信息
|
||||
)
|
||||
.then((_) {});
|
||||
}
|
||||
|
||||
void conversationManager() {
|
||||
OpenIM.iMManager.conversationManager.getAllConversationList().then((list) {
|
||||
// List<ConversationInfo> 会话列表
|
||||
});
|
||||
OpenIM.iMManager.conversationManager.getConversationListSplit(
|
||||
offset: 0, // 偏移量,如:第1页,offet:0,count:20;第2页:offset:20;
|
||||
count: 0, // 每页数量
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.getOneConversation(
|
||||
sourceID: "", // 如果是单聊值传userID,如果是群聊groupID
|
||||
sessionType: 1, // 如果是单聊值传1,如果是群聊值传2
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.getMultipleConversation(
|
||||
conversationIDList: [], // 会话ID集合
|
||||
).then((list) {
|
||||
// 返回与id匹配的会话列表
|
||||
});
|
||||
OpenIM.iMManager.conversationManager
|
||||
.deleteConversation(
|
||||
conversationID: "", // 会话id
|
||||
)
|
||||
.then((_) => null)
|
||||
.catchError((_) {});
|
||||
OpenIM.iMManager.conversationManager.setConversationDraft(
|
||||
conversationID: "", // 会话id
|
||||
draftText: "", // 草稿
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.pinConversation(
|
||||
conversationID: "", // 会话id
|
||||
isPinned: true, // true:置顶;false:取消置顶
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.markGroupMessageHasRead(
|
||||
groupID: "", // 组id
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.getTotalUnreadMsgCount();
|
||||
OpenIM.iMManager.conversationManager.getConversationIDBySessionType(
|
||||
sourceID: "", // 如果是单聊值传userID,如果是群聊groupID
|
||||
sessionType: 1, // 如果是单聊值传1,如果是群聊值传2
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.setConversationRecvMessageOpt(
|
||||
conversationIDList: [], // 会话id列表
|
||||
status: 1, // 1:不接受消息;2:接受在线消息不接受离线消息;0:正常
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.getConversationRecvMessageOpt(
|
||||
conversationIDList: [], // 会话id列表
|
||||
);
|
||||
OpenIM.iMManager.conversationManager.simpleSort([]);
|
||||
}
|
||||
|
||||
void friendManager() {
|
||||
OpenIM.iMManager.friendshipManager.getFriendsInfo(
|
||||
uidList: [], // userId列表
|
||||
).then((list) {
|
||||
// List<UserInfo>
|
||||
});
|
||||
OpenIM.iMManager.friendshipManager.addFriend(
|
||||
uid: "", // 用户id
|
||||
reason: '', // 发起好友申请的描述信息
|
||||
);
|
||||
OpenIM.iMManager.friendshipManager
|
||||
.getRecvFriendApplicationList()
|
||||
.then((value) {
|
||||
// List<FriendApplicationInfo> 申请列表
|
||||
});
|
||||
OpenIM.iMManager.friendshipManager
|
||||
.getSendFriendApplicationList()
|
||||
.then((list) {
|
||||
// List<FriendApplicationInfo> 申请列表
|
||||
});
|
||||
OpenIM.iMManager.friendshipManager.getFriendList().then((list) {
|
||||
// List<UserInfo> 好友信息列表
|
||||
});
|
||||
OpenIM.iMManager.friendshipManager.setFriendRemark(
|
||||
uid: '', // 好友userID
|
||||
remark: '', // 备注名
|
||||
);
|
||||
OpenIM.iMManager.friendshipManager.addBlacklist(
|
||||
uid: "", // 好友userID
|
||||
);
|
||||
OpenIM.iMManager.friendshipManager.getBlacklist().then((list) {
|
||||
// List<UserInfo>
|
||||
});
|
||||
OpenIM.iMManager.friendshipManager.removeBlacklist(
|
||||
uid: "", // userID
|
||||
);
|
||||
OpenIM.iMManager.friendshipManager.checkFriend(
|
||||
uidList: [], // userID 列表
|
||||
).then((value) {
|
||||
// List<FriendshipInfo>
|
||||
});
|
||||
OpenIM.iMManager.friendshipManager.deleteFriend(
|
||||
uid: '', // userID
|
||||
);
|
||||
OpenIM.iMManager.friendshipManager.acceptFriendApplication(
|
||||
uid: "", // userID
|
||||
handleMsg: '', // 备注信息
|
||||
);
|
||||
OpenIM.iMManager.friendshipManager.refuseFriendApplication(
|
||||
uid: "", // userID
|
||||
handleMsg: '', // 备注信息
|
||||
);
|
||||
}
|
||||
|
||||
void groupManager() {
|
||||
OpenIM.iMManager.groupManager
|
||||
.inviteUserToGroup(
|
||||
groupId: '', // 组ID
|
||||
uidList: [], // 成员 userID 列表
|
||||
reason: '', // 备注信息
|
||||
)
|
||||
.then((list) {
|
||||
// List<GroupInviteResult>
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager.kickGroupMember(
|
||||
groupId: '', // 组ID
|
||||
uidList: [], // userID 列表
|
||||
reason: '', // 备注信息
|
||||
);
|
||||
OpenIM.iMManager.groupManager.getGroupMembersInfo(
|
||||
groupId: '', // 组ID
|
||||
uidList: [], // 成员 userID 列表
|
||||
).then((list) {
|
||||
// List<GroupMembersInfo>
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager
|
||||
.getGroupMemberList(
|
||||
groupId: '', // 组ID
|
||||
filter: 0, // 1普通成员, 2群主,3管理员
|
||||
offset: 0, // 偏移量,每次开始的index值
|
||||
count: 0, // 每次拉取的数量
|
||||
)
|
||||
.then((list) {
|
||||
// List<GroupMembersInfo>
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager.getJoinedGroupList().then((list) {
|
||||
// List<GroupInfo>
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager
|
||||
.isJoinedGroup(
|
||||
gid: '', // 组ID
|
||||
)
|
||||
.then((joned) {
|
||||
// true已加入;false未加入
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager.createGroup(
|
||||
groupName: '',
|
||||
// 组名
|
||||
faceUrl: '',
|
||||
// 头像
|
||||
notification: '',
|
||||
// 群公告
|
||||
introduction: '',
|
||||
// 群简介
|
||||
groupType: 0,
|
||||
// 类型
|
||||
ex: '',
|
||||
// 扩展信息
|
||||
list: [], // 成员角色集合 List<GroupMemberRole>
|
||||
).then((groupInfo) {
|
||||
// 返回组信息 GroupInfo
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager.setGroupInfo(
|
||||
groupID: '',
|
||||
groupName: '',
|
||||
// 组名
|
||||
faceUrl: '',
|
||||
// 头像
|
||||
notification: '',
|
||||
// 群公告
|
||||
introduction: '',
|
||||
// 群简介
|
||||
ex: '', // 扩展信息
|
||||
);
|
||||
|
||||
OpenIM.iMManager.groupManager.getGroupsInfo(
|
||||
gidList: [], // 组id集合
|
||||
).then((list) {
|
||||
// List<GroupInfo>
|
||||
});
|
||||
|
||||
OpenIM.iMManager.groupManager.joinGroup(
|
||||
gid: '', // 组id
|
||||
reason: '', // 入群备注信息
|
||||
);
|
||||
|
||||
OpenIM.iMManager.groupManager.quitGroup(
|
||||
gid: '', // 组id
|
||||
);
|
||||
OpenIM.iMManager.groupManager.transferGroupOwner(
|
||||
gid: '', // 组ID
|
||||
uid: '', // 新 owner userID
|
||||
);
|
||||
|
||||
OpenIM.iMManager.groupManager.getRecvGroupApplicationList().then((list) {
|
||||
// List<GroupApplicationInfo>
|
||||
});
|
||||
OpenIM.iMManager.groupManager.getSendGroupApplicationList().then((list) {
|
||||
// List<GroupApplicationInfo>
|
||||
});
|
||||
OpenIM.iMManager.groupManager.acceptGroupApplication(
|
||||
gid: '', // 组ID
|
||||
uid: '', // 申请人userID
|
||||
handleMsg: '', // 备注信息
|
||||
);
|
||||
|
||||
OpenIM.iMManager.groupManager.refuseGroupApplication(
|
||||
gid: '', // 组ID
|
||||
uid: '', // 申请人userID
|
||||
handleMsg: '', // 备注信息
|
||||
);
|
||||
}
|
||||
|
||||
void messageManager() {
|
||||
OpenIM.iMManager.messageManager.sendMessage(
|
||||
message: Message(), // 消息体
|
||||
userID: '', // 接受消息的userID
|
||||
groupID: '', // 接受消息的群ID
|
||||
offlinePushInfo: OfflinePushInfo(), // 离线推送消息备注
|
||||
);
|
||||
OpenIM.iMManager.messageManager
|
||||
.getHistoryMessageList(
|
||||
userID: '', // 单聊对象的userID
|
||||
groupID: '', // 群聊的组id
|
||||
startMsg: null, // 消息体
|
||||
count: 0, // 每次拉取的数量
|
||||
)
|
||||
.then((list) {
|
||||
// List<Message>
|
||||
});
|
||||
OpenIM.iMManager.messageManager.revokeMessage(
|
||||
message: Message(), // 消息体
|
||||
);
|
||||
OpenIM.iMManager.messageManager.deleteMessageFromLocalStorage(
|
||||
message: Message(), // 消息体
|
||||
);
|
||||
OpenIM.iMManager.messageManager.insertSingleMessageToLocalStorage(
|
||||
receiverID: '', // 接收者userID
|
||||
senderID: '', // 发送者userID
|
||||
message: Message(), // 消息体
|
||||
);
|
||||
OpenIM.iMManager.messageManager.markC2CMessageAsRead(
|
||||
userID: '', // 接收者 userID
|
||||
messageIDList: [], // 已读的消息id列表
|
||||
);
|
||||
OpenIM.iMManager.messageManager.typingStatusUpdate(
|
||||
userID: '', // 接收者 userID
|
||||
msgTip: '', // 自定义提示内容
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createTextMessage(
|
||||
text: '',
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createTextAtMessage(
|
||||
text: '', // 发送的内容
|
||||
atUidList: [], // 被@到的userID集合
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createImageMessage(
|
||||
imagePath: '', // 图片相对路径
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createImageMessageFromFullPath(
|
||||
imagePath: '', // 图片的绝对路径
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createSoundMessage(
|
||||
soundPath: '', // 相对路径
|
||||
duration: 0, // 时长
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createSoundMessageFromFullPath(
|
||||
soundPath: '', // 绝对路径
|
||||
duration: 0, // 时长
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createVideoMessage(
|
||||
videoPath: '', // 相对路径
|
||||
videoType: '', // minetype
|
||||
duration: 0, // 时长s
|
||||
snapshotPath: '', // 站位缩略图
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createVideoMessageFromFullPath(
|
||||
videoPath: '', // 相对路径
|
||||
videoType: '', // minetype
|
||||
duration: 0, // 时长s
|
||||
snapshotPath: '', // 站位缩略图
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createFileMessage(
|
||||
filePath: '', // 相对路径
|
||||
fileName: '', // 文件名
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createFileMessageFromFullPath(
|
||||
filePath: '', // 相对路径
|
||||
fileName: '', // 文件名
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createForwardMessage(
|
||||
message: Message(), // 转发消息体
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createMergerMessage(
|
||||
messageList: [], // 被转发的消息列表
|
||||
title: '', // 标题
|
||||
summaryList: [], // 每一条消息摘要
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createLocationMessage(
|
||||
latitude: 0, // 纬度
|
||||
longitude: 0, // 经度
|
||||
description: '', // 位置描述信息
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createCustomMessage(
|
||||
data: '', // 自定义内容
|
||||
extension: '', // 扩展信息
|
||||
description: '', // 描述消息
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createQuoteMessage(
|
||||
text: '', // 回复内容
|
||||
quoteMsg: Message(), // 被回复的消息体
|
||||
);
|
||||
OpenIM.iMManager.messageManager.createCardMessage(
|
||||
data: {}, // 自定义内容
|
||||
);
|
||||
OpenIM.iMManager.messageManager.clearC2CHistoryMessage(
|
||||
uid: "", // 清空聊天记录
|
||||
);
|
||||
OpenIM.iMManager.messageManager.clearGroupHistoryMessage(
|
||||
gid: '', // 群ID
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,58 +5,58 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.8.2"
|
||||
version: "2.10.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
version: "1.2.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.17.0"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "1.0.5"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -68,40 +68,52 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.1.1"
|
||||
version: "3.4.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.6.5"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
version: "0.12.13"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.2.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.8.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -111,58 +123,58 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.9.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.11.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.4.8"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "0.4.16"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.4"
|
||||
sdks:
|
||||
dart: ">=2.14.0 <3.0.0"
|
||||
dart: ">=2.18.0 <3.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
|
||||
@@ -3,9 +3,15 @@ import Foundation
|
||||
public class JsonUtil {
|
||||
|
||||
public static func toString(object: AnyObject?)->String {
|
||||
|
||||
if object is NSNull {
|
||||
return ""
|
||||
}
|
||||
|
||||
if object == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
if object is String{
|
||||
let s = object as! String
|
||||
let b = s.replacingOccurrences(of: "\"", with: "\\\"")
|
||||
|
||||
@@ -10,15 +10,23 @@ public class ConversationManager: BaseServiceManager {
|
||||
self["getConversationListSplit"] = getConversationListSplit
|
||||
self["getOneConversation"] = getOneConversation
|
||||
self["getMultipleConversation"] = getMultipleConversation
|
||||
self["deleteConversation"] = deleteConversation
|
||||
self["setConversationDraft"] = setConversationDraft
|
||||
self["pinConversation"] = pinConversation
|
||||
// self["markSingleMessageHasRead"] = markSingleMessageHasRead
|
||||
self["markGroupMessageHasRead"] = markGroupMessageHasRead
|
||||
self["hideConversation"] = hideConversation
|
||||
self["markConversationMessageAsRead"] = markConversationMessageAsRead
|
||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
||||
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
||||
self["setConversationPrivateChat"] = setConversationPrivateChat
|
||||
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
||||
self["deleteConversationAndDeleteAllMsg"] = deleteConversationAndDeleteAllMsg
|
||||
self["deleteAllConversationFromLocal"] = deleteAllConversationFromLocal
|
||||
self["resetConversationGroupAtType"] = resetConversationGroupAtType
|
||||
self["getAtAllTag"] = getAtAllTag
|
||||
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
|
||||
self["setConversationBurnDuration"] = setConversationBurnDuration
|
||||
self["hideAllConversations"] = hideAllConversations
|
||||
}
|
||||
|
||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -35,17 +43,13 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "sessionType"], methodCall[string: "sourceID"])
|
||||
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "sessionType"], methodCall[string: "sourceID"])
|
||||
}
|
||||
|
||||
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"])
|
||||
}
|
||||
@@ -54,12 +58,12 @@ public class ConversationManager: BaseServiceManager {
|
||||
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 hideConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkHideConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
func markConversationMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkConversationMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -67,17 +71,52 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let conversationID = Open_im_sdkGetConversationIDBySessionType(methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||
let conversationID = Open_im_sdkGetConversationIDBySessionType( methodCall[string: "operationID"],methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||
callBack(result, conversationID)
|
||||
}
|
||||
|
||||
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int: "status"])
|
||||
}
|
||||
|
||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func setConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||
}
|
||||
|
||||
func clearConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func deleteConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
}
|
||||
|
||||
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(methodCall[string: "operationID"]))
|
||||
}
|
||||
|
||||
func setGlobalRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGlobalRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "status"])
|
||||
}
|
||||
|
||||
func setConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
|
||||
}
|
||||
|
||||
func hideAllConversations(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkHideAllConversations(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["getFriendsInfo"] = getFriendsInfo
|
||||
self["addFriend"] = addFriend
|
||||
self["getRecvFriendApplicationList"] = getRecvFriendApplicationList
|
||||
self["getSendFriendApplicationList"] = getSendFriendApplicationList
|
||||
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
|
||||
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
|
||||
self["getFriendList"] = getFriendList
|
||||
self["setFriendRemark"] = setFriendRemark
|
||||
self["addBlacklist"] = addBlacklist
|
||||
@@ -19,9 +19,7 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["deleteFriend"] = deleteFriend
|
||||
self["acceptFriendApplication"] = acceptFriendApplication
|
||||
self["refuseFriendApplication"] = refuseFriendApplication
|
||||
// self["forceSyncFriendApplication"] = forceSyncFriendApplication
|
||||
// self["forceSyncFriend"] = forceSyncFriend
|
||||
// self["forceSyncBlackList"] = forceSyncBlackList
|
||||
self["searchFriends"] = searchFriends
|
||||
}
|
||||
|
||||
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -30,19 +28,19 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetDesignatedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetSpecifiedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getRecvFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getFriendApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getFriendApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -54,7 +52,7 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -62,15 +60,15 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func deleteFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -81,20 +79,9 @@ public class FriendshipManager: BaseServiceManager {
|
||||
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
// func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncFriendApplication()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncFriend()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncBlackList()
|
||||
// callBack(result)
|
||||
// }
|
||||
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||
}
|
||||
}
|
||||
|
||||
public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol {
|
||||
@@ -105,11 +92,15 @@ public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListe
|
||||
}
|
||||
|
||||
public func onBlackAdded(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistAdded", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackAdded", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onBlackDeleted(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistDeleted", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackDeleted", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onFriendAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendApplicationAccepted(_ friendApplication: String?) {
|
||||
@@ -128,16 +119,12 @@ public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListe
|
||||
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 onFriendAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", 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)
|
||||
}
|
||||
|
||||
public func onFriendInfoChanged(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,14 +17,24 @@ public class GroupManager: BaseServiceManager {
|
||||
self["joinGroup"] = joinGroup
|
||||
self["quitGroup"] = quitGroup
|
||||
self["transferGroupOwner"] = transferGroupOwner
|
||||
self["getRecvGroupApplicationList"] = getRecvGroupApplicationList
|
||||
self["getSendGroupApplicationList"] = getSendGroupApplicationList
|
||||
self["getGroupApplicationListAsRecipient"] = getGroupApplicationListAsRecipient
|
||||
self["getGroupApplicationListAsApplicant"] = getGroupApplicationListAsApplicant
|
||||
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
|
||||
self["isJoinGroup"] = isJoinGroup
|
||||
}
|
||||
|
||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -33,21 +43,21 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetSpecifiedGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[int32: "filter"],
|
||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "filter"],
|
||||
methodCall[int32: "offset"], methodCall[int32: "count"])
|
||||
}
|
||||
|
||||
@@ -56,74 +66,110 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"])
|
||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "gInfo"])
|
||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupInfo"])
|
||||
}
|
||||
|
||||
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gidList"])
|
||||
Open_im_sdkGetSpecifiedGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupIDList"])
|
||||
}
|
||||
|
||||
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"])
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
|
||||
}
|
||||
|
||||
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"])
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func getRecvGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getGroupApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getGroupApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
||||
}
|
||||
|
||||
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], 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)
|
||||
// }
|
||||
|
||||
}
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[bool: "mute"])
|
||||
}
|
||||
|
||||
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[int:"seconds"])
|
||||
}
|
||||
|
||||
func setGroupMemberNickname(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupMemberNickname(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],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"])
|
||||
}
|
||||
|
||||
func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
|
||||
public func onGroupApplicationAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
@@ -140,6 +186,10 @@ public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtoco
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onGroupDismissed(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupDismissed", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onGroupInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
@@ -3,27 +3,73 @@ import OpenIMCore
|
||||
|
||||
public class IMMananger: BaseServiceManager {
|
||||
|
||||
let reachability = try? Reachability()
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["initSDK"] = initSDK
|
||||
self["unInitSDK"] = unInitSDK
|
||||
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["uploadFile"] = uploadFile
|
||||
self["updateFcmToken"] = updateFcmToken
|
||||
self["setAppBackgroundStatus"] = setAppBackgroundStatus
|
||||
self["networkStatusChanged"] = networkStatusChanged
|
||||
}
|
||||
|
||||
fileprivate func addObservers() {
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(applicationWillEnterForeground),
|
||||
name: UIApplication.willEnterForegroundNotification,
|
||||
object: nil)
|
||||
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(applicationDidEnterBackground),
|
||||
name: UIApplication.didEnterBackgroundNotification,
|
||||
object: nil)
|
||||
|
||||
if let reachability {
|
||||
do {
|
||||
try reachability.startNotifier()
|
||||
} catch (let e) {
|
||||
print("reachability: \(e)")
|
||||
}
|
||||
|
||||
reachability.whenReachable = { _ in
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString)
|
||||
}
|
||||
reachability.whenUnreachable = { _ in
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
fileprivate func applicationDidEnterBackground() {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString, true)
|
||||
}
|
||||
|
||||
@objc
|
||||
fileprivate func applicationWillEnterForeground() {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString, false)
|
||||
}
|
||||
|
||||
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
callBack(result)
|
||||
callBack(result, Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||
addObservers()
|
||||
}
|
||||
|
||||
func unInitSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkUnInitSDK(methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"], methodCall[string: "token"])
|
||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "token"])
|
||||
}
|
||||
|
||||
func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -31,33 +77,25 @@ public class IMMananger: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
callBack(result, Open_im_sdkGetLoginStatus())
|
||||
callBack(result, Open_im_sdkGetLoginStatus(methodCall[string: "operationID"]))
|
||||
}
|
||||
|
||||
// func getLoginUid(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// callBack(result, Open_im_sdkGetLoginUser())
|
||||
// }
|
||||
func uploadFile(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkUploadFile(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString(), UploadFileListener(channel: self.channel,id: methodCall[string: "id"]))
|
||||
}
|
||||
|
||||
// func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result))
|
||||
// }
|
||||
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"], methodCall[int64:
|
||||
"expireTime"])
|
||||
}
|
||||
|
||||
// func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result))
|
||||
// }
|
||||
func setAppBackgroundStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[bool: "isBackground"])
|
||||
}
|
||||
|
||||
// func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceSyncLoginUerInfo()
|
||||
// callBack(result)
|
||||
// }
|
||||
|
||||
// func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"])
|
||||
// }
|
||||
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
// Open_im_sdkForceReConn()
|
||||
// callBack(result)
|
||||
// }
|
||||
func networkStatusChanged(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||
@@ -70,7 +108,7 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
|
||||
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: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
@@ -87,3 +125,79 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
}
|
||||
|
||||
public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
private let id: String
|
||||
|
||||
init(channel:FlutterMethodChannel, id: String) {
|
||||
self.channel = channel
|
||||
self.id = id
|
||||
}
|
||||
public func complete(_ size: Int64, url: String?, typ: Int) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["size"] = size
|
||||
values["url"] = url
|
||||
values["type"] = typ
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "complete", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func hashPartComplete(_ partsHash: String?, fileHash: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["partHash"] = partsHash
|
||||
values["fileHash"] = fileHash
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func hashPartProgress(_ index: Int, size: Int64, partHash: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["index"] = index
|
||||
values["size"] = size
|
||||
values["partHash"] = partHash
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartProgress", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func open(_ size: Int64) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["size"] = size
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func partSize(_ partSize: Int64, num: Int) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["partSize"] = partSize
|
||||
values["num"] = num
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "partSize", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func uploadComplete(_ fileSize: Int64, streamSize: Int64, storageSize: Int64) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["fileSize"] = fileSize
|
||||
values["streamSize"] = streamSize
|
||||
values["storageSize"] = storageSize
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadProgress", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func uploadID(_ uploadID: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["uploadID"] = uploadID
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func uploadPartComplete(_ index: Int, partSize: Int64, partHash: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["index"] = index
|
||||
values["partSize"] = partSize
|
||||
values["partHash"] = partHash
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadPartComplete", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,19 @@ import OpenIMCore
|
||||
|
||||
public class MessageManager: BaseServiceManager {
|
||||
private let KEY_ID: String = "id"
|
||||
// private var listeners: [String: AdvancedMsgListener] = [:]
|
||||
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setAdvancedMsgListener"] = setAdvancedMsgListener
|
||||
self["sendMessage"] = sendMessage
|
||||
self["getHistoryMessageList"] = getHistoryMessageList
|
||||
self["revokeMessage"] = revokeMessage
|
||||
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
|
||||
self["deleteMessages"] = deleteMessages
|
||||
self["deleteMessageFromLocalAndSvr"] = deleteMessageFromLocalAndSvr
|
||||
self["deleteAllMsgFromLocal"] = deleteAllMsgFromLocal
|
||||
self["deleteAllMsgFromLocalAndSvr"] = deleteAllMsgFromLocalAndSvr
|
||||
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
|
||||
// self["findMessages"] = findMessages
|
||||
self["markC2CMessageAsRead"] = markC2CMessageAsRead
|
||||
self["insertGroupMessageToLocalStorage"] = insertGroupMessageToLocalStorage
|
||||
self["markMessagesAsReadByMsgID"] = markMessagesAsReadByMsgID
|
||||
self["typingStatusUpdate"] = typingStatusUpdate
|
||||
self["createTextMessage"] = createTextMessage
|
||||
self["createTextAtMessage"] = createTextAtMessage
|
||||
@@ -33,9 +33,26 @@ public class MessageManager: BaseServiceManager {
|
||||
self["createCustomMessage"] = createCustomMessage
|
||||
self["createQuoteMessage"] = createQuoteMessage
|
||||
self["createCardMessage"] = createCardMessage
|
||||
// self["forceSyncMsg"] = forceSyncMsg
|
||||
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
||||
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
||||
self["createFaceMessage"] = createFaceMessage
|
||||
self["createAdvancedTextMessage"] = createAdvancedTextMessage
|
||||
self["createAdvancedQuoteMessage"] = createAdvancedQuoteMessage
|
||||
|
||||
self["searchLocalMessages"] = searchLocalMessages
|
||||
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
||||
|
||||
self["getAdvancedHistoryMessageList"] = getAdvancedHistoryMessageList
|
||||
self["getAdvancedHistoryMessageListReverse"] = getAdvancedHistoryMessageListReverse
|
||||
|
||||
self["findMessageList"] = findMessageList
|
||||
self["setMessageLocalEx"] = setMessageLocalEx
|
||||
self["setAppBadge"] = setAppBadge
|
||||
|
||||
self["sendMessageNotOss"] = sendMessageNotOss
|
||||
self["createImageMessageByURL"] = createImageMessageByURL
|
||||
self["createSoundMessageByURL"] = createSoundMessageByURL
|
||||
self["createVideoMessageByURL"] = createVideoMessageByURL
|
||||
self["createFileMessageByURL"] = createFileMessageByURL
|
||||
self["setCustomBusinessListener"] = setCustomBusinessListener
|
||||
}
|
||||
|
||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -51,20 +68,24 @@ public class MessageManager: BaseServiceManager {
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
|
||||
}
|
||||
|
||||
func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
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[string: "operationID"], methodCall.toJsonString())
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[string: "clientMsgID"])
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[string: "clientMsgID"])
|
||||
}
|
||||
|
||||
// deprecated
|
||||
func deleteMessages(methodCall: FlutterMethodCall, result: FlutterResult){
|
||||
func deleteMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[string: "clientMsgID"])
|
||||
}
|
||||
|
||||
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 insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -72,24 +93,26 @@ public class MessageManager: BaseServiceManager {
|
||||
methodCall[string: "receiverID"], methodCall[string: "senderID"])
|
||||
}
|
||||
|
||||
// func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"])
|
||||
// }
|
||||
|
||||
func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], 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 markMessagesAsReadByMsgID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkMessagesAsReadByMsgID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"])
|
||||
}
|
||||
|
||||
|
||||
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"]))
|
||||
}
|
||||
|
||||
func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"], methodCall[jsonString: "atUserList"]))
|
||||
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"],
|
||||
methodCall[jsonString: "atUserIDList"], methodCall[jsonString: "atUserInfoList"], methodCall[jsonString: "quoteMessage"]))
|
||||
}
|
||||
|
||||
func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -116,18 +139,18 @@ public class MessageManager: BaseServiceManager {
|
||||
|
||||
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
}
|
||||
|
||||
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
}
|
||||
|
||||
|
||||
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||
}
|
||||
|
||||
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
||||
methodCall[jsonString: "summaryList"])
|
||||
@@ -158,77 +181,194 @@ public class MessageManager: BaseServiceManager {
|
||||
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
|
||||
}
|
||||
|
||||
// func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncMsg()
|
||||
// callBack(result)
|
||||
// }
|
||||
|
||||
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
|
||||
func createFaceMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkCreateFaceMessage(methodCall[string: "operationID"], methodCall[int: "index"], methodCall[string: "data"]))
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
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 searchLocalMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchLocalMessages(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "filter"])
|
||||
}
|
||||
|
||||
func clearConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func getAdvancedHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetAdvancedHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getAdvancedHistoryMessageListReverse(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetAdvancedHistoryMessageListReverse(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"])
|
||||
}
|
||||
|
||||
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
||||
private let channel: FlutterMethodChannel
|
||||
private let result: FlutterResult
|
||||
private let call: FlutterMethodCall
|
||||
|
||||
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
|
||||
self.channel = channel
|
||||
self.result = result
|
||||
self.call = methodCall
|
||||
}
|
||||
|
||||
public func onError(_ errCode: Int32, errMsg: String?) {
|
||||
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
|
||||
}
|
||||
|
||||
public func onProgress(_ progress: Int) {
|
||||
var values: [String: Any] = [:]
|
||||
let message = call[dict: "message"]
|
||||
values["clientMsgID"] = message["clientMsgID"]
|
||||
values["progress"] = progress
|
||||
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onSuccess(_ data: String?) {
|
||||
DispatchQueue.main.async { self.result(data) }
|
||||
}
|
||||
|
||||
func setMessageLocalEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetMessageLocalEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "clientMsgID"], methodCall[string: "localEx"])
|
||||
}
|
||||
|
||||
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["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 setAppBadge(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetAppBadge(BaseCallback(result: result), methodCall[string: "operationID"], Int32(methodCall[int64: "count"]))
|
||||
}
|
||||
|
||||
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
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[string: "sourcePath"], 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)
|
||||
}
|
||||
}
|
||||
|
||||
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 onMsgDeleted(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onMsgDeleted", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
|
||||
public func onNewRecvMessageRevoked(_ messageRevoked: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["messageRevoked"] = messageRevoked
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onNewRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["msgReceiptList"] = 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["groupMsgReceiptList"] = groupMsgReceiptList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvMessageExtensionsAdded(_ msgID: String?, reactionExtensionList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["msgID"] = msgID
|
||||
values["reactionExtensionList"] = reactionExtensionList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsAdded", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvMessageExtensionsChanged(_ msgID: String?, reactionExtensionList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["msgID"] = msgID
|
||||
values["reactionExtensionList"] = 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["reactionExtensionKeyList"] = reactionExtensionKeyList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsDeleted", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
|
||||
public func onRecvOfflineNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@ public class UserManager: BaseServiceManager {
|
||||
self["getUsersInfo"] = getUsersInfo
|
||||
self["setSelfInfo"] = setSelfInfo
|
||||
self["getSelfUserInfo"] = getSelfUserInfo
|
||||
self["subscribeUsersStatus"] = subscribeUsersStatus
|
||||
self["unsubscribeUsersStatus"] = unsubscribeUsersStatus
|
||||
self["getSubscribeUsersStatus"] = getSubscribeUsersStatus
|
||||
self["getUserStatus"] = getUserStatus
|
||||
self["getUsersInfoWithCache"] = getUsersInfoWithCache
|
||||
}
|
||||
|
||||
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -17,7 +22,7 @@ public class UserManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -27,6 +32,27 @@ public class UserManager: BaseServiceManager {
|
||||
func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func subscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||
}
|
||||
|
||||
func unsubscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkUnsubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||
}
|
||||
|
||||
func getSubscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getUserStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetUserStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||
}
|
||||
|
||||
func getUsersInfoWithCache(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetUsersInfoWithCache(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"],
|
||||
methodCall[string: "groupID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
|
||||
@@ -40,4 +66,9 @@ public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol
|
||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||
}
|
||||
|
||||
public func onUserStatusChanged(_ statusInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
405
ios/Classes/Reachability.swift
Normal file
405
ios/Classes/Reachability.swift
Normal file
@@ -0,0 +1,405 @@
|
||||
/*
|
||||
Copyright (c) 2014, Ashley Mills
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import SystemConfiguration
|
||||
import Foundation
|
||||
|
||||
public enum ReachabilityError: Error {
|
||||
case failedToCreateWithAddress(sockaddr, Int32)
|
||||
case failedToCreateWithHostname(String, Int32)
|
||||
case unableToSetCallback(Int32)
|
||||
case unableToSetDispatchQueue(Int32)
|
||||
case unableToGetFlags(Int32)
|
||||
}
|
||||
|
||||
@available(*, unavailable, renamed: "Notification.Name.reachabilityChanged")
|
||||
public let ReachabilityChangedNotification = NSNotification.Name("ReachabilityChangedNotification")
|
||||
|
||||
public extension Notification.Name {
|
||||
static let reachabilityChanged = Notification.Name("reachabilityChanged")
|
||||
}
|
||||
|
||||
public class Reachability {
|
||||
|
||||
public typealias NetworkReachable = (Reachability) -> ()
|
||||
public typealias NetworkUnreachable = (Reachability) -> ()
|
||||
|
||||
@available(*, unavailable, renamed: "Connection")
|
||||
public enum NetworkStatus: CustomStringConvertible {
|
||||
case notReachable, reachableViaWiFi, reachableViaWWAN
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .reachableViaWWAN: return "Cellular"
|
||||
case .reachableViaWiFi: return "WiFi"
|
||||
case .notReachable: return "No Connection"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum Connection: CustomStringConvertible {
|
||||
case unavailable, wifi, cellular
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .cellular: return "Cellular"
|
||||
case .wifi: return "WiFi"
|
||||
case .unavailable: return "No Connection"
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "unavailable")
|
||||
public static let none: Connection = .unavailable
|
||||
}
|
||||
|
||||
public var whenReachable: NetworkReachable?
|
||||
public var whenUnreachable: NetworkUnreachable?
|
||||
|
||||
@available(*, deprecated, renamed: "allowsCellularConnection")
|
||||
public let reachableOnWWAN: Bool = true
|
||||
|
||||
/// Set to `false` to force Reachability.connection to .none when on cellular connection (default value `true`)
|
||||
public var allowsCellularConnection: Bool
|
||||
|
||||
// The notification center on which "reachability changed" events are being posted
|
||||
public var notificationCenter: NotificationCenter = NotificationCenter.default
|
||||
|
||||
@available(*, deprecated, renamed: "connection.description")
|
||||
public var currentReachabilityString: String {
|
||||
return "\(connection)"
|
||||
}
|
||||
|
||||
@available(*, unavailable, renamed: "connection")
|
||||
public var currentReachabilityStatus: Connection {
|
||||
return connection
|
||||
}
|
||||
|
||||
public var connection: Connection {
|
||||
if flags == nil {
|
||||
try? setReachabilityFlags()
|
||||
}
|
||||
|
||||
switch flags?.connection {
|
||||
case .unavailable?, nil: return .unavailable
|
||||
case .cellular?: return allowsCellularConnection ? .cellular : .unavailable
|
||||
case .wifi?: return .wifi
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate var isRunningOnDevice: Bool = {
|
||||
#if targetEnvironment(simulator)
|
||||
return false
|
||||
#else
|
||||
return true
|
||||
#endif
|
||||
}()
|
||||
|
||||
fileprivate(set) var notifierRunning = false
|
||||
fileprivate let reachabilityRef: SCNetworkReachability
|
||||
fileprivate let reachabilitySerialQueue: DispatchQueue
|
||||
fileprivate let notificationQueue: DispatchQueue?
|
||||
fileprivate(set) var flags: SCNetworkReachabilityFlags? {
|
||||
didSet {
|
||||
guard flags != oldValue else { return }
|
||||
notifyReachabilityChanged()
|
||||
}
|
||||
}
|
||||
|
||||
required public init(reachabilityRef: SCNetworkReachability,
|
||||
queueQoS: DispatchQoS = .default,
|
||||
targetQueue: DispatchQueue? = nil,
|
||||
notificationQueue: DispatchQueue? = .main) {
|
||||
self.allowsCellularConnection = true
|
||||
self.reachabilityRef = reachabilityRef
|
||||
self.reachabilitySerialQueue = DispatchQueue(label: "uk.co.ashleymills.reachability", qos: queueQoS, target: targetQueue)
|
||||
self.notificationQueue = notificationQueue
|
||||
}
|
||||
|
||||
public convenience init(hostname: String,
|
||||
queueQoS: DispatchQoS = .default,
|
||||
targetQueue: DispatchQueue? = nil,
|
||||
notificationQueue: DispatchQueue? = .main) throws {
|
||||
guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else {
|
||||
throw ReachabilityError.failedToCreateWithHostname(hostname, SCError())
|
||||
}
|
||||
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)
|
||||
}
|
||||
|
||||
public convenience init(queueQoS: DispatchQoS = .default,
|
||||
targetQueue: DispatchQueue? = nil,
|
||||
notificationQueue: DispatchQueue? = .main) throws {
|
||||
var zeroAddress = sockaddr()
|
||||
zeroAddress.sa_len = UInt8(MemoryLayout<sockaddr>.size)
|
||||
zeroAddress.sa_family = sa_family_t(AF_INET)
|
||||
|
||||
guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else {
|
||||
throw ReachabilityError.failedToCreateWithAddress(zeroAddress, SCError())
|
||||
}
|
||||
|
||||
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)
|
||||
}
|
||||
|
||||
deinit {
|
||||
stopNotifier()
|
||||
}
|
||||
}
|
||||
|
||||
public extension Reachability {
|
||||
|
||||
// MARK: - *** Notifier methods ***
|
||||
func startNotifier() throws {
|
||||
guard !notifierRunning else { return }
|
||||
|
||||
let callback: SCNetworkReachabilityCallBack = { (reachability, flags, info) in
|
||||
guard let info = info else { return }
|
||||
|
||||
// `weakifiedReachability` is guaranteed to exist by virtue of our
|
||||
// retain/release callbacks which we provided to the `SCNetworkReachabilityContext`.
|
||||
let weakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info).takeUnretainedValue()
|
||||
|
||||
// The weak `reachability` _may_ no longer exist if the `Reachability`
|
||||
// object has since been deallocated but a callback was already in flight.
|
||||
weakifiedReachability.reachability?.flags = flags
|
||||
}
|
||||
|
||||
let weakifiedReachability = ReachabilityWeakifier(reachability: self)
|
||||
let opaqueWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.passUnretained(weakifiedReachability).toOpaque()
|
||||
|
||||
var context = SCNetworkReachabilityContext(
|
||||
version: 0,
|
||||
info: UnsafeMutableRawPointer(opaqueWeakifiedReachability),
|
||||
retain: { (info: UnsafeRawPointer) -> UnsafeRawPointer in
|
||||
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
||||
_ = unmanagedWeakifiedReachability.retain()
|
||||
return UnsafeRawPointer(unmanagedWeakifiedReachability.toOpaque())
|
||||
},
|
||||
release: { (info: UnsafeRawPointer) -> Void in
|
||||
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
||||
unmanagedWeakifiedReachability.release()
|
||||
},
|
||||
copyDescription: { (info: UnsafeRawPointer) -> Unmanaged<CFString> in
|
||||
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
||||
let weakifiedReachability = unmanagedWeakifiedReachability.takeUnretainedValue()
|
||||
let description = weakifiedReachability.reachability?.description ?? "nil"
|
||||
return Unmanaged.passRetained(description as CFString)
|
||||
}
|
||||
)
|
||||
|
||||
if !SCNetworkReachabilitySetCallback(reachabilityRef, callback, &context) {
|
||||
stopNotifier()
|
||||
throw ReachabilityError.unableToSetCallback(SCError())
|
||||
}
|
||||
|
||||
if !SCNetworkReachabilitySetDispatchQueue(reachabilityRef, reachabilitySerialQueue) {
|
||||
stopNotifier()
|
||||
throw ReachabilityError.unableToSetDispatchQueue(SCError())
|
||||
}
|
||||
|
||||
// Perform an initial check
|
||||
try setReachabilityFlags()
|
||||
|
||||
notifierRunning = true
|
||||
}
|
||||
|
||||
func stopNotifier() {
|
||||
defer { notifierRunning = false }
|
||||
|
||||
SCNetworkReachabilitySetCallback(reachabilityRef, nil, nil)
|
||||
SCNetworkReachabilitySetDispatchQueue(reachabilityRef, nil)
|
||||
}
|
||||
|
||||
// MARK: - *** Connection test methods ***
|
||||
@available(*, deprecated, message: "Please use `connection != .none`")
|
||||
var isReachable: Bool {
|
||||
return connection != .unavailable
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Please use `connection == .cellular`")
|
||||
var isReachableViaWWAN: Bool {
|
||||
// Check we're not on the simulator, we're REACHABLE and check we're on WWAN
|
||||
return connection == .cellular
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Please use `connection == .wifi`")
|
||||
var isReachableViaWiFi: Bool {
|
||||
return connection == .wifi
|
||||
}
|
||||
|
||||
var description: String {
|
||||
return flags?.description ?? "unavailable flags"
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate extension Reachability {
|
||||
|
||||
func setReachabilityFlags() throws {
|
||||
try reachabilitySerialQueue.sync { [unowned self] in
|
||||
var flags = SCNetworkReachabilityFlags()
|
||||
if !SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags) {
|
||||
self.stopNotifier()
|
||||
throw ReachabilityError.unableToGetFlags(SCError())
|
||||
}
|
||||
|
||||
self.flags = flags
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func notifyReachabilityChanged() {
|
||||
let notify = { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.connection != .unavailable ? self.whenReachable?(self) : self.whenUnreachable?(self)
|
||||
self.notificationCenter.post(name: .reachabilityChanged, object: self)
|
||||
}
|
||||
|
||||
// notify on the configured `notificationQueue`, or the caller's (i.e. `reachabilitySerialQueue`)
|
||||
notificationQueue?.async(execute: notify) ?? notify()
|
||||
}
|
||||
}
|
||||
|
||||
extension SCNetworkReachabilityFlags {
|
||||
|
||||
typealias Connection = Reachability.Connection
|
||||
|
||||
var connection: Connection {
|
||||
guard isReachableFlagSet else { return .unavailable }
|
||||
|
||||
// If we're reachable, but not on an iOS device (i.e. simulator), we must be on WiFi
|
||||
#if targetEnvironment(simulator)
|
||||
return .wifi
|
||||
#else
|
||||
var connection = Connection.unavailable
|
||||
|
||||
if !isConnectionRequiredFlagSet {
|
||||
connection = .wifi
|
||||
}
|
||||
|
||||
if isConnectionOnTrafficOrDemandFlagSet {
|
||||
if !isInterventionRequiredFlagSet {
|
||||
connection = .wifi
|
||||
}
|
||||
}
|
||||
|
||||
if isOnWWANFlagSet {
|
||||
connection = .cellular
|
||||
}
|
||||
|
||||
return connection
|
||||
#endif
|
||||
}
|
||||
|
||||
var isOnWWANFlagSet: Bool {
|
||||
#if os(iOS)
|
||||
return contains(.isWWAN)
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
var isReachableFlagSet: Bool {
|
||||
return contains(.reachable)
|
||||
}
|
||||
var isConnectionRequiredFlagSet: Bool {
|
||||
return contains(.connectionRequired)
|
||||
}
|
||||
var isInterventionRequiredFlagSet: Bool {
|
||||
return contains(.interventionRequired)
|
||||
}
|
||||
var isConnectionOnTrafficFlagSet: Bool {
|
||||
return contains(.connectionOnTraffic)
|
||||
}
|
||||
var isConnectionOnDemandFlagSet: Bool {
|
||||
return contains(.connectionOnDemand)
|
||||
}
|
||||
var isConnectionOnTrafficOrDemandFlagSet: Bool {
|
||||
return !intersection([.connectionOnTraffic, .connectionOnDemand]).isEmpty
|
||||
}
|
||||
var isTransientConnectionFlagSet: Bool {
|
||||
return contains(.transientConnection)
|
||||
}
|
||||
var isLocalAddressFlagSet: Bool {
|
||||
return contains(.isLocalAddress)
|
||||
}
|
||||
var isDirectFlagSet: Bool {
|
||||
return contains(.isDirect)
|
||||
}
|
||||
var isConnectionRequiredAndTransientFlagSet: Bool {
|
||||
return intersection([.connectionRequired, .transientConnection]) == [.connectionRequired, .transientConnection]
|
||||
}
|
||||
|
||||
var description: String {
|
||||
let W = isOnWWANFlagSet ? "W" : "-"
|
||||
let R = isReachableFlagSet ? "R" : "-"
|
||||
let c = isConnectionRequiredFlagSet ? "c" : "-"
|
||||
let t = isTransientConnectionFlagSet ? "t" : "-"
|
||||
let i = isInterventionRequiredFlagSet ? "i" : "-"
|
||||
let C = isConnectionOnTrafficFlagSet ? "C" : "-"
|
||||
let D = isConnectionOnDemandFlagSet ? "D" : "-"
|
||||
let l = isLocalAddressFlagSet ? "l" : "-"
|
||||
let d = isDirectFlagSet ? "d" : "-"
|
||||
|
||||
return "\(W)\(R) \(c)\(t)\(i)\(C)\(D)\(l)\(d)"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
`ReachabilityWeakifier` weakly wraps the `Reachability` class
|
||||
in order to break retain cycles when interacting with CoreFoundation.
|
||||
|
||||
CoreFoundation callbacks expect a pair of retain/release whenever an
|
||||
opaque `info` parameter is provided. These callbacks exist to guard
|
||||
against memory management race conditions when invoking the callbacks.
|
||||
|
||||
#### Race Condition
|
||||
|
||||
If we passed `SCNetworkReachabilitySetCallback` a direct reference to our
|
||||
`Reachability` class without also providing corresponding retain/release
|
||||
callbacks, then a race condition can lead to crashes when:
|
||||
- `Reachability` is deallocated on thread X
|
||||
- A `SCNetworkReachability` callback(s) is already in flight on thread Y
|
||||
|
||||
#### Retain Cycle
|
||||
|
||||
If we pass `Reachability` to CoreFoundtion while also providing retain/
|
||||
release callbacks, we would create a retain cycle once CoreFoundation
|
||||
retains our `Reachability` class. This fixes the crashes and his how
|
||||
CoreFoundation expects the API to be used, but doesn't play nicely with
|
||||
Swift/ARC. This cycle would only be broken after manually calling
|
||||
`stopNotifier()` — `deinit` would never be called.
|
||||
|
||||
#### ReachabilityWeakifier
|
||||
|
||||
By providing both retain/release callbacks and wrapping `Reachability` in
|
||||
a weak wrapper, we:
|
||||
- interact correctly with CoreFoundation, thereby avoiding a crash.
|
||||
See "Memory Management Programming Guide for Core Foundation".
|
||||
- don't alter the public API of `Reachability.swift` in any way
|
||||
- still allow for automatic stopping of the notifier on `deinit`.
|
||||
*/
|
||||
private class ReachabilityWeakifier {
|
||||
weak var reachability: Reachability?
|
||||
init(reachability: Reachability) {
|
||||
self.reachability = reachability
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
// Objective-C API for talking to the following Go packages
|
||||
//
|
||||
// open_im_sdk/open_im_sdk
|
||||
// open_im_sdk/open_im_sdk_callback
|
||||
//
|
||||
// File is generated by gomobile bind. Do not edit.
|
||||
#ifndef __OpenIMCore_FRAMEWORK_H__
|
||||
#define __OpenIMCore_FRAMEWORK_H__
|
||||
|
||||
#include "Open_im_sdk.objc.h"
|
||||
#include "Open_im_sdk_callback.objc.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
#endif
|
||||
@@ -1,210 +0,0 @@
|
||||
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
|
||||
// gobind -lang=objc open_im_sdk/open_im_sdk
|
||||
//
|
||||
// File is generated by gobind. Do not edit.
|
||||
|
||||
#ifndef __Open_im_sdk_H__
|
||||
#define __Open_im_sdk_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
#include "Open_im_sdk_callback.objc.h"
|
||||
|
||||
@interface Open_im_sdk : NSObject
|
||||
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
|
||||
|
||||
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
|
||||
|
||||
@end
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
||||
|
||||
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
// skipped function GetUserWorker with unsupported parameter or return types
|
||||
|
||||
|
||||
/**
|
||||
* /////////////////////user/////////////////////
|
||||
*/
|
||||
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
||||
|
||||
// skipped function InitOnce with unsupported parameter or return types
|
||||
|
||||
|
||||
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkInsertGroupMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable groupID, NSString* _Nullable sendID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSearchLocalMessages(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable searchParam);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
|
||||
|
||||
/**
|
||||
* ////////////////////////group//////////////////////////////////////////
|
||||
*/
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
|
||||
|
||||
#endif
|
||||
@@ -1,205 +0,0 @@
|
||||
// Objective-C API for talking to open_im_sdk/open_im_sdk_callback Go package.
|
||||
// gobind -lang=objc open_im_sdk/open_im_sdk_callback
|
||||
//
|
||||
// File is generated by gobind. Do not edit.
|
||||
|
||||
#ifndef __Open_im_sdk_callback_H__
|
||||
#define __Open_im_sdk_callback_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
#include "Universe.objc.h"
|
||||
|
||||
|
||||
@protocol Open_im_sdk_callbackBase;
|
||||
@class Open_im_sdk_callbackBase;
|
||||
@protocol Open_im_sdk_callbackOnAdvancedMsgListener;
|
||||
@class Open_im_sdk_callbackOnAdvancedMsgListener;
|
||||
@protocol Open_im_sdk_callbackOnConnListener;
|
||||
@class Open_im_sdk_callbackOnConnListener;
|
||||
@protocol Open_im_sdk_callbackOnConversationListener;
|
||||
@class Open_im_sdk_callbackOnConversationListener;
|
||||
@protocol Open_im_sdk_callbackOnFriendshipListener;
|
||||
@class Open_im_sdk_callbackOnFriendshipListener;
|
||||
@protocol Open_im_sdk_callbackOnGroupListener;
|
||||
@class Open_im_sdk_callbackOnGroupListener;
|
||||
@protocol Open_im_sdk_callbackOnUserListener;
|
||||
@class Open_im_sdk_callbackOnUserListener;
|
||||
@protocol Open_im_sdk_callbackSendMsgCallBack;
|
||||
@class Open_im_sdk_callbackSendMsgCallBack;
|
||||
|
||||
@protocol Open_im_sdk_callbackBase <NSObject>
|
||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
||||
- (void)onSuccess:(NSString* _Nullable)data;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackOnAdvancedMsgListener <NSObject>
|
||||
- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList;
|
||||
- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId;
|
||||
- (void)onRecvNewMessage:(NSString* _Nullable)message;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackOnConnListener <NSObject>
|
||||
- (void)onConnectFailed:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
||||
- (void)onConnectSuccess;
|
||||
- (void)onConnecting;
|
||||
- (void)onKickedOffline;
|
||||
- (void)onUserTokenExpired;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackOnConversationListener <NSObject>
|
||||
- (void)onConversationChanged:(NSString* _Nullable)conversationList;
|
||||
- (void)onNewConversation:(NSString* _Nullable)conversationList;
|
||||
- (void)onSyncServerFailed;
|
||||
- (void)onSyncServerFinish;
|
||||
- (void)onSyncServerStart;
|
||||
- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackOnFriendshipListener <NSObject>
|
||||
- (void)onBlackAdded:(NSString* _Nullable)blackInfo;
|
||||
- (void)onBlackDeleted:(NSString* _Nullable)blackInfo;
|
||||
- (void)onFriendAdded:(NSString* _Nullable)friendInfo;
|
||||
- (void)onFriendApplicationAccepted:(NSString* _Nullable)groupApplication;
|
||||
- (void)onFriendApplicationAdded:(NSString* _Nullable)friendApplication;
|
||||
- (void)onFriendApplicationDeleted:(NSString* _Nullable)friendApplication;
|
||||
- (void)onFriendApplicationRejected:(NSString* _Nullable)friendApplication;
|
||||
- (void)onFriendDeleted:(NSString* _Nullable)friendInfo;
|
||||
- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackOnGroupListener <NSObject>
|
||||
- (void)onGroupApplicationAccepted:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupApplicationAdded:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupApplicationDeleted:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupApplicationRejected:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupInfoChanged:(NSString* _Nullable)groupInfo;
|
||||
- (void)onGroupMemberAdded:(NSString* _Nullable)groupMemberInfo;
|
||||
- (void)onGroupMemberDeleted:(NSString* _Nullable)groupMemberInfo;
|
||||
- (void)onGroupMemberInfoChanged:(NSString* _Nullable)groupMemberInfo;
|
||||
- (void)onJoinedGroupAdded:(NSString* _Nullable)groupInfo;
|
||||
- (void)onJoinedGroupDeleted:(NSString* _Nullable)groupInfo;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackOnUserListener <NSObject>
|
||||
- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo;
|
||||
@end
|
||||
|
||||
@protocol Open_im_sdk_callbackSendMsgCallBack <NSObject>
|
||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
||||
- (void)onProgress:(long)progress;
|
||||
- (void)onSuccess:(NSString* _Nullable)data;
|
||||
@end
|
||||
|
||||
@class Open_im_sdk_callbackBase;
|
||||
|
||||
@class Open_im_sdk_callbackOnAdvancedMsgListener;
|
||||
|
||||
@class Open_im_sdk_callbackOnConnListener;
|
||||
|
||||
@class Open_im_sdk_callbackOnConversationListener;
|
||||
|
||||
@class Open_im_sdk_callbackOnFriendshipListener;
|
||||
|
||||
@class Open_im_sdk_callbackOnGroupListener;
|
||||
|
||||
@class Open_im_sdk_callbackOnUserListener;
|
||||
|
||||
@class Open_im_sdk_callbackSendMsgCallBack;
|
||||
|
||||
@interface Open_im_sdk_callbackBase : NSObject <goSeqRefInterface, Open_im_sdk_callbackBase> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
||||
- (void)onSuccess:(NSString* _Nullable)data;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackOnAdvancedMsgListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnAdvancedMsgListener> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList;
|
||||
- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId;
|
||||
- (void)onRecvNewMessage:(NSString* _Nullable)message;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackOnConnListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnConnListener> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onConnectFailed:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
||||
- (void)onConnectSuccess;
|
||||
- (void)onConnecting;
|
||||
- (void)onKickedOffline;
|
||||
- (void)onUserTokenExpired;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackOnConversationListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnConversationListener> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onConversationChanged:(NSString* _Nullable)conversationList;
|
||||
- (void)onNewConversation:(NSString* _Nullable)conversationList;
|
||||
- (void)onSyncServerFailed;
|
||||
- (void)onSyncServerFinish;
|
||||
- (void)onSyncServerStart;
|
||||
- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackOnFriendshipListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnFriendshipListener> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onBlackAdded:(NSString* _Nullable)blackInfo;
|
||||
- (void)onBlackDeleted:(NSString* _Nullable)blackInfo;
|
||||
- (void)onFriendAdded:(NSString* _Nullable)friendInfo;
|
||||
- (void)onFriendApplicationAccepted:(NSString* _Nullable)groupApplication;
|
||||
- (void)onFriendApplicationAdded:(NSString* _Nullable)friendApplication;
|
||||
- (void)onFriendApplicationDeleted:(NSString* _Nullable)friendApplication;
|
||||
- (void)onFriendApplicationRejected:(NSString* _Nullable)friendApplication;
|
||||
- (void)onFriendDeleted:(NSString* _Nullable)friendInfo;
|
||||
- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackOnGroupListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnGroupListener> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onGroupApplicationAccepted:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupApplicationAdded:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupApplicationDeleted:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupApplicationRejected:(NSString* _Nullable)groupApplication;
|
||||
- (void)onGroupInfoChanged:(NSString* _Nullable)groupInfo;
|
||||
- (void)onGroupMemberAdded:(NSString* _Nullable)groupMemberInfo;
|
||||
- (void)onGroupMemberDeleted:(NSString* _Nullable)groupMemberInfo;
|
||||
- (void)onGroupMemberInfoChanged:(NSString* _Nullable)groupMemberInfo;
|
||||
- (void)onJoinedGroupAdded:(NSString* _Nullable)groupInfo;
|
||||
- (void)onJoinedGroupDeleted:(NSString* _Nullable)groupInfo;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackOnUserListener : NSObject <goSeqRefInterface, Open_im_sdk_callbackOnUserListener> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo;
|
||||
@end
|
||||
|
||||
@interface Open_im_sdk_callbackSendMsgCallBack : NSObject <goSeqRefInterface, Open_im_sdk_callbackSendMsgCallBack> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (void)onError:(int32_t)errCode errMsg:(NSString* _Nullable)errMsg;
|
||||
- (void)onProgress:(long)progress;
|
||||
- (void)onSuccess:(NSString* _Nullable)data;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,29 +0,0 @@
|
||||
// Objective-C API for talking to Go package.
|
||||
// gobind -lang=objc
|
||||
//
|
||||
// File is generated by gobind. Do not edit.
|
||||
|
||||
#ifndef __Universe_H__
|
||||
#define __Universe_H__
|
||||
|
||||
@import Foundation;
|
||||
#include "ref.h"
|
||||
|
||||
@protocol Universeerror;
|
||||
@class Universeerror;
|
||||
|
||||
@protocol Universeerror <NSObject>
|
||||
- (NSString* _Nonnull)error;
|
||||
@end
|
||||
|
||||
@class Universeerror;
|
||||
|
||||
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
|
||||
}
|
||||
@property(strong, readonly) _Nonnull id _ref;
|
||||
|
||||
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
||||
- (NSString* _Nonnull)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
#ifndef __GO_REF_HDR__
|
||||
#define __GO_REF_HDR__
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
// GoSeqRef is an object tagged with an integer for passing back and
|
||||
// forth across the language boundary. A GoSeqRef may represent either
|
||||
// an instance of a Go object, or an Objective-C object passed to Go.
|
||||
// The explicit allocation of a GoSeqRef is used to pin a Go object
|
||||
// when it is passed to Objective-C. The Go seq package maintains a
|
||||
// reference to the Go object in a map keyed by the refnum along with
|
||||
// a reference count. When the reference count reaches zero, the Go
|
||||
// seq package will clear the corresponding entry in the map.
|
||||
@interface GoSeqRef : NSObject {
|
||||
}
|
||||
@property(readonly) int32_t refnum;
|
||||
@property(strong) id obj; // NULL when representing a Go object.
|
||||
|
||||
// new GoSeqRef object to proxy a Go object. The refnum must be
|
||||
// provided from Go side.
|
||||
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
|
||||
|
||||
- (int32_t)incNum;
|
||||
|
||||
@end
|
||||
|
||||
@protocol goSeqRefInterface
|
||||
-(GoSeqRef*) _ref;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,9 +0,0 @@
|
||||
framework module "OpenIMCore" {
|
||||
header "ref.h"
|
||||
header "Open_im_sdk.objc.h"
|
||||
header "Open_im_sdk_callback.objc.h"
|
||||
header "Universe.objc.h"
|
||||
header "OpenIMCore.h"
|
||||
|
||||
export *
|
||||
}
|
||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -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, '11.0'
|
||||
|
||||
s.vendored_frameworks = 'Framework/*.framework'
|
||||
s.dependency 'OpenIMSDKCore','3.4.0'
|
||||
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,35 +1,38 @@
|
||||
library flutter_openim_sdk;
|
||||
|
||||
export 'src/enum/conversation_type.dart';
|
||||
export 'src/enum/group_at_type.dart';
|
||||
export 'src/enum/group_role_level.dart';
|
||||
export 'src/enum/group_type.dart';
|
||||
export 'src/enum/group_verification.dart';
|
||||
export 'src/enum/im_platform.dart';
|
||||
export 'src/enum/listener_type.dart';
|
||||
export 'src/enum/login_status.dart';
|
||||
export 'src/enum/message_status.dart';
|
||||
export 'src/enum/message_type.dart';
|
||||
export 'src/enum/sdk_error_code.dart';
|
||||
export 'src/listener/advanced_msg_listener.dart';
|
||||
export 'src/listener/advanced_msg_listener.dart';
|
||||
export 'src/listener/connect_listener.dart';
|
||||
export 'src/listener/connect_listener.dart';
|
||||
export 'src/listener/conversation_listener.dart';
|
||||
export 'src/listener/friendship_listener.dart';
|
||||
export 'src/listener/custom_business_listener.dart';
|
||||
export 'src/listener/friendship_listener.dart';
|
||||
export 'src/listener/group_listener.dart';
|
||||
export 'src/listener/group_listener.dart';
|
||||
export 'src/listener/listener_for_service.dart';
|
||||
export 'src/listener/msg_send_progress_listener.dart';
|
||||
export 'src/listener/msg_send_progress_listener.dart';
|
||||
export 'src/listener/user_listener.dart';
|
||||
export 'src/listener/upload_file_listener.dart';
|
||||
export 'src/listener/user_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_signaling_manager.dart';
|
||||
export 'src/manager/im_user_manager.dart';
|
||||
export 'src/models/conversation_info.dart';
|
||||
export 'src/models/group_info.dart';
|
||||
export 'src/models/init_config.dart';
|
||||
export 'src/models/message.dart';
|
||||
export 'src/models/notification_info.dart';
|
||||
export 'src/models/search_info.dart';
|
||||
export 'src/models/user_info.dart';
|
||||
export 'src/openim.dart';
|
||||
export 'src/utils.dart';
|
||||
|
||||
4
lib/src/enum/allow_type.dart
Normal file
4
lib/src/enum/allow_type.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
class AllowType {
|
||||
static const allow = 0;
|
||||
static const notAllow = 1;
|
||||
}
|
||||
@@ -1,4 +1,15 @@
|
||||
/// Conversation types
|
||||
class ConversationType {
|
||||
/// Single chat
|
||||
static const single = 1;
|
||||
|
||||
/// Group (Deprecated in v3)
|
||||
@Deprecated('Use superGroup instead')
|
||||
static const group = 2;
|
||||
|
||||
/// Super group chat
|
||||
static const superGroup = 3;
|
||||
|
||||
/// Notification
|
||||
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 @@
|
||||
/// Conversation Strong Hint Content
|
||||
class GroupAtType {
|
||||
/// Cancel all hints, equivalent to calling the resetConversationGroupAtType method
|
||||
static const atNormal = 0;
|
||||
|
||||
/// @ me hint
|
||||
static const atMe = 1;
|
||||
|
||||
/// @ all hint
|
||||
static const atAll = 2;
|
||||
|
||||
/// @ all and @ me hint
|
||||
static const atAllAtMe = 3;
|
||||
|
||||
/// Group notification hint
|
||||
static const groupNotification = 4;
|
||||
}
|
||||
14
lib/src/enum/group_member_filter.dart
Normal file
14
lib/src/enum/group_member_filter.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
/// Group Member Filter
|
||||
class GroupMemberFilter {
|
||||
static const all = 0;
|
||||
|
||||
static const owner = 1;
|
||||
|
||||
static const admin = 2;
|
||||
|
||||
static const member = 3;
|
||||
|
||||
static const adminAndMember = 4;
|
||||
|
||||
static const superAndAdmin = 4;
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
/// 1 ordinary member, 2 group owners, 3 administrators
|
||||
/// 1普通成员, 2群主,3管理员
|
||||
/// Group Member Roles
|
||||
class GroupRoleLevel {
|
||||
static const member = 1;
|
||||
static const owner = 2;
|
||||
static const admin = 3;
|
||||
/// Group owner
|
||||
static const owner = 100;
|
||||
|
||||
/// Administrator
|
||||
static const admin = 60;
|
||||
|
||||
/// Regular member
|
||||
static const member = 20;
|
||||
}
|
||||
|
||||
7
lib/src/enum/group_status.dart
Normal file
7
lib/src/enum/group_status.dart
Normal file
@@ -0,0 +1,7 @@
|
||||
/// Group Status
|
||||
class GroupStatus {
|
||||
static const normal = 0;
|
||||
static const baned = 1;
|
||||
static const dismissed = 2;
|
||||
static const muted = 3;
|
||||
}
|
||||
9
lib/src/enum/group_type.dart
Normal file
9
lib/src/enum/group_type.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
/// Group Types
|
||||
class GroupType {
|
||||
/// General group (Deprecated in v3)
|
||||
@Deprecated('Use work instead')
|
||||
static const int general = 0;
|
||||
|
||||
/// Work group
|
||||
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 @@
|
||||
/// Group Join Verification Settings
|
||||
class GroupVerification {
|
||||
/// Apply and invite directly for entry
|
||||
static const int applyNeedVerificationInviteDirectly = 0;
|
||||
|
||||
/// Everyone needs verification to join, except for group owners and administrators who can invite directly
|
||||
static const int allNeedVerification = 1;
|
||||
|
||||
/// Directly join the group
|
||||
static const int directly = 2;
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
/// The current Flutter platform supports only 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 miniWeb = 6;
|
||||
static const linux = 7;
|
||||
static const androidPad = 8;
|
||||
static const ipad = 9;
|
||||
}
|
||||
|
||||
5
lib/src/enum/join_source.dart
Normal file
5
lib/src/enum/join_source.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
class JoinSource {
|
||||
static const invited = 2;
|
||||
static const search = 3;
|
||||
static const QRCode = 4;
|
||||
}
|
||||
@@ -1,11 +1,18 @@
|
||||
/// Callback Types
|
||||
class ListenerType {
|
||||
static final simpleMsgListener = 'simpleMsgListener';
|
||||
static final connectListener = 'connectListener';
|
||||
static final userListener = 'userListener';
|
||||
static final groupListener = 'groupListener';
|
||||
static final advancedMsgListener = 'advancedMsgListener';
|
||||
static final conversationListener = 'conversationListener';
|
||||
static final friendListener = 'friendListener';
|
||||
static final signalingListener = 'signalingListener';
|
||||
static final msgSendProgressListener = "msgSendProgressListener";
|
||||
static const simpleMsgListener = 'simpleMsgListener';
|
||||
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";
|
||||
static const uploadFileListener = "uploadFileListener";
|
||||
}
|
||||
|
||||
5
lib/src/enum/login_status.dart
Normal file
5
lib/src/enum/login_status.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
class LoginStatus {
|
||||
static const logout = 1;
|
||||
static const logging = 2;
|
||||
static const logged = 3;
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
/// Message Send Status
|
||||
class MessageStatus {
|
||||
/// Sending
|
||||
static const sending = 1;
|
||||
|
||||
/// Successfully sent
|
||||
static const succeeded = 2;
|
||||
|
||||
/// Send failed
|
||||
static const failed = 3;
|
||||
|
||||
/// Already deleted
|
||||
static const deleted = 4;
|
||||
}
|
||||
|
||||
@@ -1,40 +1,176 @@
|
||||
/// Message Types
|
||||
class MessageType {
|
||||
///
|
||||
/// Normal text
|
||||
static const text = 101;
|
||||
|
||||
/// Picture
|
||||
static const picture = 102;
|
||||
|
||||
/// Voice
|
||||
static const voice = 103;
|
||||
|
||||
/// Video
|
||||
static const video = 104;
|
||||
|
||||
/// File
|
||||
static const file = 105;
|
||||
static const at_text = 106;
|
||||
|
||||
/// @ Message
|
||||
static const atText = 106;
|
||||
|
||||
/// Merge
|
||||
static const merger = 107;
|
||||
// static const forward = 108;
|
||||
|
||||
/// Business Card
|
||||
static const card = 108;
|
||||
|
||||
/// Location
|
||||
static const location = 109;
|
||||
|
||||
/// Custom
|
||||
static const custom = 110;
|
||||
static const revoke = 111;
|
||||
static const has_read_receipt = 112;
|
||||
|
||||
/// Typing
|
||||
static const typing = 113;
|
||||
|
||||
/// Quote Reply
|
||||
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;
|
||||
/// Custom Emoji
|
||||
static const customFace = 115;
|
||||
|
||||
static const kick_online = 303;
|
||||
/// Group Message Has Read Receipt (Deprecated in v3)
|
||||
@Deprecated('Use GroupHasReadReceiptNotification instead')
|
||||
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;
|
||||
/// Rich Text Message
|
||||
static const advancedText = 117;
|
||||
|
||||
static const customMsgNotTriggerConversation = 119;
|
||||
|
||||
static const customMsgOnlineOnly = 120;
|
||||
|
||||
/// Notification Types
|
||||
static const notificationBegin = 1000;
|
||||
|
||||
static const friendNotificationBegin = 1200;
|
||||
|
||||
/// Friend Request Accepted
|
||||
static const friendApplicationApprovedNotification = 1201;
|
||||
|
||||
/// Friend Request Rejected
|
||||
static const friendApplicationRejectedNotification = 1202;
|
||||
|
||||
/// Friend Request
|
||||
static const friendApplicationNotification = 1203;
|
||||
|
||||
/// Friend Added
|
||||
static const friendAddedNotification = 1204;
|
||||
|
||||
/// Friend Deleted
|
||||
static const friendDeletedNotification = 1205;
|
||||
|
||||
/// Set Friend Remark
|
||||
static const friendRemarkSetNotification = 1206;
|
||||
|
||||
/// Friend Added to Blacklist
|
||||
static const blackAddedNotification = 1207;
|
||||
|
||||
/// Removed from Blacklist
|
||||
static const blackDeletedNotification = 1208;
|
||||
|
||||
static const friendNotificationEnd = 1299;
|
||||
|
||||
/// Conversation Change
|
||||
static const conversationChangeNotification = 1300;
|
||||
|
||||
static const userNotificationBegin = 1301;
|
||||
|
||||
/// User Information Changed
|
||||
static const userInfoUpdatedNotification = 1303;
|
||||
|
||||
static const userNotificationEnd = 1399;
|
||||
|
||||
/// OA Notification
|
||||
static const oaNotification = 1400;
|
||||
|
||||
static const groupNotificationBegin = 1500;
|
||||
|
||||
/// Group Created
|
||||
static const groupCreatedNotification = 1501;
|
||||
|
||||
/// Group Info Set
|
||||
static const groupInfoSetNotification = 1502;
|
||||
|
||||
/// Join Group Application
|
||||
static const joinGroupApplicationNotification = 1503;
|
||||
|
||||
/// Group Member Quit
|
||||
static const memberQuitNotification = 1504;
|
||||
|
||||
/// Group Application Accepted
|
||||
static const groupApplicationAcceptedNotification = 1505;
|
||||
|
||||
/// Group Application Rejected
|
||||
static const groupApplicationRejectedNotification = 1506;
|
||||
|
||||
/// Group Owner Transferred
|
||||
static const groupOwnerTransferredNotification = 1507;
|
||||
|
||||
/// Member Kicked from Group
|
||||
static const memberKickedNotification = 1508;
|
||||
|
||||
/// Member Invited to Group
|
||||
static const memberInvitedNotification = 1509;
|
||||
|
||||
/// Member Entered Group
|
||||
static const memberEnterNotification = 1510;
|
||||
|
||||
/// Dismiss Group
|
||||
static const dismissGroupNotification = 1511;
|
||||
|
||||
static const groupNotificationEnd = 1599;
|
||||
|
||||
/// Group Member Muted
|
||||
static const groupMemberMutedNotification = 1512;
|
||||
|
||||
/// Group Member Cancel Muted
|
||||
static const groupMemberCancelMutedNotification = 1513;
|
||||
|
||||
/// Group Muted
|
||||
static const groupMutedNotification = 1514;
|
||||
|
||||
/// Cancel Group Muted
|
||||
static const groupCancelMutedNotification = 1515;
|
||||
|
||||
/// Group Member Information Changed
|
||||
static const groupMemberInfoChangedNotification = 1516;
|
||||
|
||||
/// Group Member Set to Admin
|
||||
static const groupMemberSetToAdminNotification = 1517;
|
||||
|
||||
static const groupMemberSetToOrdinaryUserNotification = 1518;
|
||||
|
||||
/// Group Notice Changed
|
||||
static const groupInfoSetAnnouncementNotification = 1519;
|
||||
|
||||
/// Group Name Changed
|
||||
static const groupInfoSetNameNotification = 1520;
|
||||
|
||||
/// Burn After Reading
|
||||
static const burnAfterReadingNotification = 1701;
|
||||
|
||||
static const notificationEnd = 2000;
|
||||
|
||||
/// Business Notification
|
||||
static const businessNotification = 2001;
|
||||
|
||||
/// Recall Message
|
||||
static const revokeMessageNotification = 2101;
|
||||
|
||||
/// Single Chat Has Read Receipt
|
||||
static const signalHasReadReceiptNotification = 2150;
|
||||
|
||||
/// Group Chat Has Read Receipt
|
||||
static const groupHasReadReceiptNotification = 2155;
|
||||
}
|
||||
|
||||
5
lib/src/enum/receive_message_opt.dart
Normal file
5
lib/src/enum/receive_message_opt.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
class ReceiveMessageOpt {
|
||||
static const receive = 0;
|
||||
static const notReceive = 1;
|
||||
static const notNotify = 2;
|
||||
}
|
||||
4
lib/src/enum/relationship.dart
Normal file
4
lib/src/enum/relationship.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
class AllowType {
|
||||
static const black = 0;
|
||||
static const friend = 1;
|
||||
}
|
||||
155
lib/src/enum/sdk_error_code.dart
Normal file
155
lib/src/enum/sdk_error_code.dart
Normal file
@@ -0,0 +1,155 @@
|
||||
/// SDK Error Codes
|
||||
class SDKErrorCode {
|
||||
/// Network Request Error
|
||||
static const int networkRequestError = 10000;
|
||||
|
||||
/// Network Waiting Timeout Error
|
||||
static const int networkWaitTimeoutError = 10001;
|
||||
|
||||
/// Parameter Error
|
||||
static const int parameterError = 10002;
|
||||
|
||||
/// Context Timeout Error, usually when the user has already logged out
|
||||
static const int contextTimeoutError = 10003;
|
||||
|
||||
/// Resources not loaded completely, usually uninitialized or login hasn't completed
|
||||
static const int resourceNotLoaded = 10004;
|
||||
|
||||
/// Unknown Error, check the error message for details
|
||||
static const int unknownError = 10005;
|
||||
|
||||
/// SDK Internal Error, check the error message for details
|
||||
static const int sdkInternalError = 10006;
|
||||
|
||||
/// This user has set not to be added
|
||||
static const int refuseToAddFriends = 10013;
|
||||
|
||||
/// User does not exist or is not registered
|
||||
static const int userNotExistOrNotRegistered = 10100;
|
||||
|
||||
/// User has already logged out
|
||||
static const int userHasLoggedOut = 10101;
|
||||
|
||||
/// User is attempting to log in again, check the login status to avoid duplicate logins
|
||||
static const int repeatLogin = 10102;
|
||||
|
||||
/// The file to upload does not exist
|
||||
static const int uploadFileNotExist = 10200;
|
||||
|
||||
/// Message decompression failed
|
||||
static const int messageDecompressionFailed = 10201;
|
||||
|
||||
/// Message decoding failed
|
||||
static const int messageDecodingFailed = 10202;
|
||||
|
||||
/// Unsupported long connection binary protocol
|
||||
static const int unsupportedLongConnection = 10203;
|
||||
|
||||
/// Message sent multiple times
|
||||
static const int messageRepeated = 10204;
|
||||
|
||||
/// Message content type not supported
|
||||
static const int messageContentTypeNotSupported = 10205;
|
||||
|
||||
/// Unsupported session operation
|
||||
static const int unsupportedSessionOperation = 10301;
|
||||
|
||||
/// Group ID does not exist
|
||||
static const int groupIDNotExist = 10400;
|
||||
|
||||
/// Group type is incorrect
|
||||
static const int wrongGroupType = 10401;
|
||||
|
||||
/// Server Internal Error, usually an internal network error, check if server nodes are running correctly
|
||||
static const int serverInternalError = 500;
|
||||
|
||||
/// Parameter Error on the server, check if body and header parameters are correct
|
||||
static const int serverParameterError = 1001;
|
||||
|
||||
/// Insufficient Permissions, typically when the token in the header is incorrect or when trying to perform unauthorized actions
|
||||
static const int insufficientPermissions = 1002;
|
||||
|
||||
/// Duplicate Database Primary Key
|
||||
static const int duplicateDatabasePrimaryKey = 1003;
|
||||
|
||||
/// Database Record Not Found
|
||||
static const int databaseRecordNotFound = 1004;
|
||||
|
||||
/// User ID does not exist
|
||||
static const int userIDNotExist = 1101;
|
||||
|
||||
/// User is already registered
|
||||
static const int userAlreadyRegistered = 1102;
|
||||
|
||||
/// Group does not exist
|
||||
static const int groupNotExis = 1201;
|
||||
|
||||
/// Group already exists
|
||||
static const int groupAlreadyExists = 1202;
|
||||
|
||||
/// User is not in the group
|
||||
static const int userIsNotInGroup = 1203;
|
||||
|
||||
/// Group has been disbanded
|
||||
static const int groupDisbanded = 1204;
|
||||
|
||||
/// Group application has already been processed, no need to process it again
|
||||
static const int groupApplicationHasBeenProcessed = 1206;
|
||||
|
||||
/// Cannot add yourself as a friend
|
||||
static const int notAddMyselfAsAFriend = 1301;
|
||||
|
||||
/// You have been blocked by the other party
|
||||
static const int hasBeenBlocked = 1302;
|
||||
|
||||
/// The other party is not your friend
|
||||
static const int notFriend = 1303;
|
||||
|
||||
/// Already in a friend relationship, no need to reapply
|
||||
static const int alreadyAFriendRelationship = 1304;
|
||||
|
||||
/// Message read function is turned off
|
||||
static const int messageReadFunctionIsTurnedOff = 1401;
|
||||
|
||||
/// You have been banned from speaking in the group
|
||||
static const int youHaveBeenBanned = 1402;
|
||||
|
||||
/// The group has been banned from posting
|
||||
static const int groupHasBeenBanned = 1403;
|
||||
|
||||
/// This message has been retracted
|
||||
static const int messageHasBeenRetracted = 1404;
|
||||
|
||||
/// Authorization has expired
|
||||
static const int licenseExpired = 1405;
|
||||
|
||||
/// Token has expired
|
||||
static const int tokenHasExpired = 1501;
|
||||
|
||||
/// Invalid token
|
||||
static const int tokenInvalid = 1502;
|
||||
|
||||
/// Token format error
|
||||
static const int tokenFormatError = 1503;
|
||||
|
||||
/// Token has not yet taken effect
|
||||
static const int tokenHasNotYetTakenEffect = 1504;
|
||||
|
||||
/// Unknown token error
|
||||
static const int unknownTokenError = 1505;
|
||||
|
||||
/// The kicked-out token is invalid
|
||||
static const int thekickedOutTokenIsInvalid = 1506;
|
||||
|
||||
/// Token does not exist
|
||||
static const int tokenNotExist = 1507;
|
||||
|
||||
/// Number of Connections Exceeds Gateway's Maximum Limit
|
||||
static const int connectionsExceedsMaximumLimit = 1601;
|
||||
|
||||
/// Handshake Parameter Error
|
||||
static const int handshakeParameterError = 1602;
|
||||
|
||||
/// File Upload Expired
|
||||
static const int fileUploadExpired = 1701;
|
||||
}
|
||||
@@ -1,33 +1,59 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// Message Listener
|
||||
class OnAdvancedMsgListener {
|
||||
/// Message read receipt
|
||||
Function(Message msg)? onMsgDeleted;
|
||||
Function(RevokedInfo info)? onNewRecvMessageRevoked;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
||||
|
||||
/// A friend revoked a message
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
|
||||
/// Receive new message
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
|
||||
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(Message msg)? onRecvOfflineNewMessage;
|
||||
|
||||
/// Uniquely identifies
|
||||
String id;
|
||||
|
||||
OnAdvancedMsgListener({
|
||||
this.onMsgDeleted,
|
||||
this.onNewRecvMessageRevoked,
|
||||
this.onRecvC2CReadReceipt,
|
||||
this.onRecvMessageRevoked,
|
||||
this.onRecvGroupReadReceipt,
|
||||
this.onRecvMessageExtensionsDeleted,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvOfflineNewMessage,
|
||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
|
||||
void msgDeleted(Message msg) {
|
||||
onMsgDeleted?.call(msg);
|
||||
}
|
||||
|
||||
/// Message has been retracted
|
||||
void newRecvMessageRevoked(RevokedInfo info) {
|
||||
onNewRecvMessageRevoked?.call(info);
|
||||
}
|
||||
|
||||
/// C2C Message Read Receipt
|
||||
void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
|
||||
if (null != onRecvC2CReadReceipt) onRecvC2CReadReceipt!(list);
|
||||
onRecvC2CReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
void recvMessageRevoked(String msgId) {
|
||||
if (null != onRecvMessageRevoked) onRecvMessageRevoked!(msgId);
|
||||
/// Group Message Read Receipt
|
||||
void recvGroupReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// Received Extended Message Deleted
|
||||
/// [list] TypeKey that was deleted
|
||||
void recvMessageExtensionsDeleted(String msgID, List<String> list) {
|
||||
onRecvMessageExtensionsDeleted?.call(msgID, list);
|
||||
}
|
||||
|
||||
/// Received a new message
|
||||
void recvNewMessage(Message msg) {
|
||||
if (null != onRecvNewMessage) onRecvNewMessage!(msg);
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
|
||||
void recvOfflineNewMessage(Message msg) {
|
||||
onRecvOfflineNewMessage?.call(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,41 @@
|
||||
/// SDK Connection State Listener
|
||||
class OnConnectListener {
|
||||
/// SDK failed to connect to the server
|
||||
Function(int? code, String? errorMsg)? onConnectFailed;
|
||||
|
||||
/// SDK has successfully connected to the server
|
||||
Function()? onConnectSuccess;
|
||||
|
||||
/// SDK is connecting to the server
|
||||
Function()? onConnecting;
|
||||
|
||||
/// The current user is kicked offline.
|
||||
/// At this time, the UI can prompt the user and call IMManager's login() function to log in again.
|
||||
Function()? onKickedOffline;
|
||||
|
||||
/// Ticket expired when online.
|
||||
/// At this time, you need to generate a new userSig and call IMManager's login() function to log in again
|
||||
Function()? onUserSigExpired;
|
||||
Function()? onUserTokenExpired;
|
||||
|
||||
OnConnectListener({
|
||||
this.onConnectFailed,
|
||||
this.onConnectSuccess,
|
||||
this.onConnecting,
|
||||
this.onKickedOffline,
|
||||
this.onUserSigExpired,
|
||||
this.onUserTokenExpired,
|
||||
});
|
||||
|
||||
/// SDK failed to connect to the server
|
||||
void connectFailed(int? code, String? errorMsg) {
|
||||
if (null != onConnectFailed) onConnectFailed!(code, errorMsg);
|
||||
onConnectFailed?.call(code, errorMsg);
|
||||
}
|
||||
|
||||
/// SDK successfully connected to the server
|
||||
void connectSuccess() {
|
||||
if (null != onConnectSuccess) onConnectSuccess!();
|
||||
onConnectSuccess?.call();
|
||||
}
|
||||
|
||||
/// SDK is currently connecting to the server
|
||||
void connecting() {
|
||||
if (null != onConnecting) onConnecting!.call();
|
||||
onConnecting?.call();
|
||||
}
|
||||
|
||||
/// The account has been logged in from another location, and the current device has been kicked offline
|
||||
void kickedOffline() {
|
||||
if (null != onKickedOffline) onKickedOffline!();
|
||||
onKickedOffline?.call();
|
||||
}
|
||||
|
||||
void userSigExpired() {
|
||||
if (null != onUserSigExpired) onUserSigExpired!();
|
||||
/// Login credentials have expired and require reauthentication
|
||||
void userTokenExpired() {
|
||||
onUserTokenExpired?.call();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// Conversation Listener
|
||||
class OnConversationListener {
|
||||
Function(List<ConversationInfo> list)? onConversationChanged;
|
||||
Function(List<ConversationInfo> list)? onNewConversation;
|
||||
@@ -17,28 +18,30 @@ class OnConversationListener {
|
||||
this.onSyncServerStart,
|
||||
});
|
||||
|
||||
/// Conversations have changed
|
||||
void conversationChanged(List<ConversationInfo> list) {
|
||||
if (onConversationChanged != null) onConversationChanged!(list);
|
||||
onConversationChanged?.call(list);
|
||||
}
|
||||
|
||||
/// New conversations have been created
|
||||
void newConversation(List<ConversationInfo> list) {
|
||||
if (onNewConversation != null) onNewConversation!(list);
|
||||
onNewConversation?.call(list);
|
||||
}
|
||||
|
||||
/// Total unread message count has changed
|
||||
void totalUnreadMessageCountChanged(int count) {
|
||||
onTotalUnreadMessageCountChanged?.call(count);
|
||||
}
|
||||
|
||||
void syncServerFailed() {
|
||||
if (onSyncServerFailed != null) onSyncServerFailed!();
|
||||
onSyncServerFailed?.call();
|
||||
}
|
||||
|
||||
void syncServerFinish() {
|
||||
if (onSyncServerFinish != null) onSyncServerFinish!();
|
||||
onSyncServerFinish?.call();
|
||||
}
|
||||
|
||||
void syncServerStart() {
|
||||
if (onSyncServerStart != null) onSyncServerStart!();
|
||||
}
|
||||
|
||||
void totalUnreadMessageCountChanged(int i) {
|
||||
if (onTotalUnreadMessageCountChanged != null)
|
||||
onTotalUnreadMessageCountChanged!(i);
|
||||
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,19 +1,20 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// Friendship Listener
|
||||
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;
|
||||
Function(BlacklistInfo info)? onBlackAdded;
|
||||
Function(BlacklistInfo info)? onBlackDeleted;
|
||||
Function(FriendInfo info)? onFriendAdded;
|
||||
Function(FriendApplicationInfo info)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo info)? onFriendApplicationAdded;
|
||||
Function(FriendApplicationInfo info)? onFriendApplicationDeleted;
|
||||
Function(FriendApplicationInfo info)? onFriendApplicationRejected;
|
||||
Function(FriendInfo info)? onFriendDeleted;
|
||||
Function(FriendInfo info)? onFriendInfoChanged;
|
||||
|
||||
OnFriendshipListener({
|
||||
this.onBlacklistAdded,
|
||||
this.onBlacklistDeleted,
|
||||
this.onBlackAdded,
|
||||
this.onBlackDeleted,
|
||||
this.onFriendAdded,
|
||||
this.onFriendApplicationAccepted,
|
||||
this.onFriendApplicationAdded,
|
||||
@@ -23,39 +24,48 @@ class OnFriendshipListener {
|
||||
this.onFriendInfoChanged,
|
||||
});
|
||||
|
||||
void blacklistAdded(BlacklistInfo u) {
|
||||
onBlacklistAdded?.call(u);
|
||||
/// Added to the blacklist
|
||||
void blackAdded(BlacklistInfo info) {
|
||||
onBlackAdded?.call(info);
|
||||
}
|
||||
|
||||
void blacklistDeleted(BlacklistInfo u) {
|
||||
onBlacklistDeleted?.call(u);
|
||||
/// Removed from the blacklist
|
||||
void blackDeleted(BlacklistInfo info) {
|
||||
onBlackDeleted?.call(info);
|
||||
}
|
||||
|
||||
void friendAdded(FriendInfo u) {
|
||||
onFriendAdded?.call(u);
|
||||
/// Friend added
|
||||
void friendAdded(FriendInfo info) {
|
||||
onFriendAdded?.call(info);
|
||||
}
|
||||
|
||||
void friendApplicationAccepted(FriendApplicationInfo u) {
|
||||
onFriendApplicationAccepted?.call(u);
|
||||
/// Friend application accepted
|
||||
void friendApplicationAccepted(FriendApplicationInfo info) {
|
||||
onFriendApplicationAccepted?.call(info);
|
||||
}
|
||||
|
||||
void friendApplicationAdded(FriendApplicationInfo u) {
|
||||
onFriendApplicationAdded?.call(u);
|
||||
/// New friend application added
|
||||
void friendApplicationAdded(FriendApplicationInfo info) {
|
||||
onFriendApplicationAdded?.call(info);
|
||||
}
|
||||
|
||||
void friendApplicationDeleted(FriendApplicationInfo u) {
|
||||
onFriendApplicationDeleted?.call(u);
|
||||
/// Friend application deleted
|
||||
void friendApplicationDeleted(FriendApplicationInfo info) {
|
||||
onFriendApplicationDeleted?.call(info);
|
||||
}
|
||||
|
||||
void friendApplicationRejected(FriendApplicationInfo u) {
|
||||
onFriendApplicationRejected?.call(u);
|
||||
/// Friend application rejected
|
||||
void friendApplicationRejected(FriendApplicationInfo info) {
|
||||
onFriendApplicationRejected?.call(info);
|
||||
}
|
||||
|
||||
void friendDeleted(FriendInfo u) {
|
||||
onFriendDeleted?.call(u);
|
||||
/// Friend deleted
|
||||
void friendDeleted(FriendInfo info) {
|
||||
onFriendDeleted?.call(info);
|
||||
}
|
||||
|
||||
void friendInfoChanged(FriendInfo u) {
|
||||
onFriendInfoChanged?.call(u);
|
||||
/// Friend information changed
|
||||
void friendInfoChanged(FriendInfo info) {
|
||||
onFriendInfoChanged?.call(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// Group Listener
|
||||
class OnGroupListener {
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationDeleted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationRejected;
|
||||
Function(GroupInfo info)? onGroupDismissed;
|
||||
Function(GroupInfo info)? onGroupInfoChanged;
|
||||
Function(GroupMembersInfo info)? onGroupMemberAdded;
|
||||
Function(GroupMembersInfo info)? onGroupMemberDeleted;
|
||||
@@ -17,6 +19,7 @@ class OnGroupListener {
|
||||
this.onGroupApplicationAdded,
|
||||
this.onGroupApplicationDeleted,
|
||||
this.onGroupApplicationRejected,
|
||||
this.onGroupDismissed,
|
||||
this.onGroupInfoChanged,
|
||||
this.onGroupMemberAdded,
|
||||
this.onGroupMemberDeleted,
|
||||
@@ -25,42 +28,56 @@ class OnGroupListener {
|
||||
this.onJoinedGroupDeleted,
|
||||
});
|
||||
|
||||
/// Group application accepted
|
||||
void groupApplicationAccepted(GroupApplicationInfo info) {
|
||||
onGroupApplicationAccepted?.call(info);
|
||||
}
|
||||
|
||||
/// Group application added
|
||||
void groupApplicationAdded(GroupApplicationInfo info) {
|
||||
onGroupApplicationAdded?.call(info);
|
||||
}
|
||||
|
||||
/// Group application deleted
|
||||
void groupApplicationDeleted(GroupApplicationInfo info) {
|
||||
onGroupApplicationDeleted?.call(info);
|
||||
}
|
||||
|
||||
/// Group application rejected
|
||||
void groupApplicationRejected(GroupApplicationInfo info) {
|
||||
onGroupApplicationRejected?.call(info);
|
||||
}
|
||||
|
||||
void groupDismissed(GroupInfo info) {
|
||||
onGroupDismissed?.call(info);
|
||||
}
|
||||
|
||||
/// Group information changed
|
||||
void groupInfoChanged(GroupInfo info) {
|
||||
onGroupInfoChanged?.call(info);
|
||||
}
|
||||
|
||||
/// Group member added
|
||||
void groupMemberAdded(GroupMembersInfo info) {
|
||||
onGroupMemberAdded?.call(info);
|
||||
}
|
||||
|
||||
/// Group member deleted
|
||||
void groupMemberDeleted(GroupMembersInfo info) {
|
||||
onGroupMemberDeleted?.call(info);
|
||||
}
|
||||
|
||||
/// Group member information changed
|
||||
void groupMemberInfoChanged(GroupMembersInfo info) {
|
||||
onGroupMemberInfoChanged?.call(info);
|
||||
}
|
||||
|
||||
/// Joined group added
|
||||
void joinedGroupAdded(GroupInfo info) {
|
||||
onJoinedGroupAdded?.call(info);
|
||||
}
|
||||
|
||||
/// Joined group deleted
|
||||
void joinedGroupDeleted(GroupInfo info) {
|
||||
onJoinedGroupDeleted?.call(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';
|
||||
|
||||
/// Friend Relationship Listener
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
/// Message Sending Progress Listener
|
||||
class OnMsgSendProgressListener {
|
||||
Function(String clientMsgID, int progress)? onProgress;
|
||||
|
||||
OnMsgSendProgressListener({this.onProgress});
|
||||
|
||||
/// Message sending progress
|
||||
void progress(String clientMsgID, int progress) {
|
||||
if (null != onProgress) onProgress!(clientMsgID, progress);
|
||||
onProgress?.call(clientMsgID, progress);
|
||||
}
|
||||
}
|
||||
|
||||
45
lib/src/listener/upload_file_listener.dart
Normal file
45
lib/src/listener/upload_file_listener.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
class OnUploadFileListener {
|
||||
Function(String id, int size, String url, int type)? onComplete;
|
||||
Function(String id, String partHash, String fileHash)? onHashPartComplete;
|
||||
Function(String id, int index, int size, String partHash)? onHashPartProgress;
|
||||
Function(String id, int size)? onOpen;
|
||||
Function(String id, int partSize, int num)? onPartSize;
|
||||
Function(String id, int fileSize, int streamSize, int storageSize)?
|
||||
onUploadProgress;
|
||||
Function(String id, String uploadID)? onUploadID;
|
||||
Function(String id, int index, int partSize, String partHash)?
|
||||
onUploadPartComplete;
|
||||
|
||||
void complete(String id, int size, String url, int type) {
|
||||
onComplete?.call(id, size, url, type);
|
||||
}
|
||||
|
||||
void hashPartComplete(String id, String partHash, String fileHash) {
|
||||
onHashPartComplete?.call(id, partHash, fileHash);
|
||||
}
|
||||
|
||||
void hashPartProgress(String id, int index, int size, String partHash) {
|
||||
onHashPartProgress?.call(id, index, size, partHash);
|
||||
}
|
||||
|
||||
void open(String id, int size) {
|
||||
onOpen?.call(id, size);
|
||||
}
|
||||
|
||||
void partSize(String id, int partSize, int num) {
|
||||
onPartSize?.call(id, partSize, num);
|
||||
}
|
||||
|
||||
void uploadProgress(
|
||||
String id, int fileSize, int streamSize, int storageSize) {
|
||||
onUploadProgress?.call(id, fileSize, streamSize, storageSize);
|
||||
}
|
||||
|
||||
void uploadID(String id, String uploadID) {
|
||||
onUploadID?.call(id, uploadID);
|
||||
}
|
||||
|
||||
void uploadPartComplete(String id, int index, int partSize, String partHash) {
|
||||
onUploadPartComplete?.call(id, index, partSize, partHash);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user