简体   繁体   English

在 iOS 中没有弹出的直接电话?

[英]Direct phone call without pop-up in iOS?

if let url = URL(string: "tel:/ +91******* ) {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

However, when touched startCall Button, a pop up appears asking to "Call" or "Cancel".但是,当触摸 startCall 按钮时,会出现一个弹出窗口,询问“呼叫”或“取消”。 Is there a way to take the user directly call and avoid this pop up in iOS (Swift 5)?有没有办法让用户直接调用并避免在 iOS (Swift 5) 中弹出这个?

Is there a way to take the user directly call and avoid this pop up in iOS (swift 5)?有没有办法让用户直接调用并避免在 iOS (swift 5) 中弹出这个?

No there is not, and that is by design.不,没有,这是设计使然。

Apple believes (and I agree) that only the user should be able to initiate phone calls on their phone. Apple 相信(我同意)只有用户才能在他们的手机上拨打电话。 If apps could trigger phone calls without the user's permission it would allow all sorts of mischief.如果应用程序可以在未经用户许可的情况下触发电话,那将允许各种恶作剧。

This is a deliberate security feature of the OS.这是操作系统的故意安全功能。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM