mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Show ElementCalls in the system Recents list and allow deep linking back into a call from there
This commit is contained in:
committed by
Stefan Ceriu
parent
16fc7caa62
commit
f6c476eeca
@@ -17,6 +17,7 @@
|
||||
import AnalyticsEvents
|
||||
import BackgroundTasks
|
||||
import Combine
|
||||
import Intents
|
||||
import MatrixRustSDK
|
||||
import SwiftUI
|
||||
import Version
|
||||
@@ -236,6 +237,20 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
return false
|
||||
}
|
||||
|
||||
func handleUserActivity(_ userActivity: NSUserActivity) {
|
||||
// `INStartVideoCallIntent` is to be replaced with `INStartCallIntent`
|
||||
// but calls from Recents still send it ¯\_(ツ)_/¯
|
||||
guard let intent = userActivity.interaction?.intent as? INStartVideoCallIntent,
|
||||
let contact = intent.contacts?.first,
|
||||
let roomIdentifier = contact.personHandle?.value else {
|
||||
MXLog.error("Failed retrieving information from userActivity: \(userActivity)")
|
||||
return
|
||||
}
|
||||
|
||||
MXLog.info("Starting call in room: \(roomIdentifier)")
|
||||
handleAppRoute(AppRoute.call(roomID: roomIdentifier))
|
||||
}
|
||||
|
||||
// MARK: - AuthenticationFlowCoordinatorDelegate
|
||||
|
||||
func authenticationFlowCoordinator(didLoginWithSession userSession: UserSessionProtocol) {
|
||||
|
||||
@@ -18,5 +18,8 @@ import Foundation
|
||||
|
||||
protocol AppCoordinatorProtocol: CoordinatorProtocol {
|
||||
var windowManager: SecureWindowManagerProtocol { get }
|
||||
|
||||
@discardableResult func handleDeepLink(_ url: URL, isExternalURL: Bool) -> Bool
|
||||
|
||||
func handleUserActivity(_ userActivity: NSUserActivity)
|
||||
}
|
||||
|
||||
@@ -51,6 +51,11 @@ struct Application: App {
|
||||
openURLInSystemBrowser($0)
|
||||
}
|
||||
}
|
||||
.onContinueUserActivity("INStartVideoCallIntent", perform: { userActivity in
|
||||
// `INStartVideoCallIntent` is to be replaced with `INStartCallIntent`
|
||||
// but calls from Recents still send it ¯\_(ツ)_/¯
|
||||
appCoordinator.handleUserActivity(userActivity)
|
||||
})
|
||||
.task {
|
||||
appCoordinator.start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user