main
hrxiang 3 years ago
parent bb49d6b27a
commit b53d4dfcfd
  1. 4
      CHANGELOG.md
  2. 7
      android/src/main/java/io/openim/flutter_openim_sdk/manager/SignalingManager.java
  3. 18
      lib/src/manager/im_signaling_manager.dart
  4. 33
      lib/src/models/signaling_info.dart
  5. 2
      pubspec.yaml

@ -1,3 +1,7 @@
## 2.3.4+1
- Add signalingGetTokenByRoomID method for SignalingManager
## 2.3.4
- Fix bug

@ -60,4 +60,11 @@ public class SignalingManager extends BaseManager {
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"));
}
}

@ -117,6 +117,24 @@ class SignalingManager {
.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}))));
static Map _buildParam(Map param) {
param["ManagerName"] = "signalingManager";
return param;

@ -65,16 +65,15 @@ class InvitationInfo {
/// [Platform]
int? platformID;
InvitationInfo(
{this.inviterUserID,
this.inviteeUserIDList,
this.groupID,
this.roomID,
this.timeout,
this.initiateTime,
this.mediaType,
this.sessionType,
this.platformID});
InvitationInfo({this.inviterUserID,
this.inviteeUserIDList,
this.groupID,
this.roomID,
this.timeout,
this.initiateTime,
this.mediaType,
this.sessionType,
this.platformID});
InvitationInfo.fromJson(Map<String, dynamic> json) {
inviterUserID = json['inviterUserID'];
@ -128,7 +127,9 @@ class SignalingCertificate {
token = json['token'];
roomID = json['roomID'];
liveURL = json['liveURL'];
busyLineUserIDList = json['busyLineUserIDList'];
busyLineUserIDList =
null == json['busyLineUserIDList'] ? null : json['busyLineUserIDList'].cast<
String>();
}
Map<String, dynamic> toJson() {
@ -144,16 +145,16 @@ class SignalingCertificate {
class RoomCallingInfo {
InvitationInfo? invitation;
List<Participant>? participant;
String? token;
String? roomID;
String? token;
String? liveURL;
String? groupID;
RoomCallingInfo({
this.invitation,
this.participant,
this.token,
this.roomID,
this.token,
this.liveURL,
this.groupID,
});
@ -168,8 +169,8 @@ class RoomCallingInfo {
participant!.add(Participant.fromJson(v));
});
}
token = json['token'];
roomID = json['roomID'] ?? invitation?.roomID;
token = json['token'];
liveURL = json['liveURL'];
groupID = json['groupID'];
}
@ -182,8 +183,8 @@ class RoomCallingInfo {
if (this.participant != null) {
data['participant'] = this.participant!.map((v) => v.toJson()).toList();
}
data['token'] = this.token;
data['roomID'] = this.roomID;
data['token'] = this.token;
data['liveURL'] = this.liveURL;
data['groupID'] = this.groupID;
return data;
@ -205,7 +206,7 @@ class Participant {
? GroupMembersInfo.fromJson(json['groupMemberInfo'])
: null;
userInfo =
json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
}
Map<String, dynamic> toJson() {

@ -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.3.4
version: 2.3.4+1
homepage: https://www.rentsoft.cn
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter

Loading…
Cancel
Save