打完电话后是否可以返回我的应用程序?使用此代码进行通话
this还是真实的吗?
func callNumber(phoneNumber:String) {
completeStringToSend.append("calling to: \(phoneNumber) \n")
/*
dialog box for user when sending a call cannot be avoided.
https://developer.apple.com/library/archive/releasenotes/General/RN-iOSSDK-10.3/
https://support.apple.com/en-gb/HT207617
*/
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 {
// Fallback on earlier versions
UIApplication.shared.openURL(phoneCallURL as URL)
}
}
}
}