We are using openURL:options:completionHandler:
to open a tel://
number in the dialer to place a call. This works on iPhones and WiFi-only iPads (tested with a iPad Mini 6th Gen), but it is failing to open on an iPad 8th Gen (WiFi + Cellular) running iPadOS 18.5 being used by a customer. Prior to updating the iPad to iPadOS 18, the call worked on iPadOS 15.2 and opened the call in FaceTime as expected. Despite not opening the dialer in iPadOS 18, the completionHandler
returns the success
parameter as true
. canOpenUrl
also returns true
. We created a small test application that reproduces the issue using the code snippet below in a new application, with the tel schema added to the info.plist
Queried URL Schemes. We are currently using Xcode 16.3.
Test Steps:
- Create a new blank application and replace
ContentView.swift
with the code snippet below - Run the test app on a physical iPad 8th Gen (WiFi + Cellular)
- Tap the "place a test call" button
Expected Results: The user is prompted to call the number and is taken to FaceTime to attempt the call. The user may then receive an alert telling them an iPhone must be paired if not already. Alternatively: return success = false in the completionHandler.
Actual Results: No action occurs that is visible to the user, and the completionHandler returns success = true.
Separately, we should be able to have some method of checking if the device can actually complete a call, i.e. if an iPhone is paired, so that we can correctly show or hide a phone icon in the app based on if the user can place a call. canOpenUrl returns true even if there is not a device paired and the call cannot actually be placed, and there doesn't seem to be a proper method for making that check.
Code Snippet:
import SwiftUI
struct ContentView: View {
@State private var showAlert = false
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Button("Place a test call") {
if let url = URL(string: "tel://5555554567") {
UIApplication.shared.open(url) { success in
if success {
print("Call initiated successfully.")
} else {
showAlert = true
}
}
}
}
}
.padding()
.alert("Call Failed", isPresented: $showAlert) {
Button("OK") { showAlert = false }
} message: {
Text("The call could not be initiated.")
}
}
}
#Preview {
ContentView()
}