Add some new function
This commit is contained in:
parent
a77c86e87a
commit
b8ee9276a2
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,3 +1,19 @@
|
|||||||
|
## 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
|
## 2.3.4+1
|
||||||
|
|
||||||
- Add signalingGetTokenByRoomID method for SignalingManager
|
- Add signalingGetTokenByRoomID method for SignalingManager
|
||||||
|
@ -41,5 +41,5 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.openim:core-sdk:2.3.4@aar'
|
implementation 'io.openim:core-sdk:2.3.4-rc0@aar'
|
||||||
}
|
}
|
@ -49,6 +49,11 @@ public class OnSignalingListener implements open_im_sdk_callback.OnSignalingList
|
|||||||
CommonUtil.emitEvent("signalingListener", "onRoomParticipantDisconnected", s);
|
CommonUtil.emitEvent("signalingListener", "onRoomParticipantDisconnected", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStreamChange(String s) {
|
||||||
|
CommonUtil.emitEvent("signalingListener", "onStreamChange", s);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHangUp(String s) {
|
public void onHangUp(String s) {
|
||||||
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
|
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
|
||||||
|
@ -412,7 +412,7 @@ public class MessageManager extends BaseManager {
|
|||||||
Open_im_sdk.findMessageList(
|
Open_im_sdk.findMessageList(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "options")
|
jsonValue(methodCall, "searchParams")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,4 +434,45 @@ public class MessageManager extends BaseManager {
|
|||||||
jsonValue(methodCall, "richMessageInfoList")
|
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")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,4 +67,49 @@ public class SignalingManager extends BaseManager {
|
|||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "roomID"));
|
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"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,11 @@ public class MessageManager: BaseServiceManager {
|
|||||||
self["findMessageList"] = findMessageList
|
self["findMessageList"] = findMessageList
|
||||||
self["createAdvancedTextMessage"] = createAdvancedTextMessage
|
self["createAdvancedTextMessage"] = createAdvancedTextMessage
|
||||||
self["createAdvancedQuoteMessage"] = createAdvancedQuoteMessage
|
self["createAdvancedQuoteMessage"] = createAdvancedQuoteMessage
|
||||||
|
self["sendMessageNotOss"] = sendMessageNotOss
|
||||||
|
self["createImageMessageByURL"] = createImageMessageByURL
|
||||||
|
self["createSoundMessageByURL"] = createSoundMessageByURL
|
||||||
|
self["createVideoMessageByURL"] = createVideoMessageByURL
|
||||||
|
self["createFileMessageByURL"] = createFileMessageByURL
|
||||||
}
|
}
|
||||||
|
|
||||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@ -238,7 +243,29 @@ public class MessageManager: BaseServiceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkFindMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "options"])
|
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"]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,12 @@ public class SignalingManager: BaseServiceManager {
|
|||||||
self["signalingHungUp"] = signalingHungUp
|
self["signalingHungUp"] = signalingHungUp
|
||||||
self["signalingGetRoomByGroupID"] = signalingGetRoomByGroupID
|
self["signalingGetRoomByGroupID"] = signalingGetRoomByGroupID
|
||||||
self["signalingGetTokenByRoomID"] = signalingGetTokenByRoomID
|
self["signalingGetTokenByRoomID"] = signalingGetTokenByRoomID
|
||||||
|
self["signalingUpdateMeetingInfo"] = signalingUpdateMeetingInfo
|
||||||
|
self["signalingCreateMeeting"] = signalingCreateMeeting
|
||||||
|
self["signalingJoinMeeting"] = signalingJoinMeeting
|
||||||
|
self["signalingOperateStream"] = signalingOperateStream
|
||||||
|
self["signalingGetMeetings"] = signalingGetMeetings
|
||||||
|
self["signalingCloseRoom"] = signalingCloseRoom
|
||||||
}
|
}
|
||||||
|
|
||||||
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@ -52,9 +58,33 @@ public class SignalingManager: BaseServiceManager {
|
|||||||
func signalingGetTokenByRoomID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func signalingGetTokenByRoomID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkSignalingGetTokenByRoomID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
|
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"])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
|
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
|
||||||
|
|
||||||
private let channel:FlutterMethodChannel
|
private let channel:FlutterMethodChannel
|
||||||
|
|
||||||
init(channel:FlutterMethodChannel) {
|
init(channel:FlutterMethodChannel) {
|
||||||
@ -100,4 +130,9 @@ public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListene
|
|||||||
public func onRoomParticipantDisconnected(_ s: String?) {
|
public func onRoomParticipantDisconnected(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantDisconnected", errCode: nil, errMsg: nil, data: s)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ export 'src/manager/im_user_manager.dart';
|
|||||||
export 'src/manager/im_workmoments_manager.dart';
|
export 'src/manager/im_workmoments_manager.dart';
|
||||||
export 'src/models/conversation_info.dart';
|
export 'src/models/conversation_info.dart';
|
||||||
export 'src/models/group_info.dart';
|
export 'src/models/group_info.dart';
|
||||||
|
export 'src/models/meeting_info.dart';
|
||||||
export 'src/models/message.dart';
|
export 'src/models/message.dart';
|
||||||
export 'src/models/notification_info.dart';
|
export 'src/models/notification_info.dart';
|
||||||
export 'src/models/organization_info.dart';
|
export 'src/models/organization_info.dart';
|
||||||
|
@ -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 {
|
class OnSignalingListener {
|
||||||
@ -12,6 +12,7 @@ class OnSignalingListener {
|
|||||||
final Function(SignalingInfo info)? onHangup;
|
final Function(SignalingInfo info)? onHangup;
|
||||||
final Function(RoomCallingInfo info)? onRoomParticipantConnected;
|
final Function(RoomCallingInfo info)? onRoomParticipantConnected;
|
||||||
final Function(RoomCallingInfo info)? onRoomParticipantDisconnected;
|
final Function(RoomCallingInfo info)? onRoomParticipantDisconnected;
|
||||||
|
final Function(MeetingStreamEvent event)? onMeetingStreamChanged;
|
||||||
|
|
||||||
OnSignalingListener({
|
OnSignalingListener({
|
||||||
this.onInvitationCancelled,
|
this.onInvitationCancelled,
|
||||||
@ -24,6 +25,7 @@ class OnSignalingListener {
|
|||||||
this.onHangup,
|
this.onHangup,
|
||||||
this.onRoomParticipantConnected,
|
this.onRoomParticipantConnected,
|
||||||
this.onRoomParticipantDisconnected,
|
this.onRoomParticipantDisconnected,
|
||||||
|
this.onMeetingStreamChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// 被邀请者收到:邀请者取消音视频通话
|
/// 被邀请者收到:邀请者取消音视频通话
|
||||||
@ -73,4 +75,8 @@ class OnSignalingListener {
|
|||||||
void roomParticipantDisconnected(RoomCallingInfo info) {
|
void roomParticipantDisconnected(RoomCallingInfo info) {
|
||||||
onRoomParticipantDisconnected?.call(info);
|
onRoomParticipantDisconnected?.call(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void streamChangedEvent(MeetingStreamEvent event) {
|
||||||
|
onMeetingStreamChanged?.call(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,6 +250,10 @@ class IMManager {
|
|||||||
case 'onRoomParticipantDisconnected':
|
case 'onRoomParticipantDisconnected':
|
||||||
info = Utils.toObj(data, (map) => RoomCallingInfo.fromJson(map));
|
info = Utils.toObj(data, (map) => RoomCallingInfo.fromJson(map));
|
||||||
break;
|
break;
|
||||||
|
case 'onStreamChange':
|
||||||
|
info =
|
||||||
|
Utils.toObj(data, (map) => MeetingStreamEvent.fromJson(map));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
|
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
|
||||||
break;
|
break;
|
||||||
@ -285,6 +289,9 @@ class IMManager {
|
|||||||
case 'onRoomParticipantDisconnected':
|
case 'onRoomParticipantDisconnected':
|
||||||
signalingManager.listener.roomParticipantDisconnected(info);
|
signalingManager.listener.roomParticipantDisconnected(info);
|
||||||
break;
|
break;
|
||||||
|
case 'onStreamChange':
|
||||||
|
signalingManager.listener.streamChangedEvent(info);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.workMomentsListener) {
|
} else if (call.method == ListenerType.workMomentsListener) {
|
||||||
String type = call.arguments['type'];
|
String type = call.arguments['type'];
|
||||||
|
@ -735,18 +735,14 @@ class MessageManager {
|
|||||||
/// [conversationID] 会话id
|
/// [conversationID] 会话id
|
||||||
/// [clientMsgIDList] 消息id列表
|
/// [clientMsgIDList] 消息id列表
|
||||||
Future<SearchResult> findMessageList({
|
Future<SearchResult> findMessageList({
|
||||||
required String conversationID,
|
required List<SearchParams> searchParams,
|
||||||
required List<String> clientMsgIDList,
|
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel
|
_channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
'findMessageList',
|
'findMessageList',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'options': {
|
'searchParams': searchParams.map((e) => e.toJson()),
|
||||||
"conversationID": conversationID,
|
|
||||||
"clientMsgIDList": clientMsgIDList,
|
|
||||||
},
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) =>
|
||||||
@ -792,6 +788,92 @@ class MessageManager {
|
|||||||
}))
|
}))
|
||||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
.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,
|
||||||
|
'bigPicture': bigPicture,
|
||||||
|
'snapshotPicture': snapshotPicture,
|
||||||
|
"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,
|
||||||
|
"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,
|
||||||
|
"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,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
return param;
|
return param;
|
||||||
|
@ -135,6 +135,152 @@ class SignalingManager {
|
|||||||
(map) => SignalingCertificate.fromJson(
|
(map) => SignalingCertificate.fromJson(
|
||||||
map..addAll({'roomID': roomID}))));
|
map..addAll({'roomID': roomID}))));
|
||||||
|
|
||||||
|
/// 会议设置
|
||||||
|
/// required String roomID,
|
||||||
|
/// String? meetingName,
|
||||||
|
/// String? ex,
|
||||||
|
/// int startTime = 0,
|
||||||
|
/// int endTime = 0,
|
||||||
|
/// bool participantCanUnmuteSelf = true,
|
||||||
|
/// bool participantCanEnableVideo = true,
|
||||||
|
/// bool onlyHostInviteUser = true,
|
||||||
|
/// bool onlyHostShareScreen = true,
|
||||||
|
/// bool joinDisableMicrophone = true,
|
||||||
|
/// bool joinDisableVideo = true,
|
||||||
|
/// bool isMuteAllVideo = true,
|
||||||
|
/// bool isMuteAllMicrophone = true,
|
||||||
|
/// List<String> addCanScreenUserIDList = const [],
|
||||||
|
/// List<String> reduceCanScreenUserIDList = const [],
|
||||||
|
/// List<String> addDisableMicrophoneUserIDList = const [],
|
||||||
|
/// List<String> reduceDisableMicrophoneUserIDList = const [],
|
||||||
|
/// List<String> addDisableVideoUserIDList = const [],
|
||||||
|
/// List<String> reduceDisableVideoUserIDList = const [],
|
||||||
|
/// List<String> addPinedUserIDList = const [],
|
||||||
|
/// List<String> reducePinedUserIDList = const [],
|
||||||
|
/// List<String> addBeWatchedUserIDList = const [],
|
||||||
|
/// List<String> reduceBeWatchedUserIDList = const [],
|
||||||
|
Future<dynamic> signalingUpdateMeetingInfo({
|
||||||
|
required Map info,
|
||||||
|
String? operationID,
|
||||||
|
}) {
|
||||||
|
assert(info['roomID'] != null);
|
||||||
|
return _channel.invokeMethod(
|
||||||
|
'signalingUpdateMeetingInfo',
|
||||||
|
_buildParam({
|
||||||
|
'info': info,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 创建会议室
|
||||||
|
/// [meetingName] 会议主题
|
||||||
|
/// [meetingHostUserID] 会议主持人ID
|
||||||
|
/// [startTime] 开始时间s
|
||||||
|
/// [meetingDuration] 会议时长s
|
||||||
|
/// [inviteeUserIDList] 被邀请人ID列表
|
||||||
|
/// [ex] 其他
|
||||||
|
Future<SignalingCertificate> signalingCreateMeeting({
|
||||||
|
required String meetingName,
|
||||||
|
String? meetingHostUserID,
|
||||||
|
int? startTime,
|
||||||
|
int? meetingDuration,
|
||||||
|
List<String> inviteeUserIDList = const [],
|
||||||
|
String? ex,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'signalingCreateMeeting',
|
||||||
|
_buildParam({
|
||||||
|
'info': {
|
||||||
|
'meetingName': meetingName,
|
||||||
|
'meetingHostUserID': meetingHostUserID,
|
||||||
|
'startTime': startTime,
|
||||||
|
'meetingDuration': meetingDuration,
|
||||||
|
'inviteeUserIDList': inviteeUserIDList,
|
||||||
|
'ex': ex,
|
||||||
|
},
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||||
|
|
||||||
|
/// 加入会议室
|
||||||
|
/// [meetingID] 会议ID
|
||||||
|
/// [meetingName] 会议主题
|
||||||
|
/// [participantNickname] 加入房间显示的名称
|
||||||
|
Future<SignalingCertificate> signalingJoinMeeting({
|
||||||
|
required String meetingID,
|
||||||
|
String? meetingName,
|
||||||
|
String? participantNickname,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'signalingJoinMeeting',
|
||||||
|
_buildParam({
|
||||||
|
'info': {
|
||||||
|
'meetingID': meetingID,
|
||||||
|
'meetingName': meetingName,
|
||||||
|
'participantNickname': participantNickname,
|
||||||
|
},
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||||
|
|
||||||
|
/// 会议室 管理员对指定的某一个入会人员设置禁言
|
||||||
|
/// [roomID] 会议ID
|
||||||
|
/// [streamType] video/audio
|
||||||
|
/// [userID] 被禁言的用户ID
|
||||||
|
/// [mute] true:禁言
|
||||||
|
/// [muteAll] true:video/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),
|
||||||
|
}));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "signalingManager";
|
param["ManagerName"] = "signalingManager";
|
||||||
return param;
|
return param;
|
||||||
|
106
lib/src/models/meeting_info.dart
Normal file
106
lib/src/models/meeting_info.dart
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -78,3 +78,27 @@ class SearchResultItems {
|
|||||||
return data;
|
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['messageCount'] = this.clientMsgIDList;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_openim_sdk
|
name: flutter_openim_sdk
|
||||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||||
version: 2.3.4+1
|
version: 2.3.4+2
|
||||||
homepage: https://www.rentsoft.cn
|
homepage: https://www.rentsoft.cn
|
||||||
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user