How to use tel: with * (star, asterisk) or # (hash, pound) on iOS? How to use tel: with * (star, asterisk) or # (hash, pound) on iOS? ios ios

How to use tel: with * (star, asterisk) or # (hash, pound) on iOS?

This documentation from Apple should be helpful:

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

UPDATE (Jan 2, 2018): The information mentioned here may be outdated. Please refer to new documentation if Apple has relaxed these rules in their newer SDKs. Refer to Husam's answer.

iOS11 now allows us to call number with * or #

Swift Example code

    let number = "*111*12345#"    let app = UIApplication.shared    if let encoded = number.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) {        let u = "tel://\(encoded)"        if let url = URL(string:u) {            if app.canOpenURL(url) {      , options: [:], completionHandler: { (finished) in                })                return            }        }    }

The approved answer is not correct, at least anymore. I've tested both as a web page and in app being able to dial using the special character # and *. What you do have to do if you wish to use those characters in either instance though is to encode them.

In HTML, # becomes %23 and * does not need to be escaped

If using Swift, you can encode your link and press it from an app using this function:

//number format example (commas are pauses): 123-456-7890,,555#,1234fileprivate func callNumber(_ number: String) {    let dialString = "telprompt://" + number    if let escapedDialString = dialString.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) {      if let dialURL = URL(string: escapedDialString) {        UIApplication.shared.openURL(dialURL)      }    }  }