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/34284377/

相关文章:

iphone - ios未读消息图标

iphone - 关闭键盘的 iPhone 应用程序中的完成键(使用 UITextView)

ios - SQLite 数据库不可写

ios - 使用 Alamofire 解码 json 时出错

ios - 将新的自定义单元格添加到 UITableView 的顶部

iphone - 如何获取 UITabBarController 内的可用边界

iphone - UINavigationController 偏移量

ios - 删除@IBInspectable 错误 : Failed to set () user defined inspected property on (UIView)

objective-c - 如何使用正则表达式搜索 NSPredicate 忽略某些字符?

ios - 将数据从 Node 服务器发送回 iOS 设备(使用 Swift)