From b360d268927d6cf474046e186dc098af7432723c Mon Sep 17 00:00:00 2001 From: Max Cobb Date: Fri, 1 Oct 2021 16:37:48 +0100 Subject: [PATCH 1/2] rtm is now optional in AgoraSettings --- Sources/Agora-UIKit/AgoraSettings.swift | 3 +++ Sources/Agora-UIKit/AgoraVideoViewer+VideoControl.swift | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Sources/Agora-UIKit/AgoraSettings.swift b/Sources/Agora-UIKit/AgoraSettings.swift index f376d84f..8da80a4b 100644 --- a/Sources/Agora-UIKit/AgoraSettings.swift +++ b/Sources/Agora-UIKit/AgoraSettings.swift @@ -20,6 +20,9 @@ public struct AgoraSettings { /// Delegate for Agora RTM Channel callbacks public weak var rtmChannelDelegate: AgoraRtmChannelDelegate? + /// Whether RTM should be initialised and used + public var rtmEnabled: Bool = true + /// URL to fetch tokens from. If supplied, this package will automatically fetch tokens /// when the Agora Engine indicates it will be needed. /// It will follow the URL pattern found in diff --git a/Sources/Agora-UIKit/AgoraVideoViewer+VideoControl.swift b/Sources/Agora-UIKit/AgoraVideoViewer+VideoControl.swift index 462877e5..7a1c490c 100644 --- a/Sources/Agora-UIKit/AgoraVideoViewer+VideoControl.swift +++ b/Sources/Agora-UIKit/AgoraVideoViewer+VideoControl.swift @@ -324,8 +324,12 @@ extension AgoraVideoViewer { /// Initialise RTM to send messages across the network. open func setupRtmController(joining channel: String) { + if !self.agSettings.rtmEnabled { return } if self.rtmController == nil { self.rtmController = AgoraRtmController(delegate: self) + if self.rtmController == nil { + AgoraVideoViewer.agoraPrint(.error, message: "Error initialising RTM") + } } self.rtmController?.joinChannel(named: channel) } From 11c0cc32c3f9069ffe256fa516568afb25c057c0 Mon Sep 17 00:00:00 2001 From: Max Cobb Date: Fri, 1 Oct 2021 16:43:33 +0100 Subject: [PATCH 2/2] bump version numbers to 1.6.6 --- AgoraUIKit_iOS.podspec | 2 +- AgoraUIKit_macOS.podspec | 2 +- Sources/Agora-UIKit/AgoraUIKit.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AgoraUIKit_iOS.podspec b/AgoraUIKit_iOS.podspec index 289dffe3..92b77bf6 100644 --- a/AgoraUIKit_iOS.podspec +++ b/AgoraUIKit_iOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'AgoraUIKit_iOS' - s.version = '1.6.5' + s.version = '1.6.6' s.summary = 'Agora video session UIKit template.' s.description = <<-DESC diff --git a/AgoraUIKit_macOS.podspec b/AgoraUIKit_macOS.podspec index ccb9c2e0..db85f524 100644 --- a/AgoraUIKit_macOS.podspec +++ b/AgoraUIKit_macOS.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'AgoraUIKit_macOS' - s.version = '1.6.4' + s.version = '1.6.6' s.summary = 'Agora video session AppKit template.' s.description = <<-DESC diff --git a/Sources/Agora-UIKit/AgoraUIKit.swift b/Sources/Agora-UIKit/AgoraUIKit.swift index 2d651191..645f2ac9 100644 --- a/Sources/Agora-UIKit/AgoraUIKit.swift +++ b/Sources/Agora-UIKit/AgoraUIKit.swift @@ -22,7 +22,7 @@ public struct AgoraUIKit: Codable { /// Framework type of UIKit. "native", "flutter", "reactnative" fileprivate(set) var framework: String /// Version of UIKit being used - static let version = "1.6.5" + static let version = "1.6.6" /// Framework type of UIKit. "native", "flutter", "reactnative" static let framework = "native" #if os(iOS)