Calling from Watchos

I am working with a watchOS app in SwiftUI, and I am using the following code to dial a phone number from the watch:

var number = "123456789"
if let telURL = URL(string: "tel:\(number)") {
let wkExtension = WKExtension.shared()
wkExtension.openSystemURL(telURL)
}

The issue is that when I try to dial a number starting with a * (asterisk) or # (hash), it doesn't work. When dialing a regular number, it works fine.

Is there any way to get this to work?

Answered by DTS Engineer in 834756022

I believe the behavior is as-designed, as mentioned here:

" To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account, the Phone app supports most, but not all, of the special characters in the tel scheme. Specifically, if a URL contains the * or # characters, the Phone app does not attempt to dial the corresponding phone number. "

The doc isn't up to date, but I don't think the behavior has changed since then.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

I believe the behavior is as-designed, as mentioned here:

" To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account, the Phone app supports most, but not all, of the special characters in the tel scheme. Specifically, if a URL contains the * or # characters, the Phone app does not attempt to dial the corresponding phone number. "

The doc isn't up to date, but I don't think the behavior has changed since then.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Calling from Watchos
 
 
Q