Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a6fc2a4
update calling UI in the replaceRootViewController
KaterinaWire Nov 17, 2025
0d06ee4
temp
KaterinaWire Nov 18, 2025
dfd480f
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Nov 24, 2025
91c58bd
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Nov 24, 2025
663abb8
roll back changes
KaterinaWire Nov 24, 2025
42268df
roll back changes
KaterinaWire Nov 24, 2025
6994cfd
pass _zClientViewController
KaterinaWire Nov 24, 2025
9743cb5
setup presentingViewController
KaterinaWire Nov 24, 2025
69cdc0f
clean up
KaterinaWire Nov 24, 2025
fb18c1b
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Nov 24, 2025
67bbda6
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Nov 25, 2025
7ae343d
post and observ notification
KaterinaWire Nov 28, 2025
d5e5b49
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Nov 28, 2025
7d4b6e9
remove last potential fix
KaterinaWire Nov 28, 2025
bc31477
clean up
KaterinaWire Nov 28, 2025
af516c3
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 1, 2025
04e417f
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 1, 2025
49d2a42
clean up
KaterinaWire Dec 1, 2025
93621f4
fix SwiftFormat issue
KaterinaWire Dec 2, 2025
1240a79
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 2, 2025
6f5fcd0
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 10, 2025
a1cb85c
move the code around
KaterinaWire Dec 10, 2025
b6b61d9
add an emty line
KaterinaWire Dec 10, 2025
9e9282c
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 10, 2025
8a4a7a2
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 12, 2025
fd9f958
remove comment
KaterinaWire Dec 12, 2025
a7015fc
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 15, 2025
dc50b88
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 16, 2025
cc74237
Merge branch 'develop' into fix/call-UI-not-maximizing
KaterinaWire Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ public protocol PresentationDelegate: AnyObject {

// Called when showing the password prompt before joining a group conversation
func showPasswordPrompt(for conversationName: String, completion: @escaping (String?) -> Void)

/// Updates the calling UI state if there's an active call
func updateActiveCallPresentationStateIfNeeded()

}
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ extension SessionManager: UNUserNotificationCenterDelegate {
fatalError("User session \(session) is not present in backgroundSessions")
}
}

/// Registers an observer to update active call presentation state when the conversation becomes visible.
fileprivate func observeConversationDidBecomeVisible() {
conversationVisibleObserver = NotificationCenter.default.addObserver(
forName: .conversationDidBecomeVisible,
object: nil,
queue: .main
) { [weak self] _ in
guard let self else { return }

if let observer = conversationVisibleObserver {
NotificationCenter.default.removeObserver(observer)
conversationVisibleObserver = nil
}
presentationDelegate?.updateActiveCallPresentationStateIfNeeded()
}
}
}

public extension SessionManager {
Expand All @@ -138,6 +155,11 @@ public extension SessionManager {
return
}

// If switching accounts, observe when conversation becomes visible to update call UI
if session != activeUserSession {
observeConversationDidBecomeVisible()
}

activateAccount(for: session) {
self.presentationDelegate?.showConversation(conversation, at: message)
}
Expand All @@ -153,3 +175,7 @@ public extension SessionManager {
presentationDelegate?.showUserProfile(user: user)
}
}

public extension Notification.Name {
static let conversationDidBecomeVisible = Notification.Name("ConversationDidBecomeVisible")
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
let jailbreakDetector: JailbreakDetectorProtocol?
fileprivate var accountTokens: [UUID: [Any]] = [:]
fileprivate var memoryWarningObserver: NSObjectProtocol?
var conversationVisibleObserver: NSObjectProtocol?
fileprivate var isSelectingAccount: Bool = false

var proxyCredentials: WireTransport.ProxyCredentials?
Expand Down Expand Up @@ -473,7 +474,7 @@
object: nil,
queue: nil
) { [weak self] _ in
WireLogger.sessionManager.debug("Received memory warning, tearing down background user sessions.")

Check warning on line 477 in wire-ios-sync-engine/Source/SessionManager/SessionManager.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'SessionManager?' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'SessionManager?' in a '@sendable' closure
self?.tearDownAllBackgroundSessions()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ class MockPresentationDelegate: PresentationDelegate {
completion(mockPassword)
}

func updateActiveCallPresentationStateIfNeeded() {}

}
2 changes: 0 additions & 2 deletions wire-ios/Wire-iOS/Sources/AppRootRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,6 @@ extension AppRootRouter {
presentAlertForDeletedAccountIfNeeded(error)
sessionManager.processPendingURLActionDoesNotRequireAuthentication()
case .authenticated:
// This is needed to display an ongoing call when coming from the background.
authenticatedRouter?.updateActiveCallPresentationState()
urlActionRouter.authenticatedRouter = authenticatedRouter
ZClientViewController.shared?.legalHoldDisclosureController?.discloseCurrentState(cause: .appOpen)
sessionManager.processPendingURLActionRequiresAuthentication()
Expand Down
4 changes: 4 additions & 0 deletions wire-ios/Wire-iOS/Sources/URLActionRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ class URLActionRouter: URLActionRouterProtocol {

extension URLActionRouter: PresentationDelegate {

func updateActiveCallPresentationStateIfNeeded() {
authenticatedRouter?.updateActiveCallPresentationState()
}

func showPasswordPrompt(for conversationName: String, completion: @escaping (String?) -> Void) {
typealias ConversationAlert = L10n.Localizable.Join.Group.Conversation.Alert

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,15 @@ extension ConversationViewController {
isAppearing = false

syncCellsState()
notifyConversationDidBecomeVisible()

}

private func notifyConversationDidBecomeVisible() {
NotificationCenter.default.post(
name: .conversationDidBecomeVisible,
object: nil
)
}

}
Loading