ios - 以编程方式从 iphone 调用 USSD 代码

标签 ios iphone

<分区>

如何调用USSD以编程方式为 iphone 编写代码?

我搜索并发现 iOS 7已经阻止使用 USSD出于安全原因,在 iOS7 以下的 iPhone 中,我们可以手动调用 USSD 代码,但不能以编程方式调用。

任何人都有想法,我们可以像这样以编程方式调用 USSD 吗:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:\*123* <2334555>#"]]

最佳答案

您不能调用包含 * 或 # 字符的号码。出于安全原因,Apple 不允许在拨号字符串中使用它们。

Apple Documentation says :

To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account, the Phone app supports most, but not all, of the special characters in the tel scheme. Specifically, if a URL contains the * or # characters, the Phone app does not attempt to dial the corresponding phone number. If your app receives URL strings from the user or an unknown source, you should also make sure that any special characters that might not be appropriate in a URL are escaped properly. For native apps, use the stringByAddingPercentEscapesUsingEncoding: method of NSString to escape characters, which returns a properly escaped version of your original string.

关于ios - 以编程方式从 iphone 调用 USSD 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19589344/

相关文章:

ios - 未知类型名称 "Firebase"

iphone - 使用 MKMapView 在 iphone 的 map 应用程序中显示路况

iphone - 少量不需要的数据进入 iCloud

ios - 以编程方式将音频文件保存到相册库 iPhone

iphone - iPhone4 的示例视频捕获代码

推送的 ViewController 中的 iOS 11 UINavigationBar 透明度

ios - XCode5 不会接受我所有的图标和启动图像

ios - 使用键盘时使文本字段向上滑动 swift 5

ios - 数组和用户默认值的操作

iphone - iOS 4+ : Need App to send multiple Emails with Attachments but LATER, 不是立即