How to dial phone number programatically in iPhone / xCode?

H

UIDevice *device = [UIDevice currentDevice];

if ([[device model] isEqualToString:@”iPhone”] ) {

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@”tel:130-032-2837″]]];

} else {

UIAlertView *Notpermitted=[[UIAlertView alloc] initWithTitle:@”Alert” message:@”Your device doesn’t support this feature.” delegate:nil cancelButtonTitle:@”OK” otherButtonTitles:nil];

[Notpermitted show];

[Notpermitted release];

}

 

About the author

praveen.kumar
By praveen.kumar

Category