以编程方式从iphone拨打USSD代码 [英] dial USSD code from iphone programatically

查看:893
本文介绍了以编程方式从iphone拨打USSD代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式拨打iphone的 USSD 代码?

How to dial USSD code for iphone programatically?

我搜索并发现 iOS 7 已经阻止使用 USSD 安全原因的代码和带有<的iPhone中的代码iOS7我们可以手动拨打USSD代码,但不能以编程方式拨打。

I searched and found that iOS 7 has already blocked use of USSD code for security reason and in iPhones with < iOS7 we can dial a USSD code manualy but not programatically.

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

Any one have an idea, can we call USSD programatically like :

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

推荐答案

您无法拨打包含*或#字符的号码。出于安全考虑,Apple不允许拨打字符串。

You cannot dial a number containing * or # characters. Apple doesn't allow them in a dial string for security reasons.

Apple文档说明


为防止用户恶意重定向电话或更改电话或帐户的行为,电话应用程序支持tel方案中的大部分,但不是全部
特殊字符。具体来说,如果
一个URL包含*或#个字符,则Phone应用程序不会尝试
来拨打相应的电话号码。如果您的应用从用户或未知来源收到URL
字符串,您还应该确保
,网址中可能不合适的任何特殊字符都是
正确转义。对于本机应用程序,使用NSBtring的
stringByAddingPercentEscapesUsingEncoding:方法转换为
转义字符,它返回
原始字符串的正确转义版本。

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.

这篇关于以编程方式从iphone拨打USSD代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