Skip to content

Commit

Permalink
Merge pull request #42 from AgoraIO-Community/rtm-optional
Browse files Browse the repository at this point in the history
Rtm Optional
  • Loading branch information
maxxfrazer authored Oct 1, 2021
2 parents 89db651 + 11c0cc3 commit 72a5312
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AgoraUIKit_iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion AgoraUIKit_macOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Sources/Agora-UIKit/AgoraSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Agora-UIKit/AgoraUIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions Sources/Agora-UIKit/AgoraVideoViewer+VideoControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 72a5312

Please sign in to comment.