- 邮件
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://devprograms@apple.com"]];
- 电话
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://8004664411"]];
- sms
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://466453"]];
- 浏览器
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunesconnect.apple.com"]];
ios--打电话 三种方式
// 定义点击拨号按钮时的操作
- (void)callAction{
NSString *number = @"";// 此处读入电话号码
// NSString *num = [[NSString alloc] initWithFormat:@"tel://%@",number]; //number为号码字符串 如果使用这个方法 结束电话之后会进入联系人列表
NSString *num = [[NSString alloc] initWithFormat:@"telprompt://%@",number]; //而这个方法则打电话前先弹框
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:num]]; //拨号
}
//
// 下面的代码能在应用中添加一个电话按钮, 用UIWebView加载电话,这种是合法的,可以上App Store的。
-(void)CallPhone{
NSString *phoneNum = @"";// 电话号码
NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneNum]];
if ( !phoneCallWebView ) {
phoneCallWebView = [[UIWebView alloc] initWithFrame:CGRectZero];// 这个webView只是一个后台的容易 不需要add到页面上来
}
[phoneCallWebView loadRequest:[NSURLRequest requestWithURL:phoneURL]];
}