A知识点2iOS Developer

iOS 拨打电话-三种不同的方法实现

2016-10-10  本文已影响340人  iOS_愛OS

貌似有的系统调用了这个方法打完电话后,会停留在通话记录里。
iOS10 亲测,打完打完电话会回到原来的程序

                NSString *phoneNumber = [NSString stringWithFormat:@"telprompt://%@",@"13377892977"];
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

弹出提示,打完回到原程序

NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
    UIWebView * callWebview = [[UIWebView alloc] init];
    [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    [self.view addSubview:callWebview];

弹出提示,打完回到原程序

NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
    //            NSLog(@"str======%@",str);
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]
上一篇 下一篇

猜你喜欢

热点阅读