Update
This commit is contained in:
parent
099cb9849a
commit
b8a51374a3
@ -2,6 +2,8 @@
|
||||
|
||||
- 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
|
||||
|
||||
|
@ -34,5 +34,5 @@ android {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
api 'io.openim:core-sdk:2.3.4-rc4@aar'
|
||||
api 'io.openim:core-sdk:2.3.4-rc6@aar'
|
||||
}
|
@ -34,6 +34,11 @@ 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);
|
||||
|
@ -114,4 +114,12 @@ public class SignalingManager extends BaseManager {
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.3.4+1"
|
||||
version: "2.3.4+5"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
@ -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"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,6 +20,7 @@ public class SignalingManager: BaseServiceManager {
|
||||
self["signalingOperateStream"] = signalingOperateStream
|
||||
self["signalingGetMeetings"] = signalingGetMeetings
|
||||
self["signalingCloseRoom"] = signalingCloseRoom
|
||||
self["signalingSendCustomSignal"] = signalingSendCustomSignal
|
||||
}
|
||||
|
||||
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -82,9 +83,14 @@ public class SignalingManager: BaseServiceManager {
|
||||
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) {
|
||||
@ -135,4 +141,8 @@ public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListene
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ class OnSignalingListener {
|
||||
final Function(RoomCallingInfo info)? onRoomParticipantConnected;
|
||||
final Function(RoomCallingInfo info)? onRoomParticipantDisconnected;
|
||||
final Function(MeetingStreamEvent event)? onMeetingStreamChanged;
|
||||
final Function(CustomSignaling info)? onReceiveCustomSignal;
|
||||
|
||||
OnSignalingListener({
|
||||
this.onInvitationCancelled,
|
||||
@ -26,6 +27,7 @@ class OnSignalingListener {
|
||||
this.onRoomParticipantConnected,
|
||||
this.onRoomParticipantDisconnected,
|
||||
this.onMeetingStreamChanged,
|
||||
this.onReceiveCustomSignal,
|
||||
});
|
||||
|
||||
/// 被邀请者收到:邀请者取消音视频通话
|
||||
@ -79,4 +81,8 @@ class OnSignalingListener {
|
||||
void streamChangedEvent(MeetingStreamEvent event) {
|
||||
onMeetingStreamChanged?.call(event);
|
||||
}
|
||||
|
||||
void receiveCustomSignal(CustomSignaling info) {
|
||||
onReceiveCustomSignal?.call(info);
|
||||
}
|
||||
}
|
||||
|
@ -254,6 +254,9 @@ class IMManager {
|
||||
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;
|
||||
@ -292,6 +295,9 @@ class IMManager {
|
||||
case 'onStreamChange':
|
||||
signalingManager.listener.streamChangedEvent(info);
|
||||
break;
|
||||
case 'onReceiveCustomSignal':
|
||||
signalingManager.listener.receiveCustomSignal(info);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.workMomentsListener) {
|
||||
String type = call.arguments['type'];
|
||||
@ -332,6 +338,7 @@ class IMManager {
|
||||
int logLevel = 6,
|
||||
String objectStorage = 'cos',
|
||||
String? encryptionKey,
|
||||
bool enabledEncryption = false,
|
||||
String? operationID,
|
||||
}) {
|
||||
this._connectListener = listener;
|
||||
@ -347,6 +354,7 @@ class IMManager {
|
||||
"log_level": logLevel,
|
||||
"object_storage": objectStorage,
|
||||
"encryption_key": encryptionKey,
|
||||
"is_need_encryption": enabledEncryption,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
},
|
||||
));
|
||||
|
@ -823,9 +823,9 @@ class MessageManager {
|
||||
.invokeMethod(
|
||||
'createImageMessageByURL',
|
||||
_buildParam({
|
||||
'sourcePicture': sourcePicture,
|
||||
'bigPicture': bigPicture,
|
||||
'snapshotPicture': snapshotPicture,
|
||||
'sourcePicture': sourcePicture.toJson(),
|
||||
'bigPicture': bigPicture.toJson(),
|
||||
'snapshotPicture': snapshotPicture.toJson(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}),
|
||||
)
|
||||
@ -840,7 +840,7 @@ class MessageManager {
|
||||
.invokeMethod(
|
||||
'createSoundMessageByURL',
|
||||
_buildParam({
|
||||
'soundElem': soundElem,
|
||||
'soundElem': soundElem.toJson(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}),
|
||||
)
|
||||
@ -855,7 +855,7 @@ class MessageManager {
|
||||
.invokeMethod(
|
||||
'createVideoMessageByURL',
|
||||
_buildParam({
|
||||
'videoElem': videoElem,
|
||||
'videoElem': videoElem.toJson(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
@ -869,7 +869,7 @@ class MessageManager {
|
||||
.invokeMethod(
|
||||
'createFileMessageByURL',
|
||||
_buildParam({
|
||||
'fileElem': fileElem,
|
||||
'fileElem': fileElem.toJson(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
@ -281,6 +281,22 @@ class SignalingManager {
|
||||
'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;
|
||||
|
@ -790,7 +790,8 @@ class AttachedInfoElem {
|
||||
/// 已读时间
|
||||
int? hasReadTime;
|
||||
|
||||
/// 私聊消息保留时长
|
||||
/// 阅读时长 s
|
||||
/// 即从hasReadTime时间算起,超过了burnDuration秒触发销毁
|
||||
int? burnDuration;
|
||||
|
||||
/// 离线不发送推送
|
||||
|
@ -224,3 +224,22 @@ class Participant {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user