How to invoke call event in my Iphone application?
here is the scenario: I have fetched the iphone contact de开发者_如何学Gotails into my application.And i have displayed email,phone details my View controller. Now,I want to know how to invoke call event which i click on phone number in my application?
Well you just call the tel
scheme:
NSURL *phoneURL = [NSURL URLWithString:@"tel:1234564897"];
BOOL hasPhone = [[UIApplication sharedApplication] canOpenURL:phoneURL];
if (hasPhone) {
[[UIApplication sharedApplication] openURL:phoneURL];
}
Apple URL scheme Reference
NSString *phoneNumber = @"tel://1234567890"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
Try with
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://123456789"]];
精彩评论