0

how to make a phone call with no confirmation dialog?

private func callNumber(phoneNumber:String) {
    if let phoneCallURL = URL(string: "telprompt://\(phoneNumber)") {
        let application:UIApplication = UIApplication.shared
        if (application.canOpenURL(phoneCallURL)) {
            if #available(iOS 10.0, *) {
                application.open(phoneCallURL, options: [:], completionHandler: nil)
            } else {
                UIApplication.shared.openURL(phoneCallURL as URL)
            }
        }
    }
}
Wang90925
  • 142
  • 6
  • 1
    You can't. The system dialog is there to prevent from apps to make calls without explicit user confirmation. The only "workaround" would be to implement your own VoIP service, so you'd have to build something like Skype yourself. – EmilioPelaez Nov 26 '21 at 15:55
  • 1
    Does this answer your question? [Make a phone call programmatically iOS 10 without prompt](https://stackoverflow.com/questions/43676440/make-a-phone-call-programmatically-ios-10-without-prompt) – EmilioPelaez Nov 26 '21 at 15:56
  • This does not seem to be possible, see [this answer](https://stackoverflow.com/a/43473575/386738). – Daniel Nov 26 '21 at 15:57

0 Answers0