ios 调用系统拨打电话方法

来源:互联网 发布:golang syscall 编辑:程序博客网 时间:2024/06/04 18:34

方法一

 NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",tel];

 UIWebView * callWebview = [[UIWebView alloc] init];

  [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];

  [self.view addSubview:callWebview];

会出现确认提示信息

回到程序中

方法二

[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:[NSStringstringWithFormat:@"tel://%@",tel]]];

不会出现确认提示信息

不会回到程序中

方法三

 NSMutableString * str=[[NSMutableStringalloc] initWithFormat:@"telprompt://%@"tel];

        [[UIApplicationsharedApplication] openURL:[NSURLURLWithString:str]];

会出现确认提示信息

回到程序中




0 0