mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Handle the non-deprecated INStartCallIntent for calls from Recents
The call-from-Recents handling was wired entirely to the deprecated INStartVideoCallIntent (the activity-type registration and the cast), which also meant the app never handled the modern INStartCallIntent that superseded it in iOS 13. Switch both to INStartCallIntent and derive isVoiceCall from its callCapability. Clears the deprecation warning.
This commit is contained in:
@@ -357,9 +357,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
}
|
||||
|
||||
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,
|
||||
guard let intent = userActivity.interaction?.intent as? INStartCallIntent,
|
||||
let contact = intent.contacts?.first,
|
||||
let roomIdentifier = contact.personHandle?.value else {
|
||||
MXLog.error("Failed retrieving information from userActivity: \(userActivity)")
|
||||
@@ -367,7 +365,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
}
|
||||
|
||||
MXLog.info("Starting call in room: \(roomIdentifier)")
|
||||
handleAppRoute(AppRoute.call(roomID: roomIdentifier, isVoiceCall: false), windowType: nil)
|
||||
handleAppRoute(AppRoute.call(roomID: roomIdentifier, isVoiceCall: intent.callCapability == .audioCall), windowType: nil)
|
||||
}
|
||||
|
||||
// MARK: - AuthenticationFlowCoordinatorDelegate
|
||||
|
||||
@@ -52,9 +52,7 @@ struct Application: App {
|
||||
guard let url = userActivity.webpageURL else { return }
|
||||
openURL(url, isExternalURL: true)
|
||||
}
|
||||
.onContinueUserActivity("INStartVideoCallIntent") { userActivity in
|
||||
// `INStartVideoCallIntent` is to be replaced with `INStartCallIntent`
|
||||
// but calls from Recents still send it ¯\_(ツ)_/¯
|
||||
.onContinueUserActivity("INStartCallIntent") { userActivity in
|
||||
appCoordinator.handleUserActivity(userActivity)
|
||||
}
|
||||
.task {
|
||||
|
||||
Reference in New Issue
Block a user