iOS 打电话 发短信功能的实现

1.打电话
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
    UIWebView * callWebview = [[UIWebView alloc] init];
    [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    [self.view addSubview:callWebview];
 2.发短信
NSURL *messageUrl=[NSURL URLWithString:[NSString stringWithFormat:@"sms://%@",phoneNember]];
    [[UIApplication sharedApplication]openURL:messageUrl];

posted on 2016-02-25 15:26  崔付亮  阅读(169)  评论(0编辑  收藏  举报