简体   繁体   English

有没有办法通过 telprompt URL 方案从 iOS 应用程序进行隐藏调用?

[英]Is there a way to make a hidden call from an iOS app through the telprompt URL scheme?

I can make a phone call with this code:我可以使用以下代码拨打电话:

if let url = URL(string: "telprompt://\(number)"), UIApplication.shared.canOpenURL(url) {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

Now I want to make a phone call with hidden phone number, so I would add #31# but then url is not, and the canOpenURL function is not even called.现在我想用隐藏的电话号码拨打电话,所以我会添加#31#但是url不是,并且canOpenURL function 甚至都没有被调用。

if let url = URL(string: "telprompt://#31#\(number)"), UIApplication.shared.canOpenURL(url) {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

tel:// scheme responds the same, and I don't want to go in the system settings and change it there, as it would hide my number on every call I make. tel://方案响应相同,我不想在系统设置中 go 并在那里更改它,因为它会在我每次拨打电话时隐藏我的号码。

Any idea?任何想法?

Xcode 11.5 - macOS Catalina - Swift 5 Xcode 11.5 - macOS Catalina - Swift 5

Have you tried url-encoding the # ?您是否尝试过对#进行 url 编码?

"telprompt://%2331%23\(number)"

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

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