iOS 4.2 - Return to app after phone call

前端 未结 6 1719
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 22:56

I can successfully initiate a phone call within my app using the following:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@\"tel://12345678         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 23:55

    With iOS 9.3.4, every technique that I try has control return to the calling app after the phone call. Has this behavior changed recently? This example is just a Swift and simplified version of https://github.com/jatraiz/RZTelpromptExample:

    class ViewController: UIViewController {
    
        let phoneNumber = "7204790465"
    
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }
    
        @IBAction func callWithTelPushed(sender: AnyObject) {
            if let url = NSURL(string: "tel:" + self.phoneNumber) {
                UIApplication.sharedApplication().openURL(url)
            }
        }
    
        @IBAction func callWithTelpromptPushed(sender: AnyObject) {
            if let url = NSURL(string: "telprompt:" + self.phoneNumber) {
                UIApplication.sharedApplication().openURL(url)
            }
        }
    
        @IBAction func callWithRZTelpromptPushed(sender: AnyObject) {
            RZTelprompt.callWithString(self.phoneNumber)
        }
    }
    

提交回复
热议问题