问题描述
我正在使用以下代码拨打号码并使用我的设备进行测试.似乎不需要确认,对吗?
I am using the following code to dial number and testing with my device. It seems no confirmation is needed, correct?
NSURL *url = [NSURL URLWithString:@"tel://12345678"];
[[UIApplication sharedApplication] openURL:url];
推荐答案
确认不是必需的,并且在以编程方式完成时不会显示.如果单击数字,您只会在 Safari 中看到 alertView.
Confirmation isn't required and isn't shown when done programmatically. You will only see the alertView in Safari if a number is clicked.
但是,根据我自己的经验,我相信客户看到对话框会更方便,这样他们就不会不小心给某人打电话.人们只是想都没想就点击应用中的东西,在这种情况下可能会很糟糕.
However, in my own experience, I believe it's more convenient for the customer to see a dialog box so they don't accidentally call someone. People just tap things in apps without even thinking and that could be bad in this case.
要模仿 safari 的功能,您可以执行以下操作:
To mimic what safari does you can do something like this:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Call 12345678?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Call", nil];
[alert show];
alert.tag = 1;
[alert release];
和
-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (alertView.tag) {
case 1:
if (buttonIndex == 1) {
NSURL *url = [NSURL URLWithString:@"tel://12345678"];
[[UIApplication sharedApplication] openURL:url];
}
break;
default:
break;
}
}
这篇关于iOS中的拨号真的需要确认吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)