简体   繁体   English

无法取消电话号码中的拨号盘

[英]Unable to cancel a dial pad in phone number

I think so This question is not duplicate one. 我认为是这样,这个问题不是重复的。 Call to phone number when touching cancel Action my app throws app to initial screen instead of displaying current screen. 触摸“取消”操作时拨打电话号码我的应用程序将应用程序引发到初始屏幕,而不是显示当前屏幕。 Is this a bug in iOS11 or is there something that I am doing wrong from following code. 这是iOS11中的错误,还是我遵循以下代码做错了什么? this is my code. 这是我的代码。

@objc func CallAction(_ sender : UIButton)
    {
        var localDic :NSDictionary!
        if is_searching {
            localDic = searchingDataArray.object(at: sender.tag) as! NSDictionary
        }else
        {
            localDic = myStudentsArray.object(at: sender.tag) as! NSDictionary

        }

        let phoneNumber=localDic["contact_no"] as! String
        print("phoneNumber",phoneNumber )

        guard let number = URL(string: "tel://" + phoneNumber) else { return }
        UIApplication.shared.open(number)

    }

Use the following code 使用以下代码

guard let telNumber = URL(string: "telprompt://" + "+1234-567-89") else { return }
    if #available(iOS 10.0, *) {
        UIApplication.shared.open(telNumber)
    } else {
        // Fallback on earlier versions
    }

hope its works.. 希望它的作品..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当用户在我的应用程序中按联系人号码时,如何获取电话号码并在电话拨号盘中显示该号码 - How to get the phone number and show that number in phone dial pad when user press contact number inside my app 打开用于呼叫号码用户想要的拨号盘 - opening dial pad for calling number user want 向iPhone拨号盘显示一个号码,但不能实际拨打电话 - Present iPhone dial pad with a number but not actually place the call 俄语电话号码在拨号盘上格式化 - Russian phone number gets formatted on dial 在 iOS 中以编程方式使用访问代码拨打电话号码 - Dial a phone number with an access code programmatically in iOS 在iPhone中调出电话应用并填写电话号码(无拨号) - Call out Phone App in iPhone & fill in a phone number ( no dial ) inputType = {“number”},数字拨号盘未显示在 ios 但在 android 中可见 - React js - inputType={"number"}, Number dial pad not showing in ios but visible in android - React js 如何跳转到iOS中的拨号盘 - How to jump to dial pad in iOS iOS-是否可以通过编程方式检测有人何时在其拨号盘上按数字? - Ios- is there a way to programmatically detect when someone presses a number on their dial pad? 将iPhone电话号码格式转换为“可拨号”字符串 - Convert an iPhone phone number format for a “dial-able” string
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM