Skip to content

Commit

Permalink
【iOS】update to version 2.7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tangjianing authored and AbySwifter committed Nov 12, 2024
1 parent e8f5e72 commit 2037f81
Show file tree
Hide file tree
Showing 91 changed files with 1,773 additions and 350 deletions.
10 changes: 9 additions & 1 deletion iOS/Example/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,16 @@ extension AppDelegate: TIMPushDelegate {
guard let notice = notice else { return false }
guard let dict = notice.convertToDic() else { return false }
guard let roomId = dict["RoomId"] as? String else { return false }
guard let notificationType = dict["NotificationType"] as? String else { return false }
if V2TIMManager.sharedInstance().getLoginStatus() == .STATUS_LOGINED {
AppUtils.shared.showConferenceMainViewController(roomId: roomId)
switch notificationType {
case "conference_will_start":
AppUtils.shared.showConferenceMainViewController(roomId: roomId)
case "conference_invitation":
InvitationObserverService.shared.show(extString: notice)
default:
break
}
}
return true
}
Expand Down
File renamed without changes
File renamed without changes
17 changes: 17 additions & 0 deletions iOS/Example/App/Main/Resource/Localized/DemoLocalized.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,23 @@
}
}
},
"The room does not exit, please confirm the room number or create a room!" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "The room does not exit, please confirm the room number or create a room!"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "房间不存在,请确认房间号或创建房间!"
}
}
}
},
"Video" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//
// ConferenceOptionsViewController.swift
// Alamofire
//
// Created by aby on 2022/12/26.
// Copyright © 2022 Tencent. All rights reserved.
Expand Down Expand Up @@ -86,10 +85,7 @@ extension ConferenceOptionsViewController {
}

func scheduleRoom() {
let scheduleViewController = ScheduleConferenceViewController { selectedList in
let participants = ConferenceParticipants(selectedList: selectedList)
return SelectMemberViewController(participants: participants)
}
let scheduleViewController = ScheduleConferenceViewController()
navigationController?.pushViewController(scheduleViewController, animated: true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class CreateRoomViewController: UIViewController {
}

deinit {
ConferenceSession.sharedInstance.removeObserver(observer: self)
debugPrint("deinit \(self)")
}
}
Expand Down Expand Up @@ -216,12 +217,12 @@ extension CreateRoomViewController: ConferenceObserver {
}
}

func onConferenceFinished(conferenceId: String) {
debugPrint("onConferenceFinished,conferenceId:\(conferenceId)")
func onConferenceFinished(roomInfo: TUIRoomInfo, reason: ConferenceFinishedReason) {
debugPrint("onConferenceFinished")
}

func onConferenceExited(conferenceId: String) {
debugPrint("onConferenceExited,conferenceId:\(conferenceId)")
func onConferenceExited(roomInfo: TUIRoomInfo, reason: ConferenceExitedReason) {
debugPrint("onConferenceExited")
}
}

Expand Down
20 changes: 11 additions & 9 deletions iOS/Example/App/Main/View/Controller/EnterRoomViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class EnterRoomViewController: UIViewController {
}

deinit {
ConferenceSession.sharedInstance.removeObserver(observer: self)
debugPrint("deinit \(self)")
}
}
Expand Down Expand Up @@ -161,19 +162,19 @@ extension EnterRoomViewController {

extension EnterRoomViewController: ConferenceObserver {
func onConferenceJoined(roomInfo: TUIRoomInfo, error: TUIError, message: String) {
if error != .success {
let errorText = "Error: " + String(describing: error) + ", Message: " + message
SceneDelegate.getCurrentWindow()?.makeToast(errorText, duration: 1, position:TUICSToastPositionCenter)
navigationController?.popViewController(animated: true)
}
guard error != .success else { return }
navigationController?.popViewController(animated: true)
let toastText = error == .roomIdNotExist ? .roomDoesNotExit : message
guard !toastText.isEmpty else { return }
SceneDelegate.getCurrentWindow()?.makeToast(toastText, duration: 1, position:TUICSToastPositionCenter)
}

func onConferenceFinished(conferenceId: String) {
debugPrint("onConferenceFinished,conferenceId:\(conferenceId)")
func onConferenceFinished(roomInfo: TUIRoomInfo, reason: ConferenceFinishedReason) {
debugPrint("onConferenceFinished")
}

func onConferenceExited(conferenceId: String) {
debugPrint("onConferenceExited,conferenceId:\(conferenceId)")
func onConferenceExited(roomInfo: TUIRoomInfo, reason: ConferenceExitedReason) {
debugPrint("onConferenceExited")
}
}

Expand All @@ -199,4 +200,5 @@ private extension String {
static var openSpeakerText: String {
RoomDemoLocalize("Speaker")
}
static let roomDoesNotExit = RoomDemoLocalize("The room does not exit, please confirm the room number or create a room!")
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//
// RoomPrePareViewController.swift
// Alamofire
//
// Created by aby on 2022/12/26.
// Copyright © 2022 Tencent. All rights reserved.
Expand Down
5 changes: 1 addition & 4 deletions iOS/Example/App/Main/View/View/ConferenceOptionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ class ConferenceOptionsView: UIView {

init(viewController: ConferenceOptionsViewController) {
rootViewController = viewController
listView = ConferenceListView(viewController: viewController, memberSelectFactory: { selectedList in
let participants = ConferenceParticipants(selectedList: selectedList)
return SelectMemberViewController(participants: participants)
})
listView = ConferenceListView(viewController: viewController)
super.init(frame: .zero)
}

Expand Down
3 changes: 3 additions & 0 deletions iOS/Example/App/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let extString = pushNotification["ext"] as? String else { return }
guard let dict = extString.convertToDic() else { return }
guard let roomId = dict["RoomId"] as? String else { return }
guard let notificationType = dict["NotificationType"] as? String else { return }
AppUtils.shared.roomId = roomId
AppUtils.shared.notificationType = notificationType
AppUtils.shared.extString = extString
}

static func getCurrentWindow() -> UIWindow? {
Expand Down
14 changes: 13 additions & 1 deletion iOS/Example/Login/AppUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import RTCRoomEngine

class AppUtils: NSObject {
var roomId: String?
var notificationType: String?
var extString: String?
weak var navigationController: UINavigationController?
@objc static let shared = AppUtils()
private override init() {
Expand Down Expand Up @@ -57,8 +59,18 @@ class AppUtils: NSObject {
navigationController = nav
navigationController?.pushViewController(prepareViewController, animated: false)
guard let roomId = roomId else { return }
showConferenceMainViewController(roomId: roomId)
switch notificationType {
case "conference_will_start":
showConferenceMainViewController(roomId: roomId)
case "conference_invitation":
guard let extString = extString else { return }
InvitationObserverService.shared.show(extString: extString)
default:
break
}
self.roomId = nil
self.notificationType = nil
self.extString = nil
}
}

Expand Down
2 changes: 1 addition & 1 deletion iOS/Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def tool
pod 'Alamofire'
pod 'TUICore'
pod 'TUIChat'
pod 'RTCRoomEngine','~> 2.6.0'
pod 'RTCRoomEngine','~> 2.7.0'
pod 'TXLiteAVSDK_TRTC'
pod 'TXAppBasic'
pod 'TIMCommon'
Expand Down
Loading

0 comments on commit 2037f81

Please sign in to comment.