From 27770756552d2c5d31ab5b520c348d2a6eb9559b Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 23 Jun 2026 12:09:45 +0300 Subject: [PATCH] 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. --- ElementX/Sources/Application/AppCoordinator.swift | 6 ++---- ElementX/Sources/Application/Application.swift | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index aec209805..561a88d47 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -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 diff --git a/ElementX/Sources/Application/Application.swift b/ElementX/Sources/Application/Application.swift index fb3bd67f3..706611e3d 100644 --- a/ElementX/Sources/Application/Application.swift +++ b/ElementX/Sources/Application/Application.swift @@ -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 {