[英]telprompt: allows less characters than the phone itself. Which?
I'm using the address book of the iPhone to call numbers using telprompt:.我正在使用 iPhone 的通讯录使用 telprompt 拨打号码:。 A number with spaces and dashes doesn't work, while one with plus and numbers only does work.
带有空格和破折号的数字不起作用,而带有加号和数字的数字只能起作用。 The iphone itself doesn't allow typing them, but synchronising with the mac gets me lots of (invalid?) phone numbers.
iphone 本身不允许输入它们,但与 mac 同步会得到很多(无效?)电话号码。 Which characters are allowed, and why?
允许使用哪些字符,为什么?
Try using this code, it leaves only numbers in the phone number string:尝试使用此代码,它只在电话号码字符串中留下数字:
NSString* phone = @"477 (38) 232-35-47";
//@"477 (38) 232-35-47"
phone = [[phone componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
//@"477382323547"
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt:%@", phone]]];
See section 3, "URI Syntax", of RFC 3966: The tel
URI for Telephone Numbers .请参阅RFC 3966 的第 3 节“URI 语法”:电话号码的
tel
URI 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.