【发布时间】:2016-03-04 09:43:34
【问题描述】:
我找到了需要在info.plist 中添加一些代码的解决方案。我是这样做的:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tel</string>
</array>
仍然没有帮助。 我收到此错误:
"-canOpenURL:URL 失败:"tel://4806501708" - 错误:"这 不允许app查询方案tel”
我打开拨号器的代码:
NSString *phoneNumber = [@"tel://" stringByAppendingString:lblVenPhoneValue.text];
if ([UIApplication.sharedApplication canOpenURL:[NSURL URLWithString:phoneNumber]]) {
[UIApplication.sharedApplication openURL:[NSURL URLWithString:phoneNumber]];
我需要做什么?
提前致谢
【问题讨论】:
-
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",@"digits"]]];试试这个,没有“//”
-
NSString *phoneNumber = [@"telprompt://" stringByAppendingString:@number]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];如果上述方法不起作用,请也检查一下
-
运气不好。仍然得到:“此应用不允许查询方案 telprompt”
-
我的 info.plist 是否正确?在这里
-
telprompt 在 info.plist 中试试这个
标签: ios objective-c iphone ios9 openurl