Compare commits

...

55 Commits

Author SHA1 Message Date
hrxiang
39727feb8a Fix bug 2023-03-08 15:52:16 +08:00
hrxiang
c6d1669bdd 添加aar包本地依赖方式说明 2023-03-06 18:37:39 +08:00
hrxiang
02202051e1 添加aar包本地依赖方式说明 2023-03-06 18:36:38 +08:00
hrxiang
d0a4530314 New add 2023-03-03 15:17:40 +08:00
hrxiang
958c118e84 Fix bug for signaling 2023-03-01 11:44:14 +08:00
hrxiang
cdef7ffda8 Fix bug callback 'onUserTokenExpired' 2023-02-20 16:34:38 +08:00
hrxiang
bac4bd0884 Fix bug 2023-02-20 15:29:57 +08:00
hrxiang
377b07ef05 Fix bug 2023-02-20 09:33:08 +08:00
hrxiang
025487fbf3 Fix bug 2023-02-09 14:31:25 +08:00
hrxiang
ba3767da42 Fix bug 2023-02-08 09:53:39 +08:00
hrxiang
fc6fd3dd93 Fix bug 2023-02-08 09:45:53 +08:00
hrxiang
c6d9815e64 Fix bug 2023-01-18 10:48:52 +08:00
hrxiang
8e0c736d29 Merge pull request #105 from johnzerTang/main
feat:补充conversation_info的遗漏
2023-01-16 09:35:35 +08:00
johnzer
15854a2c27 feat:补充conversation_info的遗漏 2023-01-09 16:27:48 +08:00
hrxiang
3e1ee249c9 Fix bug 2023-01-03 16:25:08 +08:00
hrxiang
29eac1bf91 Fix bug 2022-12-30 18:58:57 +08:00
skiffer-git
bea820ff27 Update README.md 2022-12-14 10:36:02 +08:00
hrxiang
a85062ce79 Fix bug 2022-12-12 10:51:20 +08:00
hrxiang
98b2774dc1 Fix bug 2022-12-09 16:45:25 +08:00
hrxiang
e823df62a8 Fix bug 2022-12-09 15:08:27 +08:00
hrxiang
2c40b626e4 Fix bug 2022-12-09 11:25:44 +08:00
hrxiang
3b5f47c9f0 V2.3.5 2022-12-08 12:05:21 +08:00
hrxiang
4c540fbff5 Update 2022-12-02 10:50:48 +08:00
hrxiang
b8a51374a3 Update 2022-11-25 17:03:50 +08:00
hrxiang
099cb9849a Merge branch 'main' of https://github.com/OpenIMSDK/Open-IM-SDK-Flutter 2022-11-16 16:46:35 +08:00
hrxiang
025334d32f Fix bug 2022-11-16 16:45:12 +08:00
hrxiang
5adc50b963 Merge pull request #102 from yohom/main
fix: 所有的设置Listener方法都调用result.success(null), 否则dart端的Future会一直挂起不返回.
2022-11-16 16:42:41 +08:00
yohom
ebbe5c882f fix: 所有的设置Listener方法都调用result.success(null), 否则dart端的Future会一直挂起不返回. 2022-11-16 16:28:48 +08:00
hrxiang
eb3361c4b3 Fix bug 2022-11-14 14:28:33 +08:00
hrxiang
9c5aa56609 Fix bug 2022-11-11 14:22:17 +08:00
hrxiang
3e03460300 Fix bug 2022-11-08 12:04:09 +08:00
hrxiang
788ab524c2 Fix bug 2022-11-08 11:22:44 +08:00
hrxiang
eed59f468c Fix bug 2022-11-07 10:32:05 +08:00
hrxiang
d758f3fca1 Fix bug 2022-10-31 10:27:54 +08:00
hrxiang
b8ee9276a2 Add some new function 2022-10-25 11:45:30 +08:00
hrxiang
a77c86e87a Fix bug 2022-10-09 13:55:47 +08:00
hrxiang
c99d1e4d67 Fix bug 2022-10-09 13:54:26 +08:00
hrxiang
b53d4dfcfd Fix bug 2022-10-08 18:53:29 +08:00
hrxiang
bb49d6b27a Core sdk upgrade to 2.3.4 2022-09-30 17:29:22 +08:00
hrxiang
2b78f83b20 Core sdk upgrade to 2.3.4 2022-09-30 17:28:30 +08:00
hrxiang
38a899d32c Core sdk upgrade to 2.3.3 2022-09-20 11:04:58 +08:00
hrxiang
0a0635bb71 2.3.2 2022-09-16 09:37:21 +08:00
xianghr
c44575ec0e Merge branch 'main' of https://github.com/OpenIMSDK/Open-IM-SDK-Flutter 2022-09-09 18:46:27 +08:00
std-s
14624c717b [Update] 2022-09-09 18:44:28 +08:00
xianghr
0900df2aa2 3.2.2 2022-09-09 18:31:06 +08:00
xianghr
cd06c3bb5a 3.2.2 2022-09-09 17:17:31 +08:00
hrxiang
a6aea5496a [Super Group]2.3.0 2022-08-24 11:46:15 +08:00
hrxiang
72111053bd [Super Group]2.3.0 2022-08-03 17:30:40 +08:00
hrxiang
18f099c437 [Super Group] 2022-07-22 12:12:55 +08:00
hrxiang
cff0a4cce2 [Super Group] 2022-07-18 10:13:04 +08:00
hrxiang
e415961d64 [Super Group] 2022-07-15 18:35:48 +08:00
hrxiang
b3aebeb318 [Super Group] 2022-07-15 18:34:21 +08:00
hrxiang
c76bfeb07a [Super Group] 2022-07-15 18:19:17 +08:00
hrxiang
a9343bf892 update 2022-07-05 10:25:59 +08:00
hrxiang
bf354c4103 update 2022-07-04 11:56:02 +08:00
66 changed files with 2811 additions and 208 deletions

View File

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

View File

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

View File

@@ -1,3 +1,138 @@
## 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>
@@ -155,33 +290,42 @@ Fix bug
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
@@ -190,11 +334,14 @@ Fix message error bug
Replace the input parameters of the createCustomMessage method from Uint8List to Map
## 0.0.3
Upgrade sdk </br>
Fix bug </br>
## 0.0.2
1. Move the markSingleMessageHasRead, markGroupMessageHasRead and getTotalUnreadMsgCount methods from the MessageManager class to the ConversationManager class. </br>
1. Move the markSingleMessageHasRead, markGroupMessageHasRead and getTotalUnreadMsgCount methods
from the MessageManager class to the ConversationManager class. </br>
2. Modify the parameters of the setFriendInfo method. </br>
3. Modify the parameters of the createGroup and setGroupInfo methods.

View File

@@ -1,4 +1,5 @@
# flutter_openim_sdk
![avatar](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg)
[![pub package](https://img.shields.io/pub/v/flutter_openim_sdk.svg)](https://pub.flutter-io.cn/packages/flutter_openim_sdk)
[![Generic badge](https://img.shields.io/badge/platform-android%20|%20ios%20-blue.svg)](https://pub.dev/packages/flutter_openim_sdk)
[![GitHub license](https://img.shields.io/github/license/OpenIMSDK/Open-IM-SDK-Flutter)](https://github.com/OpenIMSDK/Open-IM-SDK-Flutter/blob/main/LICENSE)

View File

@@ -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 {
url 'http://121.37.25.71:8081/repository/maven2/'
allowInsecureProtocol = true
}
google()
mavenCentral()
}
@@ -18,10 +27,9 @@ buildscript {
rootProject.allprojects {
repositories {
maven {
url 'http://121.37.25.71:8081/repository/maven2/'
allowInsecureProtocol = true
}
// 将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:core-sdk:2.1.0.2@aar'
// 本地依赖现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下命名core-sdk-0.0.1.aar
// implementation 'io.openim:core-sdk:0.0.1@aar'
api 'io.openim:core-sdk:2.3.5-t34@aar'
}

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

View File

@@ -13,6 +13,14 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
this.id = listenerId;
}
@Override
public void onNewRecvMessageRevoked(String s) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("revokedMessageV2", s);
CommonUtil.emitEvent("advancedMsgListener", "onNewRecvMessageRevoked", values);
}
@Override
public void onRecvC2CReadReceipt(String s) {
final Map<String, String> values = new ArrayMap<>();
@@ -29,6 +37,33 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
CommonUtil.emitEvent("advancedMsgListener", "onRecvGroupReadReceipt", values);
}
@Override
public void onRecvMessageExtensionsAdded(String s, String s1) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("msgID", s);
values.put("list", s1);
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsAdded", values);
}
@Override
public void onRecvMessageExtensionsChanged(String s, String s1) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("msgID", s);
values.put("list", s1);
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsChanged", values);
}
@Override
public void onRecvMessageExtensionsDeleted(String s, String s1) {
final Map<String, String> values = new ArrayMap<>();
values.put("id", id);
values.put("msgID", s);
values.put("list", s1);
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsDeleted", values);
}
@Override
public void onRecvMessageRevoked(String s) {
final Map<String, String> values = new ArrayMap<>();

View File

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

View File

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

View File

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

View File

@@ -34,11 +34,31 @@ public class OnSignalingListener implements open_im_sdk_callback.OnSignalingList
CommonUtil.emitEvent("signalingListener", "onInviteeRejectedByOtherDevice", s);
}
@Override
public void onReceiveCustomSignal(String s) {
CommonUtil.emitEvent("signalingListener", "onReceiveCustomSignal", s);
}
@Override
public void onReceiveNewInvitation(String s) {
CommonUtil.emitEvent("signalingListener", "onReceiveNewInvitation", s);
}
@Override
public void onRoomParticipantConnected(String s) {
CommonUtil.emitEvent("signalingListener", "onRoomParticipantConnected", s);
}
@Override
public void onRoomParticipantDisconnected(String s) {
CommonUtil.emitEvent("signalingListener", "onRoomParticipantDisconnected", s);
}
@Override
public void onStreamChange(String s) {
CommonUtil.emitEvent("signalingListener", "onStreamChange", s);
}
@Override
public void onHangUp(String s) {
CommonUtil.emitEvent("signalingListener", "onHangUp", s);

View File

@@ -11,6 +11,8 @@ public class ConversationManager extends BaseManager {
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationListener(new OnConversationListener());
result.success(null);
}
@@ -162,4 +164,13 @@ public class ConversationManager extends BaseManager {
int2long(methodCall, "status")
);
}
public void setOneConversationBurnDuration(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setOneConversationBurnDuration(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "burnDuration")
);
}
}

View File

@@ -11,6 +11,8 @@ 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) {

View File

@@ -10,6 +10,8 @@ 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) {
@@ -91,7 +93,8 @@ public class GroupManager extends BaseManager {
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason")
value(methodCall, "reason"),
value(methodCall, "joinSource")
);
}
@@ -219,4 +222,41 @@ public class GroupManager extends BaseManager {
value(methodCall, "needVerification")
);
}
public void setGroupLookMemberInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupLookMemberInfo(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "status")
);
}
public void setGroupApplyMemberFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupApplyMemberFriend(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "status")
);
}
public void getGroupMemberOwnerAndAdmin(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMemberOwnerAndAdmin(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID")
);
}
public void searchGroupMembers(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchGroupMembers(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParam")
);
}
public void setGroupMemberInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupMemberInfo(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info")
);
}
}

View File

