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:
Stefan Ceriu
2026-06-23 12:09:45 +03:00
parent 89de0f3f2b
commit 2777075655
2 changed files with 3 additions and 7 deletions
@@ -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 {