在app中发布了一个iOS 5.0+应用程序,它用电话号码显示员工的个人资料。应用程序的用户可以点击电话号码,这个号码将在他们的iPhones上拨打。
问题是,一些使用iPhone 4的用户报告说它没有拨号。
这是我用来拨号的代码:
NSString *cleanedString = [[self.member.phone componentsSeparatedByCharactersInSet:[[NSCharacterSet characterSetWithCharactersInString:@"0123456789-+()"] invertedSet]] componentsJoinedByString:@""];
NSString *escapedPhoneNumber = [cleanedString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *urlText = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", escapedPhoneNumber]];
[[UIApplication sharedApplication] openURL:urlText];对此有什么想法吗?
发布于 2013-01-22 12:33:08
在/方案中不应该有任何tel::
NSURL *urlText = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", escapedPhoneNumber]];在Apple方案参考中,您可以看到一些tel:方案中允许的示例。
发布于 2013-01-22 12:36:52
如果您使用telpromt而不是tel,这将使您在调用结束后返回到app。
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt:1234567890"]];https://stackoverflow.com/questions/14458608
复制相似问题