Core sdk upgrade to 2.3.4
This commit is contained in:
parent
38a899d32c
commit
2b78f83b20
@ -1,3 +1,12 @@
|
||||
## 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
|
||||
|
@ -41,5 +41,5 @@ android {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation 'io.openim:core-sdk:2.3.3@aar'
|
||||
implementation 'io.openim:core-sdk:2.3.4@aar'
|
||||
}
|
@ -39,6 +39,16 @@ public class OnSignalingListener implements open_im_sdk_callback.OnSignalingList
|
||||
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 onHangUp(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
|
||||
|
@ -53,4 +53,11 @@ 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"));
|
||||
}
|
||||
}
|
||||
|
@ -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'
|
||||
|
@ -7,7 +7,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.8.2"
|
||||
version: "2.9.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -21,21 +21,14 @@ packages:
|
||||
name: characters
|
||||
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
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -56,7 +49,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -68,7 +61,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.3.2"
|
||||
version: "2.3.3"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -80,28 +73,28 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
version: "0.12.12"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.4"
|
||||
version: "0.1.5"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.8.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -113,7 +106,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.2"
|
||||
version: "1.9.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -134,21 +127,21 @@ packages:
|
||||
name: string_scanner
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.4.9"
|
||||
version: "0.4.12"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -12,6 +12,7 @@ public class SignalingManager: BaseServiceManager {
|
||||
self["signalingReject"] = signalingReject
|
||||
self["signalingCancel"] = signalingCancel
|
||||
self["signalingHungUp"] = signalingHungUp
|
||||
self["signalingGetRoomByGroupID"] = signalingGetRoomByGroupID
|
||||
}
|
||||
|
||||
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -42,6 +43,10 @@ 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"])
|
||||
}
|
||||
}
|
||||
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
|
||||
|
||||
@ -83,4 +88,11 @@ 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)
|
||||
}
|
||||
}
|
||||
|
@ -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.3.3'
|
||||
s.dependency 'OpenIMSDKCore','2.3.4'
|
||||
s.static_framework = true
|
||||
# s.vendored_frameworks = 'Framework/*.framework'
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
|
@ -10,6 +10,8 @@ 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;
|
||||
|
||||
OnSignalingListener({
|
||||
this.onInvitationCancelled,
|
||||
@ -20,6 +22,8 @@ class OnSignalingListener {
|
||||
this.onInviteeAcceptedByOtherDevice,
|
||||
this.onInviteeRejectedByOtherDevice,
|
||||
this.onHangup,
|
||||
this.onRoomParticipantConnected,
|
||||
this.onRoomParticipantDisconnected,
|
||||
});
|
||||
|
||||
/// 被邀请者收到:邀请者取消音视频通话
|
||||
@ -61,4 +65,12 @@ class OnSignalingListener {
|
||||
void hangup(SignalingInfo info) {
|
||||
onHangup?.call(info);
|
||||
}
|
||||
|
||||
void roomParticipantConnected(RoomCallingInfo info) {
|
||||
onRoomParticipantConnected?.call(info);
|
||||
}
|
||||
|
||||
void roomParticipantDisconnected(RoomCallingInfo info) {
|
||||
onRoomParticipantDisconnected?.call(info);
|
||||
}
|
||||
}
|
||||
|
@ -244,31 +244,46 @@ 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;
|
||||
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;
|
||||
}
|
||||
} else if (call.method == ListenerType.workMomentsListener) {
|
||||
|
@ -101,6 +101,22 @@ 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)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "signalingManager";
|
||||
return param;
|
||||
|
@ -114,12 +114,21 @@ 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 = json['busyLineUserIDList'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -127,6 +136,89 @@ 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? token;
|
||||
String? roomID;
|
||||
String? liveURL;
|
||||
String? groupID;
|
||||
|
||||
RoomCallingInfo({
|
||||
this.invitation,
|
||||
this.participant,
|
||||
this.token,
|
||||
this.roomID,
|
||||
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));
|
||||
});
|
||||
}
|
||||
token = json['token'];
|
||||
roomID = json['roomID'] ?? invitation?.roomID;
|
||||
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['token'] = this.token;
|
||||
data['roomID'] = this.roomID;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OpenIM {
|
||||
static const version = '2.3.3';
|
||||
static const version = '2.3.4';
|
||||
|
||||
static const _channel = const MethodChannel('flutter_openim_sdk');
|
||||
|
||||
|
31
pubspec.lock
31
pubspec.lock
@ -7,7 +7,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.8.2"
|
||||
version: "2.9.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -21,21 +21,14 @@ packages:
|
||||
name: characters
|
||||
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
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -49,7 +42,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -66,28 +59,28 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
version: "0.12.12"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.4"
|
||||
version: "0.1.5"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.8.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -99,7 +92,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.2"
|
||||
version: "1.9.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -120,21 +113,21 @@ packages:
|
||||
name: string_scanner
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.4.9"
|
||||
version: "0.4.12"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
Loading…
x
Reference in New Issue
Block a user