IOS 调用拨打电话Api

// 判断设备是否有通话功能
        NSString *deviceType = [UIDevice currentDevice].model;
        if([deviceType  isEqualToString:@"iPod touch"]||
       [deviceType isEqualToString:@"iPad"]||
[deviceType isEqualToString:@"iPhone Simulator"]) { UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"提示" message:@"模拟器没有通话功能" delegate:nil cancelButtonTitle:@"好的,   知道了" otherButtonTitles:nil,nil]; [alert show]; return; } else { NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",personInfo.phoneNum]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:telUrl]]; }

 

posted @ 2014-03-13 15:13  菜鸟程序猿  阅读(1560)  评论(1编辑  收藏  举报