How to use openURL for making a phone call in Swift?

后端 未结 12 600
囚心锁ツ
囚心锁ツ 2020-11-30 05:30

I have converted the code for making a phone call from Objective-C to Swift, but in Objective-C, we can set the type of the URL that we like to open (e.g. telephone, SMS, we

12条回答
  •  星月不相逢
    2020-11-30 05:54

    @ confile:

    The problem is that your solution does not return to the app after the phone call has been finished on iOS7. – Jun 19 at 13:50

    &@ Zorayr

    Hm, curious if there is a solution that does do that.. might be a restriction on iOS.

    use

    UIApplication.sharedApplication().openURL(NSURL(string: "telprompt://9809088798")!)
    

    You will get a prompt to Call/Cancel but it returns to your application. AFAIK there is no way to return (without prompting)

提交回复
热议问题