@@ -4,6 +4,7 @@ import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnConnListener;
import io.openim.flutter_openim_sdk.listener.OnListenerForService;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk;
@@ -53,4 +54,35 @@ public class IMManager extends BaseManager {
value(methodCall, "obj")
);
}
public void updateFcmToken(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.updateFcmToken(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "fcmToken")
);
}
public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setAppBackgroundStatus(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "isBackground")
);
}
public void networkChanged(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.networkChanged(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID")
);
}
public void setListenerForService(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setListenerForService(new OnListenerForService());
result.success(null);
}
}

View File

@@ -4,6 +4,8 @@ import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnCustomBusinessListener;
import io.openim.flutter_openim_sdk.listener.OnMessageKvInfoListener;
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk;
@@ -11,6 +13,7 @@ import open_im_sdk.Open_im_sdk;
public class MessageManager extends BaseManager {
private final static String KEY_ID = "id";
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
/* private static boolean initializedListener = false;
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
@@ -82,6 +85,8 @@ public class MessageManager extends BaseManager {
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
result.success(null);
}
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
@@ -201,6 +206,7 @@ public class MessageManager extends BaseManager {
value(methodCall, "operationID"),
value(methodCall, "imagePath")));
}
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessage(
@@ -389,4 +395,144 @@ public class MessageManager extends BaseManager {
jsonValue(methodCall)
);
}
public void newRevokeMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.newRevokeMessage(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void getAdvancedHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getAdvancedHistoryMessageList(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void findMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.findMessageList(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParams")
);
}
public void createAdvancedTextMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createAdvancedTextMessage(
value(methodCall, "operationID"),
value(methodCall, "text"),
jsonValue(methodCall, "richMessageInfoList")
));
}
public void createAdvancedQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createAdvancedQuoteMessage(
value(methodCall, "operationID"),
value(methodCall, "quoteText"),
jsonValue(methodCall, "quoteMessage"),
jsonValue(methodCall, "richMessageInfoList")
));
}
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.sendMessageNotOss(
new OnMsgSendListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
value(methodCall, "userID"),
value(methodCall, "groupID"),
jsonValue(methodCall, "offlinePushInfo")
);
}
public void createImageMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "sourcePicture"),
jsonValue(methodCall, "bigPicture"),
jsonValue(methodCall, "snapshotPicture")));
}
public void createSoundMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "soundElem")));
}
public void createVideoMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "videoElem")));
}
public void createFileMessageByURL(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessageByURL(
value(methodCall, "operationID"),
jsonValue(methodCall, "fileElem")));
}
public void setCustomBusinessListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setCustomBusinessListener(new OnCustomBusinessListener());
result.success(null);
}
public void setMessageKvInfoListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageKvInfoListener(new OnMessageKvInfoListener());
result.success(null);
}
public void setMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
jsonValue(methodCall, "list")
);
}
public void deleteMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteMessageReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
jsonValue(methodCall, "list")
);
}
public void getMessageListReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMessageListReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "messageList")
);
}
public void addMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addMessageReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
jsonValue(methodCall, "list")
);
}
public void getMessageListSomeReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMessageListSomeReactionExtensions(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "messageList"),
jsonValue(methodCall, "list")
);
}
}

View File

@@ -10,6 +10,8 @@ public class OrganizationManager extends BaseManager {
public void setOrganizationListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setOrganizationListener(new OnOrganizationListener());
result.success(null);
}
public void getSubDepartment(MethodCall methodCall, MethodChannel.Result result) {
@@ -60,7 +62,7 @@ public class OrganizationManager extends BaseManager {
Open_im_sdk.searchOrganization(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParams"),
jsonValue(methodCall, "searchParam"),
int2long(methodCall, "offset"),
int2long(methodCall, "count")
);

View File

@@ -10,6 +10,8 @@ public class SignalingManager extends BaseManager {
public void setSignalingListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSignalingListener(new OnSignalingListener());
result.success(null);
}
public void signalingInvite(MethodCall methodCall, MethodChannel.Result result) {
@@ -53,4 +55,71 @@ public class SignalingManager extends BaseManager {
value(methodCall, "operationID"),
jsonValue(methodCall, "signalingInfo"));
}
public void signalingGetRoomByGroupID(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingGetRoomByGroupID(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"));
}
public void signalingGetTokenByRoomID(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingGetTokenByRoomID(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "roomID"));
}
public void signalingUpdateMeetingInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingUpdateMeetingInfo(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info"));
}
public void signalingCreateMeeting(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingCreateMeeting(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info"));
}
public void signalingJoinMeeting(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingJoinMeeting(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "info"));
}
public void signalingOperateStream(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingOperateStream(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "streamType"),
value(methodCall, "roomID"),
value(methodCall, "userID"),
value(methodCall, "mute"),
value(methodCall, "muteAll"));
}
public void signalingGetMeetings(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingGetMeetings(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"));
}
public void signalingCloseRoom(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingCloseRoom(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "roomID"));
}
public void signalingSendCustomSignal(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.signalingSendCustomSignal(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "customInfo"),
value(methodCall, "roomID"));
}
}

View File

@@ -10,6 +10,8 @@ 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) {

View File

@@ -10,6 +10,8 @@ public class WorkMomentsManager extends BaseManager {
public void setWorkMomentsListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setWorkMomentsListener(new OnWorkMomentsListener());
result.success(null);
}
public void getWorkMomentsUnReadCount(MethodCall methodCall, MethodChannel.Result result) {

View File

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

View File

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

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -198,6 +198,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -212,6 +213,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -322,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;
@@ -402,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;
@@ -452,7 +454,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;

View File

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

View File

@@ -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.16.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.3.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@@ -68,40 +68,52 @@ packages:
path: ".."
relative: true
source: path
version: "2.1.0+1"
version: "2.3.5+2"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.5"
matcher:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.11"
version: "0.12.13"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.4"
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.1"
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
@@ -111,51 +123,58 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.2"
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.9"
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.2"
version: "2.1.4"
sdks:
dart: ">=2.17.0-0 <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=1.20.0"

View File

@@ -25,6 +25,7 @@ public class ConversationManager: BaseServiceManager {
self["resetConversationGroupAtType"] = resetConversationGroupAtType
self["getAtAllTag"] = getAtAllTag
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
self["setOneConversationBurnDuration"] = setOneConversationBurnDuration
}
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -108,6 +109,10 @@ public class ConversationManager: BaseServiceManager {
func setGlobalRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGlobalRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "status"])
}
func setOneConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetOneConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
}
}

View File

@@ -29,6 +29,11 @@ public class GroupManager: BaseServiceManager {
self["setGroupMemberRoleLevel"] = setGroupMemberRoleLevel
self["getGroupMemberListByJoinTimeFilter"] = getGroupMemberListByJoinTimeFilter
self["setGroupVerification"] = setGroupVerification
self["setGroupLookMemberInfo"] = setGroupLookMemberInfo
self["setGroupApplyMemberFriend"] = setGroupApplyMemberFriend
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
self["searchGroupMembers"] = searchGroupMembers
self["setGroupMemberInfo"] = setGroupMemberInfo
}
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -72,7 +77,7 @@ public class GroupManager: BaseServiceManager {
}
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"])
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
}
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -130,6 +135,26 @@ public class GroupManager: BaseServiceManager {
func setGroupVerification(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupVerification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"needVerification"])
}
func setGroupLookMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupLookMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
}
func setGroupApplyMemberFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupApplyMemberFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
}
func getGroupMemberOwnerAndAdmin(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMemberOwnerAndAdmin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
}
func searchGroupMembers(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchGroupMembers(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
}
func setGroupMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
}
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {

View File

@@ -10,6 +10,9 @@ public class IMMananger: BaseServiceManager {
self["logout"] = logout
self["getLoginStatus"] = getLoginStatus
self["wakeUp"] = wakeUp
self["uploadImage"] = uploadImage
self["updateFcmToken"] = updateFcmToken
self["setAppBackgroundStatus"] = setAppBackgroundStatus
}
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -35,6 +38,15 @@ public class IMMananger: BaseServiceManager {
func uploadImage(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkUploadImage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "path"], methodCall[string: "token"], methodCall[string: "obj"])
}
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"])
}
func setAppBackgroundStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[bool: "isBackground"])
}
}
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {

View File

@@ -44,6 +44,23 @@ public class MessageManager: BaseServiceManager {
self["clearC2CHistoryMessageFromLocalAndSvr"] = clearC2CHistoryMessageFromLocalAndSvr
self["clearGroupHistoryMessageFromLocalAndSvr"] = clearGroupHistoryMessageFromLocalAndSvr
self["getHistoryMessageListReverse"] = getHistoryMessageListReverse
self["newRevokeMessage"] = newRevokeMessage
self["getAdvancedHistoryMessageList"] = getAdvancedHistoryMessageList
self["findMessageList"] = findMessageList
self["createAdvancedTextMessage"] = createAdvancedTextMessage
self["createAdvancedQuoteMessage"] = createAdvancedQuoteMessage
self["sendMessageNotOss"] = sendMessageNotOss
self["createImageMessageByURL"] = createImageMessageByURL
self["createSoundMessageByURL"] = createSoundMessageByURL
self["createVideoMessageByURL"] = createVideoMessageByURL
self["createFileMessageByURL"] = createFileMessageByURL
self["setCustomBusinessListener"] = setCustomBusinessListener
self["setMessageKvInfoListener"] = setMessageKvInfoListener
self["setMessageReactionExtensions"] = setMessageReactionExtensions
self["deleteMessageReactionExtensions"] = deleteMessageReactionExtensions
self["getMessageListReactionExtensions"] = getMessageListReactionExtensions
self["addMessageReactionExtensions"] = addMessageReactionExtensions
self["getMessageListSomeReactionExtensions"] = getMessageListSomeReactionExtensions
}
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -173,6 +190,16 @@ public class MessageManager: BaseServiceManager {
func createFaceMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFaceMessage(methodCall[string: "operationID"], methodCall[int: "index"], methodCall[string: "data"]))
}
func createAdvancedTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateAdvancedTextMessage(methodCall[string: "operationID"], methodCall[string: "text"], methodCall[jsonString: "richMessageInfoList"])
callBack(result, prama)
}
func createAdvancedQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateAdvancedQuoteMessage(methodCall[string: "operationID"], methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"], methodCall[jsonString: "richMessageInfoList"])
callBack(result, prama)
}
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
@@ -214,70 +241,195 @@ public class MessageManager: BaseServiceManager {
Open_im_sdkGetHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
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 newRevokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkNewRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
private let channel: FlutterMethodChannel
private let id: String
init(channel: FlutterMethodChannel, id: String) {
self.channel = channel
self.id = id
}
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["c2cMessageReadReceipt"] = msgReceiptList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
}
public func onRecvGroupReadReceipt(_ groupMsgReceiptList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["groupMessageReadReceipt"] = groupMsgReceiptList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageRevoked(_ msgId: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["revokedMessage"] = msgId
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
}
public func onRecvNewMessage(_ message: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["newMessage"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
}
func getAdvancedHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetAdvancedHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkFindMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"])
}
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
}
func createImageMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateImageMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "sourcePicture"], methodCall[jsonString: "bigPicture"], methodCall[jsonString: "snapshotPicture"]))
}
func createSoundMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateSoundMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "soundElem"]))
}
func createVideoMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateVideoMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "videoElem"]))
}
func createFileMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessageByURL(methodCall[string: "operationID"], methodCall[jsonString: "fileElem"]))
}
func setCustomBusinessListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel))
callBack(result)
}
func setMessageKvInfoListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageKvInfoListener(MessageKvInfoListener(channel: channel))
callBack(result)
}
func setMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
}
func deleteMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
}
func getMessageListReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetMessageListReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "messageList"])
}
func addMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
}
func getMessageListSomeReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetMessageListSomeReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[jsonString: "list"])
}
}
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
private let channel: FlutterMethodChannel
private let result: FlutterResult
private let call: FlutterMethodCall
init(channel: FlutterMethodChannel, result: @escaping FlutterResult, methodCall: FlutterMethodCall) {
self.channel = channel
self.result = result
self.call = methodCall
}
public func onError(_ errCode: Int32, errMsg: String?) {
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
}
public func onProgress(_ progress: Int) {
var values: [String: Any] = [:]
let message = call[dict: "message"]
values["clientMsgID"] = message["clientMsgID"]
values["progress"] = progress
CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
}
public func onSuccess(_ data: String?) {
DispatchQueue.main.async { self.result(data) }
}
}
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
private let channel: FlutterMethodChannel
private let id: String
init(channel: FlutterMethodChannel, id: String) {
self.channel = channel
self.id = id
}
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["c2cMessageReadReceipt"] = msgReceiptList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
}
public func onRecvGroupReadReceipt(_ groupMsgReceiptList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["groupMessageReadReceipt"] = groupMsgReceiptList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageRevoked(_ msgId: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["revokedMessage"] = msgId
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
}
public func onRecvNewMessage(_ message: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["newMessage"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
}
public func onNewRecvMessageRevoked(_ messageRevoked: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["revokedMessageV2"] = messageRevoked
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onNewRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageExtensionsChanged(_ msgID: String?, reactionExtensionList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["msgID"] = msgID
values["list"] = reactionExtensionList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsChanged", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageExtensionsDeleted(_ msgID: String?, reactionExtensionKeyList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["msgID"] = msgID
values["list"] = reactionExtensionKeyList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsDeleted", errCode: nil, errMsg: nil, data: values)
}
public func onRecvMessageExtensionsAdded(_ msgID: String?, reactionExtensionList: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["msgID"] = msgID
values["list"] = reactionExtensionList
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsAdded", errCode: nil, errMsg: nil, data: values)
}
}
public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
private let channel: FlutterMethodChannel
init(channel: FlutterMethodChannel) {
self.channel = channel
}
public func onRecvCustomBusinessMessage(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "customBusinessListener", type: "onRecvCustomBusinessMessage", errCode: nil, errMsg: nil, data: s)
}
}
public class MessageKvInfoListener: NSObject, Open_im_sdk_callbackOnMessageKvInfoListenerProtocol {
private let channel: FlutterMethodChannel
init(channel: FlutterMethodChannel) {
self.channel = channel
}
public func onMessageKvInfoChanged(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "messageKvInfoListener", type: "onMessageKvInfoChanged", errCode: nil, errMsg: nil, data: s)
}
}

View File

@@ -40,7 +40,7 @@ public class OrganizationManager: BaseServiceManager {
}
func searchOrganization(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSearchOrganization(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"], methodCall[int: "offset"], methodCall[int: "count"])
Open_im_sdkSearchOrganization(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"], methodCall[int: "offset"], methodCall[int: "count"])
}
}

View File

@@ -12,6 +12,15 @@ public class SignalingManager: BaseServiceManager {
self["signalingReject"] = signalingReject
self["signalingCancel"] = signalingCancel
self["signalingHungUp"] = signalingHungUp
self["signalingGetRoomByGroupID"] = signalingGetRoomByGroupID
self["signalingGetTokenByRoomID"] = signalingGetTokenByRoomID
self["signalingUpdateMeetingInfo"] = signalingUpdateMeetingInfo
self["signalingCreateMeeting"] = signalingCreateMeeting
self["signalingJoinMeeting"] = signalingJoinMeeting
self["signalingOperateStream"] = signalingOperateStream
self["signalingGetMeetings"] = signalingGetMeetings
self["signalingCloseRoom"] = signalingCloseRoom
self["signalingSendCustomSignal"] = signalingSendCustomSignal
}
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -42,9 +51,46 @@ public class SignalingManager: BaseServiceManager {
func signalingHungUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingHungUp(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
}
func signalingGetRoomByGroupID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingGetRoomByGroupID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
}
func signalingGetTokenByRoomID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingGetTokenByRoomID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
}
func signalingUpdateMeetingInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingUpdateMeetingInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
func signalingCreateMeeting(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingCreateMeeting(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
func signalingJoinMeeting(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingJoinMeeting(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
}
func signalingOperateStream(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingOperateStream(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "streamType"], methodCall[string: "roomID"], methodCall[string: "userID"], methodCall[bool: "mute"], methodCall[bool: "muteAll"])
}
func signalingGetMeetings(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingGetMeetings(BaseCallback(result: result), methodCall[string: "operationID"])
}
func signalingCloseRoom(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingCloseRoom(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
}
func signalingSendCustomSignal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSignalingSendCustomSignal(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "customInfo"], methodCall[string: "roomID"])
}
}
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
@@ -83,4 +129,20 @@ public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListene
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onHangUp", errCode: nil, errMsg: nil, data: s)
}
public func onRoomParticipantConnected(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantConnected", errCode: nil, errMsg: nil, data: s)
}
public func onRoomParticipantDisconnected(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantDisconnected", errCode: nil, errMsg: nil, data: s)
}
public func onStreamChange(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onStreamChange", errCode: nil, errMsg: nil, data: s)
}
public func onReceiveCustomSignal(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onReceiveCustomSignal", errCode: nil, errMsg: nil, data: s)
}
}

View File

@@ -15,9 +15,9 @@ A new Flutter project.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '8.0'
s.platform = :ios, '9.0'
s.dependency 'OpenIMSDKCore','2.1.0'
s.dependency 'OpenIMSDKCore','2.3.5-b3'
s.static_framework = true
# s.vendored_frameworks = 'Framework/*.framework'
# Flutter.framework does not contain a i386 slice.

View File

@@ -3,16 +3,21 @@ library flutter_openim_sdk;
export 'src/enum/conversation_type.dart';
export 'src/enum/group_at_type.dart';
export 'src/enum/group_role_level.dart';
export 'src/enum/group_type.dart';
export 'src/enum/group_verification.dart';
export 'src/enum/im_platform.dart';
export 'src/enum/listener_type.dart';
export 'src/enum/message_status.dart';
export 'src/enum/message_type.dart';
export 'src/enum/sdk_error_code.dart';
export 'src/listener/advanced_msg_listener.dart';
export 'src/listener/connect_listener.dart';
export 'src/listener/conversation_listener.dart';
export 'src/listener/custom_business_listener.dart';
export 'src/listener/friendship_listener.dart';
export 'src/listener/group_listener.dart';
export 'src/listener/listener_for_service.dart';
export 'src/listener/message_kv_info_listener.dart';
export 'src/listener/msg_send_progress_listener.dart';
export 'src/listener/organization_listener.dart';
export 'src/listener/signaling_listener.dart';
@@ -30,6 +35,7 @@ export 'src/manager/im_user_manager.dart';
export 'src/manager/im_workmoments_manager.dart';
export 'src/models/conversation_info.dart';
export 'src/models/group_info.dart';
export 'src/models/meeting_info.dart';
export 'src/models/message.dart';
export 'src/models/notification_info.dart';
export 'src/models/organization_info.dart';

View File

@@ -3,9 +3,12 @@ class ConversationType {
/// 单聊
static const single = 1;
/// 群
/// 群
static const group = 2;
/// 大群
static const superGroup = 3;
/// 通知
static const notification = 4;
}

View File

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

View File

@@ -10,4 +10,6 @@ class IMPlatform {
static const web = 5;
static const mini_web = 6;
static const linux = 7;
static const android_pad = 8;
static const ipad = 9;
}

View File

@@ -1,14 +1,17 @@
/// callback类型
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 final workMomentsListener = "workMomentsListener";
static final organizationListener = "organizationListener";
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";
}

View File

@@ -45,6 +45,19 @@ class MessageType {
/// 自定义表情
static const custom_face = 115;
/// 群消息已读回执
static const groupHasReadReceipt = 116;
/// 富文本消息
static const advancedText = 117;
/// 高级撤回
static const advancedRevoke = 118;
static const customMsgNotTriggerConversation = 119;
static const customMsgOnlineOnly = 120;
/// 通知类型
static const notificationBegin = 1000;

View File

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

View File

@@ -6,6 +6,10 @@ class OnAdvancedMsgListener {
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
Function(String msgId)? onRecvMessageRevoked;
Function(Message msg)? onRecvNewMessage;
Function(RevokedInfo info)? onRecvMessageRevokedV2;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsChanged;
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
/// Uniquely identifies
String id;
@@ -13,8 +17,12 @@ class OnAdvancedMsgListener {
OnAdvancedMsgListener({
this.onRecvC2CMessageReadReceipt,
this.onRecvGroupMessageReadReceipt,
this.onRecvMessageRevoked,
@deprecated this.onRecvMessageRevoked,
this.onRecvNewMessage,
this.onRecvMessageRevokedV2,
this.onRecvMessageExtensionsChanged,
this.onRecvMessageExtensionsDeleted,
this.onRecvMessageExtensionsAdded,
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
/// C2C消息已读回执
@@ -36,4 +44,25 @@ class OnAdvancedMsgListener {
void recvNewMessage(Message msg) {
onRecvNewMessage?.call(msg);
}
/// 消息被撤回
void recvMessageRevokedV2(RevokedInfo info) {
onRecvMessageRevokedV2?.call(info);
}
/// 收到拓展消息kv改变
void recvMessageExtensionsChanged(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsChanged?.call(msgID, list);
}
/// 收到扩展消息被删除
/// [list] 被删除的TypeKey
void recvMessageExtensionsDeleted(String msgID, List<String> list) {
onRecvMessageExtensionsDeleted?.call(msgID, list);
}
/// 收到拓展消息kv新增
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsAdded?.call(msgID, list);
}
}

View File

@@ -4,38 +4,38 @@ class OnConnectListener {
Function()? onConnectSuccess;
Function()? onConnecting;
Function()? onKickedOffline;
Function()? onUserSigExpired;
Function()? onUserTokenExpired;
OnConnectListener({
this.onConnectFailed,
this.onConnectSuccess,
this.onConnecting,
this.onKickedOffline,
this.onUserSigExpired,
this.onUserTokenExpired,
});
/// SDK连接服务器失败
void connectFailed(int? code, String? errorMsg) {
if (null != onConnectFailed) onConnectFailed!(code, errorMsg);
onConnectFailed?.call(code, errorMsg);
}
/// SDK连接服务器成功
void connectSuccess() {
if (null != onConnectSuccess) onConnectSuccess!();
onConnectSuccess?.call();
}
/// SDK正在连接服务器
void connecting() {
if (null != onConnecting) onConnecting!.call();
onConnecting?.call();
}
/// 账号已在其他地方登录,当前设备被踢下线
void kickedOffline() {
if (null != onKickedOffline) onKickedOffline!();
onKickedOffline?.call();
}
/// 登录凭证过期,需要重新登录
void userSigExpired() {
if (null != onUserSigExpired) onUserSigExpired!();
void userTokenExpired() {
onUserTokenExpired?.call();
}
}

View File

@@ -20,29 +20,28 @@ class OnConversationListener {
/// 会话发生改变
void conversationChanged(List<ConversationInfo> list) {
if (onConversationChanged != null) onConversationChanged!(list);
onConversationChanged?.call(list);
}
/// 有新会话产生
void newConversation(List<ConversationInfo> list) {
if (onNewConversation != null) onNewConversation!(list);
onNewConversation?.call(list);
}
/// 未读消息总数发送改变
void totalUnreadMessageCountChanged(int i) {
if (onTotalUnreadMessageCountChanged != null)
onTotalUnreadMessageCountChanged!(i);
onTotalUnreadMessageCountChanged?.call(i);
}
void syncServerFailed() {
if (onSyncServerFailed != null) onSyncServerFailed!();
onSyncServerFailed?.call();
}
void syncServerFinish() {
if (onSyncServerFinish != null) onSyncServerFinish!();
onSyncServerFinish?.call();
}
void syncServerStart() {
if (onSyncServerStart != null) onSyncServerStart!();
onSyncServerStart?.call();
}
}

View File

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

View File

@@ -0,0 +1,38 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 好友关系监听
class OnListenerForService {
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
Function(Message msg)? onRecvNewMessage;
OnListenerForService({
this.onFriendApplicationAdded,
this.onFriendApplicationAccepted,
this.onGroupApplicationAccepted,
this.onGroupApplicationAdded,
this.onRecvNewMessage,
});
void friendApplicationAccepted(FriendApplicationInfo u) {
onFriendApplicationAccepted?.call(u);
}
void friendApplicationAdded(FriendApplicationInfo u) {
onFriendApplicationAdded?.call(u);
}
void groupApplicationAccepted(GroupApplicationInfo info) {
onGroupApplicationAccepted?.call(info);
}
void groupApplicationAdded(GroupApplicationInfo info) {
onGroupApplicationAdded?.call(info);
}
void recvNewMessage(Message msg) {
onRecvNewMessage?.call(msg);
}
}

View File

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

View File

@@ -6,6 +6,6 @@ class OnMsgSendProgressListener {
/// 消息发送进度
void progress(String clientMsgID, int progress) {
if (null != onProgress) onProgress!(clientMsgID, progress);
onProgress?.call(clientMsgID, progress);
}
}

View File

@@ -1,4 +1,4 @@
import 'package:flutter_openim_sdk/src/models/signaling_info.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
/// 信令监听
class OnSignalingListener {
@@ -10,6 +10,10 @@ class OnSignalingListener {
final Function(SignalingInfo info)? onInviteeRejectedByOtherDevice;
final Function(SignalingInfo info)? onInviteeAcceptedByOtherDevice;
final Function(SignalingInfo info)? onHangup;
final Function(RoomCallingInfo info)? onRoomParticipantConnected;
final Function(RoomCallingInfo info)? onRoomParticipantDisconnected;
final Function(MeetingStreamEvent event)? onMeetingStreamChanged;
final Function(CustomSignaling info)? onReceiveCustomSignal;
OnSignalingListener({
this.onInvitationCancelled,
@@ -20,6 +24,10 @@ class OnSignalingListener {
this.onInviteeAcceptedByOtherDevice,
this.onInviteeRejectedByOtherDevice,
this.onHangup,
this.onRoomParticipantConnected,
this.onRoomParticipantDisconnected,
this.onMeetingStreamChanged,
this.onReceiveCustomSignal,
});
/// 被邀请者收到:邀请者取消音视频通话
@@ -61,4 +69,20 @@ class OnSignalingListener {
void hangup(SignalingInfo info) {
onHangup?.call(info);
}
void roomParticipantConnected(RoomCallingInfo info) {
onRoomParticipantConnected?.call(info);
}
void roomParticipantDisconnected(RoomCallingInfo info) {
onRoomParticipantDisconnected?.call(info);
}
void streamChangedEvent(MeetingStreamEvent event) {
onMeetingStreamChanged?.call(event);
}
void receiveCustomSignal(CustomSignaling info) {
onReceiveCustomSignal?.call(info);
}
}

9
lib/src/logger.dart Normal file
View File

@@ -0,0 +1,9 @@
import 'dart:developer';
/// print full log
class Logger {
// Sample of abstract logging function
static void print(String text) {
log('** $text', name: 'flutter_openim_sdk');
}
}

View File

@@ -46,7 +46,7 @@ class ConversationManager {
/// 查询会话,如果会话不存在会自动生成一个
/// [sourceID] 如果是单聊会话传userID如果是群聊会话传GroupID
/// [sessionType] 如果是单聊会话传1如果是群聊会话传2
/// [sessionType] 参考[ConversationType]
Future<ConversationInfo> getOneConversation({
required String sourceID,
required int sessionType,
@@ -149,7 +149,7 @@ class ConversationManager {
/// 查询会话id
/// [sourceID] 如果是单聊值传用户ID如果是群聊值传组ID
/// [sessionType] 如果是单聊值传1如果是群聊值传2
/// [sessionType] 参考[ConversationType]
Future<dynamic> getConversationIDBySessionType({
required String sourceID,
required int sessionType,
@@ -262,6 +262,22 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// 设置阅后即焚时长
/// [conversationID] 会话id
/// [burnDuration] 时长s默认30s
Future<dynamic> setOneConversationBurnDuration({
required String conversationID,
int burnDuration = 30,
String? operationID,
}) =>
_channel.invokeMethod(
'setOneConversationBurnDuration',
_buildParam({
"conversationID": conversationID,
"burnDuration": burnDuration,
"operationID": Utils.checkOperationID(operationID),
}));
/// 会话列表自定义排序规则。
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
..sort((a, b) {

View File

@@ -77,7 +77,7 @@ class GroupManager {
/// 分页获取组成员列表
/// [groupId] 群ID
/// [filter] 过滤成员 1普通成员, 2群主3管理员0 所有
/// [filter] 过滤成员 0所有1普通成员, 2群主3管理员4管理员+普通成员
/// [offset] 开始下标
/// [count] 总数
Future<List<GroupMembersInfo>> getGroupMemberList({
@@ -102,7 +102,7 @@ class GroupManager {
/// 分页获取组成员列表
/// [groupId] 群ID
/// [filter] 过滤成员 1普通成员, 2群主3管理员0所有
/// [filter] 过滤成员 0所有1普通成员, 2群主3管理员4管理员+普通成员
/// [offset] 开始下标
/// [count] 总数
Future<List<dynamic>> getGroupMemberListMap({
@@ -157,9 +157,9 @@ class GroupManager {
/// [notification] 公告
/// [introduction] 群介绍
/// [faceUrl] 群头像
/// [groupType] 组类型
/// [groupType] 组类型 [GroupType]
/// [ex] 额外信息
/// [list] 初创群成员以及其角色列表,角色参考[GroupRoleLevel]类
/// [list] 初创群成员以及其角色列表[GroupMemberRole]
Future<GroupInfo> createGroup({
String? groupName,
String? notification,
@@ -236,16 +236,19 @@ class GroupManager {
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// 申请加入组,需要通过管理员/群组同意。
/// [joinSource] 2通过邀请 3通过搜索 4通过二维码
Future<dynamic> joinGroup({
required String gid,
String? reason,
String? operationID,
int joinSource = 3,
}) =>
_channel.invokeMethod(
'joinGroup',
_buildParam({
'gid': gid,
'reason': reason,
'joinSource': joinSource,
'operationID': Utils.checkOperationID(operationID),
}));
@@ -481,7 +484,7 @@ class GroupManager {
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// 设置群成员权限
/// 进群验证设置
/// [groupID] 群ID
/// [needVerification] 进群设置,参考[GroupVerification]类
Future<dynamic> setGroupVerification({
@@ -497,6 +500,137 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 不允许通过群获取成员资料
/// [groupID] 群ID
/// [status] 0关闭1打开
Future<dynamic> setGroupLookMemberInfo({
required String groupID,
required int status,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupLookMemberInfo',
_buildParam({
'groupID': groupID,
'status': status,
'operationID': Utils.checkOperationID(operationID),
}));
/// 不允许通过群添加好友
/// [groupID] 群ID
/// [status] 0关闭1打开
Future<dynamic> setGroupApplyMemberFriend({
required String groupID,
required int status,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupApplyMemberFriend',
_buildParam({
'groupID': groupID,
'status': status,
'operationID': Utils.checkOperationID(operationID),
}));
/// 获取群拥有者,管理员
/// [groupId] 群ID
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
required String groupID,
String? operationID,
}) =>
_channel
.invokeMethod(
'getGroupMemberOwnerAndAdmin',
_buildParam({
'groupID': groupID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// 查询群
/// [groupID] 群id
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] 是否以关键词搜成员id
/// [isSearchMemberNickname] 是否以关键词搜索成员昵称
/// [offset] 开始index
/// [count] 每次获取的总数
Future<List<GroupMembersInfo>> searchGroupMembers({
required String groupID,
List<String> keywordList = const [],
bool isSearchUserID = false,
bool isSearchMemberNickname = false,
int offset = 0,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchGroupMembers',
_buildParam({
'searchParam': {
'groupID': groupID,
'keywordList': keywordList,
'isSearchUserID': isSearchUserID,
'isSearchMemberNickname': isSearchMemberNickname,
'offset': offset,
'count': count,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// 查询群
/// [groupID] 群id
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
/// [isSearchUserID] 是否以关键词搜成员id
/// [isSearchMemberNickname] 是否以关键词搜索成员昵称
/// [offset] 开始index
/// [count] 每次获取的总数
Future<List<dynamic>> searchGroupMembersListMap({
required String groupID,
List<String> keywordList = const [],
bool isSearchUserID = false,
bool isSearchMemberNickname = false,
int offset = 0,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchGroupMembers',
_buildParam({
'searchParam': {
'groupID': groupID,
'keywordList': keywordList,
'isSearchUserID': isSearchUserID,
'isSearchMemberNickname': isSearchMemberNickname,
'offset': offset,
'count': count,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toListMap(value));
/// 修改GroupMemberInfo ex字段
Future<dynamic> setGroupMemberInfo({
required String groupID,
required String userID,
String? ex,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupMemberInfo',
_buildParam({
'info': {
'groupID': groupID,
'userID': userID,
'ex': ex,
},
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "groupManager";
return param;

View File

@@ -2,6 +2,7 @@ import 'dart:developer';
import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
import 'package:flutter_openim_sdk/src/logger.dart';
class IMManager {
MethodChannel _channel;
@@ -17,6 +18,7 @@ class IMManager {
late OrganizationManager organizationManager;
late OnConnectListener _connectListener;
OnListenerForService? _listenerForService;
late String uid;
late UserInfo uInfo;
bool isLogined = false;
@@ -39,7 +41,7 @@ class IMManager {
void _addNativeCallback(MethodChannel _channel) {
_channel.setMethodCallHandler((call) {
try {
log('Flutter : $call');
Logger.print('Flutter : $call');
if (call.method == ListenerType.connectListener) {
String type = call.arguments['type'];
switch (type) {
@@ -57,8 +59,8 @@ class IMManager {
case 'onKickedOffline':
_connectListener.kickedOffline();
break;
case 'onUserSigExpired':
_connectListener.userSigExpired();
case 'onUserTokenExpired':
_connectListener.userTokenExpired();
break;
}
} else if (call.method == ListenerType.userListener) {
@@ -147,6 +149,32 @@ class IMManager {
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
messageManager.msgListener.recvGroupMessageReadReceipt(list);
break;
case 'onNewRecvMessageRevoked':
var value = call.arguments['data']['revokedMessageV2'];
var info = Utils.toObj(value, (map) => RevokedInfo.fromJson(map));
messageManager.msgListener.recvMessageRevokedV2(info);
break;
case 'onRecvMessageExtensionsChanged':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['list'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener
.recvMessageExtensionsChanged(msgID, list);
break;
case 'onRecvMessageExtensionsDeleted':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['list'];
var list = Utils.toList(value, (map) => '$map');
messageManager.msgListener
.recvMessageExtensionsDeleted(msgID, list);
break;
case 'onRecvMessageExtensionsAdded':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['list'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener
.recvMessageExtensionsAdded(msgID, list);
break;
}
} else if (call.method == ListenerType.msgSendProgressListener) {
String type = call.arguments['type'];
@@ -239,31 +267,59 @@ class IMManager {
} else if (call.method == ListenerType.signalingListener) {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
final u = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
dynamic info;
switch (type) {
case 'onRoomParticipantConnected':
case 'onRoomParticipantDisconnected':
info = Utils.toObj(data, (map) => RoomCallingInfo.fromJson(map));
break;
case 'onStreamChange':
info =
Utils.toObj(data, (map) => MeetingStreamEvent.fromJson(map));
break;
case 'onReceiveCustomSignal':
info = Utils.toObj(data, (map) => CustomSignaling.fromJson(map));
break;
default:
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
break;
}
switch (type) {
case 'onInvitationCancelled':
signalingManager.listener.invitationCancelled(u);
signalingManager.listener.invitationCancelled(info);
break;
case 'onInvitationTimeout':
signalingManager.listener.invitationTimeout(u);
signalingManager.listener.invitationTimeout(info);
break;
case 'onInviteeAccepted':
signalingManager.listener.inviteeAccepted(u);
signalingManager.listener.inviteeAccepted(info);
break;
case 'onInviteeRejected':
signalingManager.listener.inviteeRejected(u);
signalingManager.listener.inviteeRejected(info);
break;
case 'onReceiveNewInvitation':
signalingManager.listener.receiveNewInvitation(u);
signalingManager.listener.receiveNewInvitation(info);
break;
case 'onInviteeAcceptedByOtherDevice':
signalingManager.listener.inviteeAcceptedByOtherDevice(u);
signalingManager.listener.inviteeAcceptedByOtherDevice(info);
break;
case 'onInviteeRejectedByOtherDevice':
signalingManager.listener.inviteeRejectedByOtherDevice(u);
signalingManager.listener.inviteeRejectedByOtherDevice(info);
break;
case 'onHangUp':
signalingManager.listener.hangup(u);
signalingManager.listener.hangup(info);
break;
case 'onRoomParticipantConnected':
signalingManager.listener.roomParticipantConnected(info);
break;
case 'onRoomParticipantDisconnected':
signalingManager.listener.roomParticipantDisconnected(info);
break;
case 'onStreamChange':
signalingManager.listener.streamChangedEvent(info);
break;
case 'onReceiveCustomSignal':
signalingManager.listener.receiveCustomSignal(info);
break;
}
} else if (call.method == ListenerType.workMomentsListener) {
@@ -280,10 +336,58 @@ class IMManager {
organizationManager.listener.organizationUpdated();
break;
}
} else if (call.method == ListenerType.customBusinessListener) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onRecvCustomBusinessMessage':
messageManager.customBusinessListener
?.recvCustomBusinessMessage(data);
break;
}
} else if (call.method == ListenerType.messageKvInfoListener) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onMessageKvInfoChanged':
final list =
Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
break;
}
} else if (call.method == ListenerType.listenerForService) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onFriendApplicationAccepted':
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
_listenerForService?.friendApplicationAccepted(u);
break;
case 'onFriendApplicationAdded':
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
_listenerForService?.friendApplicationAdded(u);
break;
case 'onGroupApplicationAccepted':
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
_listenerForService?.groupApplicationAccepted(i);
break;
case 'onGroupApplicationAdded':
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
_listenerForService?.groupApplicationAdded(i);
break;
case 'onRecvNewMessage':
final msg = Utils.toObj(data, (map) => Message.fromJson(map));
_listenerForService?.recvNewMessage(msg);
break;
}
}
} catch (err) {
print(
"回调失败了。$err ${call.method} ${call.arguments['type']} ${call.arguments['data']}");
} catch (error, stackTrace) {
Logger.print(
"回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
}
return Future.value(null);
});
@@ -296,6 +400,8 @@ class IMManager {
/// [dataDir] SDK数据库存储目录
/// [objectStorage] 存储对象 cos/minio
/// [logLevel] 日志 1不打印
/// [enabledEncryption] true加密
/// [enabledCompression] true压缩
Future<dynamic> initSDK({
required int platform,
required String apiAddr,
@@ -304,6 +410,10 @@ class IMManager {
required OnConnectListener listener,
int logLevel = 6,
String objectStorage = 'cos',
String? encryptionKey,
bool enabledEncryption = false,
bool enabledCompression = false,
bool isExternalExtensions = false,
String? operationID,
}) {
this._connectListener = listener;
@@ -318,6 +428,10 @@ class IMManager {
"data_dir": dataDir,
"log_level": logLevel,
"object_storage": objectStorage,
"encryption_key": encryptionKey,
"is_need_encryption": enabledEncryption,
"is_compression ": enabledCompression,
"is_external_extensions": isExternalExtensions,
"operationID": Utils.checkOperationID(operationID),
},
));
@@ -331,10 +445,12 @@ class IMManager {
/// 登录
/// [uid] 用户id
/// [token] 登录token从业务服务器上获取
/// [defaultValue] 获取失败后使用的默认值
Future<UserInfo> login({
required String uid,
required String token,
String? operationID,
Future<UserInfo> Function()? defaultValue,
}) async {
await _channel.invokeMethod(
'login',
@@ -347,8 +463,16 @@ class IMManager {
this.isLogined = true;
this.uid = uid;
this.token = token;
this.uInfo = await userManager.getSelfUserInfo();
return uInfo;
try {
return this.uInfo = await userManager.getSelfUserInfo();
} catch (error, stackTrace) {
log('login e: $error s: $stackTrace');
if (null != defaultValue) {
return this.uInfo = await (defaultValue.call());
}
return Future.error(error, stackTrace);
}
// return uInfo;
}
/// 登出
@@ -399,6 +523,48 @@ class IMManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 更新firebase客户端注册token
/// [fcmToken] firebase token
Future updateFcmToken({
required String fcmToken,
String? operationID,
}) =>
_channel.invokeMethod(
'updateFcmToken',
_buildParam({
'fcmToken': fcmToken,
'operationID': Utils.checkOperationID(operationID),
}));
/// 标记app处于后台
Future setAppBackgroundStatus({
required bool isBackground,
String? operationID,
}) =>
_channel.invokeMethod(
'setAppBackgroundStatus',
_buildParam({
'isBackground': isBackground,
'operationID': Utils.checkOperationID(operationID),
}));
/// 网络改变
Future networkChanged({
String? operationID,
}) =>
_channel.invokeMethod(
'networkChanged',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}));
Future setListenerForService(OnListenerForService listener) {
this._listenerForService = listener;
return _channel.invokeMethod('setListenerForService', _buildParam({}));
}
MethodChannel get channel => _channel;
static Map _buildParam(Map param) {
param["ManagerName"] = "imManager";
return param;

View File

@@ -7,6 +7,8 @@ class MessageManager {
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
OnMsgSendProgressListener? msgSendProgressListener;
late OnAdvancedMsgListener msgListener;
OnCustomBusinessListener? customBusinessListener;
OnMessageKvInfoListener? messageKvInfoListener;
MessageManager(this._channel);
@@ -77,8 +79,9 @@ class MessageManager {
}))
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
/// 撤回消息
/// 撤回消息[revokeMessageV2]
/// [message] 被撤回的消息体
@deprecated
Future revokeMessage({
required Message message,
String? operationID,
@@ -686,6 +689,283 @@ class MessageManager {
}))
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
/// 撤回消息
/// [message] 被撤回的消息体
Future revokeMessageV2({
required Message message,
String? operationID,
}) =>
_channel.invokeMethod(
'newRevokeMessage',
_buildParam(message.toJson()
..addAll({
"operationID": Utils.checkOperationID(operationID),
})));
/// 获取聊天记录(以startMsg为节点以前的聊天记录)
/// [userID] 接收消息的用户id
/// [conversationID] 会话id查询通知时可用
/// [groupID] 接收消息的组id
/// [startMsg] 从这条消息开始查询[count]条获取的列表index==length-1为最新消息所以获取下一页历史记录startMsg=list.first
/// [count] 一次拉取的总数
/// [lastMinSeq] 第一页消息不用传,获取第二页开始必传 跟[startMsg]一样
Future<AdvancedMessage> getAdvancedHistoryMessageList({
String? userID,
String? groupID,
String? conversationID,
int? lastMinSeq,
Message? startMsg,
int? count,
String? operationID,
}) =>
_channel
.invokeMethod(
'getAdvancedHistoryMessageList',
_buildParam({
'userID': userID ?? '',
'groupID': groupID ?? '',
'conversationID': conversationID ?? '',
'startClientMsgID': startMsg?.clientMsgID ?? '',
'count': count ?? 40,
'lastMinSeq': lastMinSeq ?? 0,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
/// 查找消息详细
/// [conversationID] 会话id
/// [clientMsgIDList] 消息id列表
Future<SearchResult> findMessageList({
required List<SearchParams> searchParams,
String? operationID,
}) =>
_channel
.invokeMethod(
'findMessageList',
_buildParam({
'searchParams': searchParams.map((e) => e.toJson()).toList(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
/// 富文本消息
/// [text] 输入内容
/// [list] 富文本消息具体详细
Future<Message> createAdvancedTextMessage({
required String text,
List<RichMessageInfo> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'createAdvancedTextMessage',
_buildParam({
'text': text,
'richMessageInfoList': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 富文本消息
/// [text] 回复的内容
/// [quoteMsg] 被回复的消息
/// [list] 富文本消息具体详细
Future<Message> createAdvancedQuoteMessage({
required String text,
required Message quoteMsg,
List<RichMessageInfo> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'createAdvancedQuoteMessage',
_buildParam({
'quoteText': text,
'quoteMessage': quoteMsg.toJson(),
'richMessageInfoList': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 发送消息
/// [message] 消息体 [createImageMessageByURL],[createSoundMessageByURL],[createVideoMessageByURL],[createFileMessageByURL]
/// [userID] 接收消息的用户id
/// [groupID] 接收消息的组id
/// [offlinePushInfo] 离线消息显示内容
Future<Message> sendMessageNotOss({
required Message message,
required OfflinePushInfo offlinePushInfo,
String? userID,
String? groupID,
String? operationID,
}) =>
_channel
.invokeMethod(
'sendMessageNotOss',
_buildParam({
'message': message.toJson(),
'offlinePushInfo': offlinePushInfo.toJson(),
'userID': userID ?? '',
'groupID': groupID ?? '',
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建图片消息
Future<Message> createImageMessageByURL({
required PictureInfo sourcePicture,
required PictureInfo bigPicture,
required PictureInfo snapshotPicture,
String? operationID,
}) =>
_channel
.invokeMethod(
'createImageMessageByURL',
_buildParam({
'sourcePicture': sourcePicture.toJson(),
'bigPicture': bigPicture.toJson(),
'snapshotPicture': snapshotPicture.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建语音消息
Future<Message> createSoundMessageByURL({
required SoundElem soundElem,
String? operationID,
}) =>
_channel
.invokeMethod(
'createSoundMessageByURL',
_buildParam({
'soundElem': soundElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}),
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建视频消息
Future<Message> createVideoMessageByURL({
required VideoElem videoElem,
String? operationID,
}) =>
_channel
.invokeMethod(
'createVideoMessageByURL',
_buildParam({
'videoElem': videoElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 创建视频消息
Future<Message> createFileMessageByURL({
required FileElem fileElem,
String? operationID,
}) =>
_channel
.invokeMethod(
'createFileMessageByURL',
_buildParam({
'fileElem': fileElem.toJson(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// 用户资料改变监听
Future setCustomBusinessListener(OnCustomBusinessListener listener) {
this.customBusinessListener = listener;
return _channel.invokeMethod('setCustomBusinessListener', _buildParam({}));
}
///
Future setMessageKvInfoListener(OnMessageKvInfoListener listener) {
this.messageKvInfoListener = listener;
return _channel.invokeMethod('setMessageKvInfoListener', _buildParam({}));
}
Future<List<TypeKeySetResult>> setMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'setMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<TypeKeySetResult>> deleteMessageReactionExtensions({
required Message message,
List<String> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'deleteMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListReactionExtensions({
List<Message> messageList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(
value, (map) => MessageTypeKeyMapping.fromJson(map)));
Future<List<TypeKeySetResult>> addMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'addMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListSomeReactionExtensions({
List<Message> messageList = const [],
List<KeyValue> kvList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListSomeReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
'list': kvList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(
value, (map) => MessageTypeKeyMapping.fromJson(map)));
static Map _buildParam(Map param) {
param["ManagerName"] = "messageManager";
return param;

View File

@@ -138,7 +138,7 @@ class OrganizationManager {
.invokeMethod(
'searchOrganization',
_buildParam({
'searchParams': {
'searchParam': {
'keyWord': keyWord,
'isSearchUserName': isSearchUserName,
'isSearchEnglishName': isSearchEnglishName,

View File

@@ -101,6 +101,205 @@ class SignalingManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 获取当前群通话信息
/// [groupID] 当前群ID
Future<RoomCallingInfo> signalingGetRoomByGroupID({
required String groupID,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingGetRoomByGroupID',
_buildParam({
'groupID': groupID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => RoomCallingInfo.fromJson(map)));
/// 获取进入房间的信息
/// [roomID] 当前房间ID
Future<SignalingCertificate> signalingGetTokenByRoomID({
required String roomID,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingGetTokenByRoomID',
_buildParam({
'roomID': roomID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(
value,
(map) => SignalingCertificate.fromJson(
map..addAll({'roomID': roomID}))));
/// 会议设置
/// required String roomID,
/// String? meetingName,
/// String? ex,
/// int startTime = 0,
/// int endTime = 0,
/// bool participantCanUnmuteSelf = true,
/// bool participantCanEnableVideo = true,
/// bool onlyHostInviteUser = true,
/// bool onlyHostShareScreen = true,
/// bool joinDisableMicrophone = true,
/// bool joinDisableVideo = true,
/// bool isMuteAllVideo = true,
/// bool isMuteAllMicrophone = true,
/// List<String> addCanScreenUserIDList = const [],
/// List<String> reduceCanScreenUserIDList = const [],
/// List<String> addDisableMicrophoneUserIDList = const [],
/// List<String> reduceDisableMicrophoneUserIDList = const [],
/// List<String> addDisableVideoUserIDList = const [],
/// List<String> reduceDisableVideoUserIDList = const [],
/// List<String> addPinedUserIDList = const [],
/// List<String> reducePinedUserIDList = const [],
/// List<String> addBeWatchedUserIDList = const [],
/// List<String> reduceBeWatchedUserIDList = const [],
Future<dynamic> signalingUpdateMeetingInfo({
required Map info,
String? operationID,
}) {
if (info['meetingID'] != null) {
info['roomID'] = info['meetingID'];
}
assert(info['roomID'] != null);
return _channel.invokeMethod(
'signalingUpdateMeetingInfo',
_buildParam({
'info': info,
'operationID': Utils.checkOperationID(operationID),
}));
}
/// 创建会议室
/// [meetingName] 会议主题
/// [meetingHostUserID] 会议主持人ID
/// [startTime] 开始时间s
/// [meetingDuration] 会议时长s
/// [inviteeUserIDList] 被邀请人ID列表
/// [ex] 其他
Future<SignalingCertificate> signalingCreateMeeting({
required String meetingName,
String? meetingHostUserID,
int? startTime,
int? meetingDuration,
List<String> inviteeUserIDList = const [],
String? ex,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingCreateMeeting',
_buildParam({
'info': {
'meetingName': meetingName,
'meetingHostUserID': meetingHostUserID,
'startTime': startTime,
'meetingDuration': meetingDuration,
'inviteeUserIDList': inviteeUserIDList,
'ex': ex,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 加入会议室
/// [meetingID] 会议ID
/// [meetingName] 会议主题
/// [participantNickname] 加入房间显示的名称
Future<SignalingCertificate> signalingJoinMeeting({
required String meetingID,
String? meetingName,
String? participantNickname,
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingJoinMeeting',
_buildParam({
'info': {
'meetingID': meetingID,
'meetingName': meetingName,
'participantNickname': participantNickname,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
/// 会议室 管理员对指定的某一个入会人员设置禁言
/// [roomID] 会议ID
/// [streamType] video/audio
/// [userID] 被禁言的用户ID
/// [mute] true禁言
/// [muteAll] truevideo/audio 一起设置
Future<dynamic> signalingOperateStream({
required String roomID,
String? streamType,
required String userID,
bool mute = false,
bool muteAll = false,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingOperateStream',
_buildParam({
'roomID': roomID,
'streamType': streamType,
'userID': userID,
'mute': mute,
'muteAll': muteAll,
'operationID': Utils.checkOperationID(operationID),
}));
/// 获取所有的未完成会议
/// [roomID] 会议ID
Future<MeetingInfoList> signalingGetMeetings({
String? operationID,
}) =>
_channel
.invokeMethod(
'signalingGetMeetings',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (map) => MeetingInfoList.fromJson(map)));
/// 结束会议
/// [roomID] 会议ID
Future<dynamic> signalingCloseRoom({
required String roomID,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingCloseRoom',
_buildParam({
'roomID': roomID,
'operationID': Utils.checkOperationID(operationID),
}));
/// 自定义信令
/// [roomID] 会议ID
/// [customInfo] 自定义信令
Future<dynamic> signalingSendCustomSignal({
required String roomID,
required String customInfo,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingSendCustomSignal',
_buildParam({
'roomID': roomID,
'customInfo': customInfo,
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "signalingManager";
return param;

View File

@@ -48,9 +48,15 @@ class ConversationInfo {
/// 是否开启了私聊(阅后即焚)
bool? isPrivateChat;
/// 可阅读期限 s
int? burnDuration;
/// 附加内容
String? ext;
/// 附加内容
String? ex;
/// 是否还在组内如果退群返回true
bool? isNotInGroup;
@@ -68,8 +74,11 @@ class ConversationInfo {
this.draftText,
this.draftTextTime,
this.isPrivateChat,
this.burnDuration,
this.isPinned,
this.isNotInGroup,
this.ex,
this.ext,
});
ConversationInfo.fromJson(Map<String, dynamic> json)
@@ -93,8 +102,11 @@ class ConversationInfo {
draftTextTime = json['draftTextTime'];
isPinned = json['isPinned'];
isPrivateChat = json['isPrivateChat'];
burnDuration = json['burnDuration'];
isNotInGroup = json['isNotInGroup'];
groupAtType = json['groupAtType'];
ex = json['ex'];
ext = json['ext'];
}
Map<String, dynamic> toJson() {
@@ -113,14 +125,24 @@ class ConversationInfo {
data['draftTextTime'] = this.draftTextTime;
data['isPinned'] = this.isPinned;
data['isPrivateChat'] = this.isPrivateChat;
data['burnDuration'] = this.burnDuration;
data['isNotInGroup'] = this.isNotInGroup;
data['groupAtType'] = this.groupAtType;
data['ex'] = this.ex;
data['ext'] = this.ext;
return data;
}
/// 是单聊
bool get isSingleChat => conversationType == ConversationType.single;
bool get isGroupChat => conversationType == ConversationType.group;
/// 是群聊
bool get isGroupChat =>
conversationType == ConversationType.group ||
conversationType == ConversationType.superGroup;
/// 是有效的
bool get isValid => isSingleChat || isGroupChat && !isNotInGroup!;
@override
bool operator ==(Object other) =>

View File

@@ -32,7 +32,7 @@ class GroupInfo {
/// 创建者ID
String? creatorUserID;
/// 群类型
/// 群类型[GroupType]
int? groupType;
/// 扩展字段
@@ -41,6 +41,18 @@ class GroupInfo {
/// 进群验证方式[GroupVerification]
int? needVerification;
/// 不允许通过群获取成员资料 0关闭1打开
int? lookMemberInfo;
/// 不允许通过群添加好友 0关闭1打开
int? applyMemberFriend;
/// 通知更新时间
int? notificationUpdateTime;
/// 通知发起人
String? notificationUserID;
GroupInfo({
required this.groupID,
this.groupName,
@@ -55,6 +67,10 @@ class GroupInfo {
this.groupType,
this.ex,
this.needVerification,
this.lookMemberInfo,
this.applyMemberFriend,
this.notificationUpdateTime,
this.notificationUserID,
});
GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] {
@@ -71,6 +87,10 @@ class GroupInfo {
groupType = json['groupType'];
ex = json['ex'];
needVerification = json['needVerification'];
lookMemberInfo = json['lookMemberInfo'];
applyMemberFriend = json['applyMemberFriend'];
notificationUpdateTime = json['notificationUpdateTime'];
notificationUserID = json['notificationUserID'];
}
Map<String, dynamic> toJson() {
@@ -88,8 +108,27 @@ class GroupInfo {
data['groupType'] = this.groupType;
data['ex'] = this.ex;
data['needVerification'] = this.needVerification;
data['lookMemberInfo'] = this.lookMemberInfo;
data['applyMemberFriend'] = this.applyMemberFriend;
data['notificationUpdateTime'] = this.notificationUpdateTime;
data['notificationUserID'] = this.notificationUserID;
return data;
}
/// 群类型对应的会话类型
int get sessionType => groupType == GroupType.general
? ConversationType.group
: ConversationType.superGroup;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GroupInfo &&
runtimeType == other.runtimeType &&
groupID == other.groupID;
@override
int get hashCode => groupID.hashCode;
}
/// 群成员信息
@@ -112,7 +151,7 @@ class GroupMembersInfo {
/// 加入时间
int? joinTime;
/// 入群方式
/// 入群方式 2邀请加入 3搜索加入 4通过二维码加入
int? joinSource;
/// 操作者id
@@ -123,8 +162,13 @@ class GroupMembersInfo {
/// 禁言时间s
int? muteEndTime;
///
int? appMangerLevel;
/// 邀请人id
String? inviterUserID;
GroupMembersInfo({
this.groupID,
this.userID,
@@ -137,6 +181,7 @@ class GroupMembersInfo {
this.operatorUserID,
this.muteEndTime,
this.appMangerLevel,
this.inviterUserID,
});
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
@@ -151,6 +196,7 @@ class GroupMembersInfo {
operatorUserID = json['operatorUserID'];
muteEndTime = json['muteEndTime'];
appMangerLevel = json['appMangerLevel'];
inviterUserID = json['inviterUserID'];
}
Map<String, dynamic> toJson() {
@@ -166,8 +212,20 @@ class GroupMembersInfo {
data['operatorUserID'] = this.operatorUserID;
data['muteEndTime'] = this.muteEndTime;
data['appMangerLevel'] = this.appMangerLevel;
data['inviterUserID'] = this.inviterUserID;
return data;
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GroupMembersInfo &&
runtimeType == other.runtimeType &&
groupID == other.groupID &&
userID == other.userID;
@override
int get hashCode => groupID.hashCode ^ userID.hashCode;
}
/// 群成员角色
@@ -261,6 +319,12 @@ class GroupApplicationInfo {
/// 扩展信息
String? ex;
/// 2通过邀请 3通过搜索 4通过二维码
int? joinSource;
/// 邀请进群用户ID
String? inviterUserID;
GroupApplicationInfo({
this.groupID,
this.groupName,
@@ -284,6 +348,8 @@ class GroupApplicationInfo {
this.handleUserID,
this.handledTime,
this.ex,
this.inviterUserID,
this.joinSource,
});
GroupApplicationInfo.fromJson(Map<String, dynamic> json) {
@@ -309,6 +375,8 @@ class GroupApplicationInfo {
handleUserID = json['handleUserID'];
handledTime = json['handledTime'];
ex = json['ex'];
inviterUserID = json['inviterUserID'];
joinSource = json['joinSource'];
}
Map<String, dynamic> toJson() {
@@ -335,6 +403,8 @@ class GroupApplicationInfo {
data['handleUserID'] = this.handleUserID;
data['handledTime'] = this.handledTime;
data['ex'] = this.ex;
data['inviterUserID'] = this.inviterUserID;
data['joinSource'] = this.joinSource;
return data;
}
}

View File

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

View File

@@ -105,6 +105,10 @@ class Message {
/// 附加信息
AttachedInfoElem? attachedInfoElem;
bool? isReact;
bool? isExternal;
Message({
this.clientMsgID,
this.serverMsgID,
@@ -140,6 +144,8 @@ class Message {
this.notificationElem,
this.faceElem,
this.attachedInfoElem,
this.isExternal,
this.isReact,
});
Message.fromJson(Map<String, dynamic> json) {
@@ -200,6 +206,8 @@ class Message {
? AttachedInfoElem.fromJson(json['attachedInfoElem'])
: null;
hasReadTime = json['hasReadTime'] ?? attachedInfoElem?.hasReadTime;
isExternal = json['isExternal'];
isReact = json['isReact'];
}
Map<String, dynamic> toJson() {
@@ -238,6 +246,8 @@ class Message {
data['notificationElem'] = this.notificationElem?.toJson();
data['faceElem'] = this.faceElem?.toJson();
data['attachedInfoElem'] = this.attachedInfoElem?.toJson();
data['isExternal'] = this.isExternal;
data['isReact'] = this.isReact;
return data;
}
@@ -287,6 +297,14 @@ class Message {
faceElem = message.faceElem;
attachedInfoElem = message.attachedInfoElem;
}
/// 单聊消息
bool get isSingleChat => sessionType == ConversationType.single;
/// 群聊消息
bool get isGroupChat =>
sessionType == ConversationType.group ||
sessionType == ConversationType.superGroup;
}
/// 图片消息内容
@@ -782,6 +800,10 @@ class AttachedInfoElem {
/// 已读时间
int? hasReadTime;
/// 阅读时长 s
/// 即从hasReadTime时间算起超过了burnDuration秒触发销毁
int? burnDuration;
/// 离线不发送推送
bool? notSenderNotificationPush;
@@ -789,6 +811,7 @@ class AttachedInfoElem {
this.groupHasReadInfo,
this.isPrivateChat,
this.hasReadTime,
this.burnDuration,
this.notSenderNotificationPush,
});
@@ -798,6 +821,7 @@ class AttachedInfoElem {
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
isPrivateChat = json['isPrivateChat'];
hasReadTime = json['hasReadTime'];
burnDuration = json['burnDuration'];
notSenderNotificationPush = json['notSenderNotificationPush'];
}
@@ -806,6 +830,7 @@ class AttachedInfoElem {
data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson();
data['isPrivateChat'] = this.isPrivateChat;
data['hasReadTime'] = this.hasReadTime;
data['burnDuration'] = this.burnDuration;
data['notSenderNotificationPush'] = this.notSenderNotificationPush;
return data;
}
@@ -958,3 +983,313 @@ class AtUserInfo {
return data;
}
}
/// 消息撤回具体信息
class RevokedInfo {
/// 撤回者ID
String? revokerID;
/// 撤回者群角色 [GroupRoleLevel]
int? revokerRole;
/// 撤回者昵称
String? revokerNickname;
/// 消息id
String? clientMsgID;
/// 撤回时间
int? revokeTime;
/// 消息发送时间
int? sourceMessageSendTime;
/// 消息发送者
String? sourceMessageSendID;
/// 消息发送者昵称
String? sourceMessageSenderNickname;
/// 会话类型 [ConversationType]
int? sessionType;
RevokedInfo({
this.revokerID,
this.revokerRole,
this.revokerNickname,
this.clientMsgID,
this.revokeTime,
this.sourceMessageSendTime,
this.sourceMessageSendID,
this.sourceMessageSenderNickname,
this.sessionType,
});
RevokedInfo.fromJson(Map<String, dynamic> json) {
revokerID = json['revokerID'];
revokerRole = json['revokerRole'];
revokerNickname = json['revokerNickname'];
clientMsgID = json['clientMsgID'];
revokeTime = json['revokeTime'];
sourceMessageSendTime = json['sourceMessageSendTime'];
sourceMessageSendID = json['sourceMessageSendID'];
sourceMessageSenderNickname = json['sourceMessageSenderNickname'];
sessionType = json['sessionType'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['revokerID'] = this.revokerID;
data['revokerRole'] = this.revokerRole;
data['revokerNickname'] = this.revokerNickname;
data['clientMsgID'] = this.clientMsgID;
data['revokeTime'] = this.revokeTime;
data['sourceMessageSendTime'] = this.sourceMessageSendTime;
data['sourceMessageSendID'] = this.sourceMessageSendID;
data['sourceMessageSenderNickname'] = this.sourceMessageSenderNickname;
data['sessionType'] = this.sessionType;
return data;
}
}
class AdvancedMessage {
List<Message>? messageList;
bool? isEnd;
int? errCode;
String? errMsg;
int? lastMinSeq;
AdvancedMessage({
this.messageList,
this.isEnd,
this.errCode,
this.errMsg,
this.lastMinSeq,
});
AdvancedMessage.fromJson(Map<String, dynamic> json) {
messageList = json['messageList'] == null
? null
: (json['messageList'] as List)
.map((e) => Message.fromJson(e))
.toList();
isEnd = json['isEnd'];
errCode = json['errCode'];
errMsg = json['errMsg'];
lastMinSeq = json['lastMinSeq'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['messageList'] = this.messageList?.map((e) => e.toJson()).toList();
data['isEnd'] = this.isEnd;
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
data['lastMinSeq'] = this.lastMinSeq;
return data;
}
}
class RichMessageInfo {
String? type;
int? offset;
int? length;
String? url;
String? info;
RichMessageInfo({
this.type,
this.offset,
this.length,
this.url,
this.info,
});
RichMessageInfo.fromJson(Map<String, dynamic> json) {
type = json['type'];
offset = json['offset'];
length = json['length'];
url = json['url'];
info = json['info'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['type'] = this.type;
data['offset'] = this.offset;
data['length'] = this.length;
data['url'] = this.url;
data['info'] = this.info;
return data;
}
}
///////////////////// 消息修改相关/////////////////////
////////////////////////////////////////////////////
class KeyValue {
String? typeKey;
String? value;
int? latestUpdateTime;
KeyValue({this.typeKey, this.value, this.latestUpdateTime});
KeyValue.fromJson(Map<String, dynamic> json) {
typeKey = json['typeKey'];
value = json['value'];
latestUpdateTime = json['latestUpdateTime'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['typeKey'] = this.typeKey;
data['value'] = this.value;
data['latestUpdateTime'] = this.latestUpdateTime;
return data;
}
}
class UserExInfo {
String? userID;
String? ex;
UserExInfo({this.userID, this.ex});
UserExInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
ex = json['ex'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['userID'] = this.userID;
data['ex'] = this.ex;
return data;
}
}
class SingleTypeKeyInfoSum {
String? typeKey;
int? counter;
List<UserExInfo>? infoList;
bool? isContainSelf;
SingleTypeKeyInfoSum({
this.typeKey,
this.counter,
this.infoList,
this.isContainSelf,
});
SingleTypeKeyInfoSum.fromJson(Map<String, dynamic> json) {
typeKey = json['typeKey'];
counter = json['counter'];
infoList = json['infoList'] == null
? null
: (json['infoList'] as List)
.map((e) => UserExInfo.fromJson(e))
.toList();
isContainSelf = json['isContainSelf'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['typeKey'] = this.typeKey;
data['counter'] = this.counter;
data['infoList'] = this.infoList?.map((e) => e.toJson()).toList();
data['isContainSelf'] = this.isContainSelf;
return data;
}
}
class MessageKv {
String? clientMsgID;
List<SingleTypeKeyInfoSum>? changedKvList;
MessageKv({this.clientMsgID, this.changedKvList});
MessageKv.fromJson(Map<String, dynamic> json) {
clientMsgID = json['clientMsgID'];
changedKvList = json['changedKvList'] == null
? null
: (json['changedKvList'] as List)
.map((e) => SingleTypeKeyInfoSum.fromJson(e))
.toList();
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['clientMsgID'] = this.clientMsgID;
data['changedKvList'] = this.changedKvList?.map((e) => e.toJson()).toList();
return data;
}
}
class TypeKeySetResult {
int? errCode;
String? errMsg;
String? typeKey;
int? latestUpdateTime;
String? value;
TypeKeySetResult(
{this.errCode,
this.errMsg,
this.typeKey,
this.latestUpdateTime,
this.value});
TypeKeySetResult.fromJson(Map<String, dynamic> json) {
errCode = json['errCode'];
errMsg = json['errMsg'];
typeKey = json['typeKey'];
latestUpdateTime = json['latestUpdateTime'];
value = json['value'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
data['typeKey'] = this.typeKey;
data['latestUpdateTime'] = this.latestUpdateTime;
data['value'] = this.value;
return data;
}
}
class MessageTypeKeyMapping {
int? errCode;
String? errMsg;
Map<String, KeyValue>? reactionExtensionList;
String? clientMsgID;
MessageTypeKeyMapping(
{this.errCode,
this.errMsg,
this.reactionExtensionList,
this.clientMsgID});
MessageTypeKeyMapping.fromJson(Map<String, dynamic> json) {
errCode = json['errCode'];
errMsg = json['errMsg'];
reactionExtensionList = json['reactionExtensionList'] != null
? (json['reactionExtensionList'] as Map)
.map((key, value) => MapEntry(key, KeyValue.fromJson(value)))
: null;
clientMsgID = json['clientMsgID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
if (this.reactionExtensionList != null) {
data['reactionExtensionList'] = this
.reactionExtensionList!
.map((key, value) => MapEntry(key, value.toJson()));
}
data['clientMsgID'] = this.clientMsgID;
return data;
}
}

View File

@@ -33,6 +33,8 @@ class DeptInfo {
/// 附加信息
String? attachedInfo;
String? relatedGroupID;
DeptInfo(
{this.departmentID,
this.faceURL,
@@ -44,7 +46,8 @@ class DeptInfo {
this.subDepartmentNum,
this.memberNum,
this.ex,
this.attachedInfo});
this.attachedInfo,
this.relatedGroupID});
DeptInfo.fromJson(Map<String, dynamic> json) {
departmentID = json['departmentID'];
@@ -58,6 +61,7 @@ class DeptInfo {
memberNum = json['memberNum'];
ex = json['ex'];
attachedInfo = json['attachedInfo'];
relatedGroupID = json['relatedGroupID'];
}
Map<String, dynamic> toJson() {
@@ -73,6 +77,7 @@ class DeptInfo {
data['memberNum'] = this.memberNum;
data['ex'] = this.ex;
data['attachedInfo'] = this.attachedInfo;
data['relatedGroupID'] = this.relatedGroupID;
return data;
}
@@ -134,6 +139,12 @@ class DeptMemberInfo {
/// 创建时间
int? createTime;
/// 入职时间
int? entryTime;
/// 离职时间
int? terminationTime;
/// 扩展字段
String? ex;
@@ -146,6 +157,9 @@ class DeptMemberInfo {
/// 所在部门的所有上级部门
List<DeptInfo>? parentDepartmentList;
/// 当前部门信息
DeptInfo? department;
DeptMemberInfo({
this.userID,
this.nickname,
@@ -166,6 +180,7 @@ class DeptMemberInfo {
this.attachedInfo,
this.departmentName,
this.parentDepartmentList,
this.department,
});
DeptMemberInfo.fromJson(Map<String, dynamic> json) {
@@ -193,6 +208,9 @@ class DeptMemberInfo {
parentDepartmentList!.add(DeptInfo.fromJson(v));
});
}
department = json['department'] == null
? null
: DeptInfo.fromJson(json['department']);
}
Map<String, dynamic> toJson() {
@@ -219,6 +237,7 @@ class DeptMemberInfo {
data['parentDepartmentList'] =
this.parentDepartmentList!.map((v) => v.toJson()).toList();
}
data['department'] = this.department?.toJson();
return data;
}
@@ -263,7 +282,7 @@ class UserInDept {
}
}
/// 部门下的子部门跟员工
/// 部门下的一级子部门跟员工
class DeptMemberAndSubDept {
/// 一级子部门
List<DeptInfo>? departmentList;

View File

@@ -7,6 +7,8 @@ class SearchResult {
/// 搜索到的具体内容
List<SearchResultItems>? searchResultItems;
List<SearchResultItems>? findResultItems;
SearchResult({this.totalCount, this.searchResultItems});
SearchResult.fromJson(Map<String, dynamic> json) {
@@ -17,6 +19,12 @@ class SearchResult {
searchResultItems!.add(SearchResultItems.fromJson(v));
});
}
if (json['findResultItems'] != null) {
findResultItems = <SearchResultItems>[];
json['findResultItems'].forEach((v) {
findResultItems!.add(SearchResultItems.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
@@ -26,6 +34,10 @@ class SearchResult {
data['searchResultItems'] =
this.searchResultItems!.map((v) => v.toJson()).toList();
}
if (this.findResultItems != null) {
data['findResultItems'] =
this.findResultItems!.map((v) => v.toJson()).toList();
}
return data;
}
}
@@ -78,3 +90,27 @@ class SearchResultItems {
return data;
}
}
class SearchParams {
String? conversationID;
List<String>? clientMsgIDList;
SearchParams({
this.conversationID,
this.clientMsgIDList,
});
SearchParams.fromJson(Map<String, dynamic> json) {
conversationID = json['conversationID'];
if (json['clientMsgIDList'] != null) {
clientMsgIDList = json['clientMsgIDList'].cast<String>();
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['conversationID'] = this.conversationID;
data['clientMsgIDList'] = this.clientMsgIDList;
return data;
}
}

View File

@@ -114,12 +114,23 @@ class SignalingCertificate {
/// 服务器地址
String? liveURL;
SignalingCertificate({this.token, this.roomID, this.liveURL});
/// 占线列表
List<String>? busyLineUserIDList;
SignalingCertificate({
this.token,
this.roomID,
this.liveURL,
this.busyLineUserIDList,
});
SignalingCertificate.fromJson(Map<String, dynamic> json) {
token = json['token'];
roomID = json['roomID'];
liveURL = json['liveURL'];
busyLineUserIDList = null == json['busyLineUserIDList']
? null
: json['busyLineUserIDList'].cast<String>();
}
Map<String, dynamic> toJson() {
@@ -127,6 +138,108 @@ class SignalingCertificate {
data['token'] = this.token;
data['roomID'] = this.roomID;
data['liveURL'] = this.liveURL;
data['busyLineUserIDList'] = this.busyLineUserIDList;
return data;
}
}
class RoomCallingInfo {
InvitationInfo? invitation;
List<Participant>? participant;
String? roomID;
String? token;
String? liveURL;
String? groupID;
RoomCallingInfo({
this.invitation,
this.participant,
this.roomID,
this.token,
this.liveURL,
this.groupID,
});
RoomCallingInfo.fromJson(Map<String, dynamic> json) {
invitation = json['invitation'] != null
? InvitationInfo.fromJson(json['invitation'])
: null;
if (json['participant'] != null) {
participant = <Participant>[];
json['participant'].forEach((v) {
participant!.add(Participant.fromJson(v));
});
}
roomID = json['roomID'] ?? invitation?.roomID;
token = json['token'];
liveURL = json['liveURL'];
groupID = json['groupID'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.invitation != null) {
data['invitation'] = this.invitation!.toJson();
}
if (this.participant != null) {
data['participant'] = this.participant!.map((v) => v.toJson()).toList();
}
data['roomID'] = this.roomID;
data['token'] = this.token;
data['liveURL'] = this.liveURL;
data['groupID'] = this.groupID;
return data;
}
}
class Participant {
GroupInfo? groupInfo;
GroupMembersInfo? groupMemberInfo;
UserInfo? userInfo;
Participant({this.groupInfo, this.groupMemberInfo, this.userInfo});
Participant.fromJson(Map<String, dynamic> json) {
groupInfo = json['groupInfo'] != null
? GroupInfo.fromJson(json['groupInfo'])
: null;
groupMemberInfo = json['groupMemberInfo'] != null
? GroupMembersInfo.fromJson(json['groupMemberInfo'])
: null;
userInfo =
json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.groupInfo != null) {
data['groupInfo'] = this.groupInfo!.toJson();
}
if (this.groupMemberInfo != null) {
data['groupMemberInfo'] = this.groupMemberInfo!.toJson();
}
if (this.userInfo != null) {
data['userInfo'] = this.userInfo!.toJson();
}
return data;
}
}
class CustomSignaling {
String? roomID;
String? customInfo;
CustomSignaling({this.roomID, this.customInfo});
CustomSignaling.fromJson(Map<String, dynamic> json) {
roomID = json['roomID'];
customInfo = json['customInfo'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['roomID'] = roomID;
data['customInfo'] = customInfo;
return data;
}
}

View File

@@ -20,9 +20,12 @@ class UserInfo {
/// 手机号
String? phoneNumber;
/// 出生时间
/// 使用[birthTime]
int? birth;
/// 出生时间
String? birthTime;
/// 邮箱
String? email;
@@ -53,6 +56,18 @@ class UserInfo {
/// 全局免打扰 0正常1不接受消息2接受在线消息不接受离线消息
int? globalRecvMsgOpt;
/// 是允许添加为好友 1允许2
int? allowAddFriend;
/// 新消息铃声 1允许2
int? allowBeep;
/// 新消息震动 1允许2
int? allowVibration;
/// 禁止登录
int? forbidden;
UserInfo({
this.publicInfo,
this.friendInfo,
@@ -65,12 +80,17 @@ class UserInfo {
this.faceURL,
this.phoneNumber,
this.birth,
this.birthTime,
this.gender,
this.email,
this.ex,
this.createTime,
this.remark,
this.globalRecvMsgOpt,
this.allowAddFriend,
this.allowBeep,
this.allowVibration,
this.forbidden,
});
// UserInfo.self(Map<String, dynamic> json) {
@@ -105,11 +125,16 @@ class UserInfo {
gender = json['gender'] ?? _gender;
phoneNumber = json['phoneNumber'] ?? _phoneNumber;
birth = json['birth'] ?? _birth;
birthTime = json['birthTime'] ?? _birthTime;
email = json['email'] ?? _email;
remark = json['remark'] ?? _remark;
ex = json['ex'] ?? _ex;
createTime = json['createTime'];
globalRecvMsgOpt = json['globalRecvMsgOpt'];
allowAddFriend = json['allowAddFriend'];
allowBeep = json['allowBeep'];
allowVibration = json['allowVibration'];
forbidden = json['forbidden'];
}
Map<String, dynamic> toJson() {
@@ -126,11 +151,16 @@ class UserInfo {
data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['birthTime'] = this.birthTime;
data['email'] = this.email;
data['ex'] = this.ex;
data['createTime'] = this.createTime;
data['remark'] = this.remark;
data['globalRecvMsgOpt'] = this.globalRecvMsgOpt;
data['allowAddFriend'] = this.allowAddFriend;
data['allowBeep'] = this.allowBeep;
data['allowVibration'] = this.allowVibration;
data['forbidden'] = this.forbidden;
return data;
}
@@ -164,6 +194,8 @@ class UserInfo {
int? get _birth => friendInfo?.birth;
String? get _birthTime => friendInfo?.birthTime;
String? get _email => friendInfo?.email;
String? get _remark => friendInfo?.remark;
@@ -254,6 +286,9 @@ class FriendInfo {
String? phoneNumber;
/// 出生日期
String? birthTime;
/// 使用[birthTime]
int? birth;
/// 邮箱
@@ -281,6 +316,7 @@ class FriendInfo {
this.gender,
this.phoneNumber,
this.birth,
this.birthTime,
this.email,
this.remark,
this.ex,
@@ -301,6 +337,7 @@ class FriendInfo {
gender = json['gender'];
phoneNumber = json['phoneNumber'];
birth = json['birth'];
birthTime = json['birthTime'];
email = json['email'];
ex = json['ex'];
}
@@ -318,10 +355,18 @@ class FriendInfo {
data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['birthTime'] = this.birthTime;
data['email'] = this.email;
data['ex'] = this.ex;
return data;
}
String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!;
static String? _isNull(String? value) {
if (value == null || value.trim().isEmpty) return null;
return value;
}
}
/// 黑名单信息

View File

@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OpenIM {
static const version = '2.1.0';
static const version = '2.3.5+3';
static const _channel = const MethodChannel('flutter_openim_sdk');

View File

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

View File

@@ -5,51 +5,50 @@ 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.16.0"
version: "1.17.0"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@@ -60,34 +59,46 @@ packages:
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.4"
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.1"
version: "1.8.2"
sky_engine:
dependency: transitive
description: flutter
@@ -97,51 +108,58 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.2"
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.9"
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.2"
version: "2.1.4"
sdks:
dart: ">=2.17.0-0 <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=1.20.0"

View File

@@ -1,6 +1,6 @@
name: flutter_openim_sdk
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
version: 2.1.0+1
version: 2.3.5+3
homepage: https://www.rentsoft.cn
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter