Home > DeveloperSection > Forums > How can I manage Calling on iPhone?
Felix Pickles
Felix Pickles

Total Post:24

Posted on    December-28-2015 5:53 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 457  View(s)
Rate this:
I am creating an iPhone application which will manage calls. But I am not understanding how can I manage it.
Can anyone clearify my issue, please provide me code if possible.
Thank you.

Tarun Kumar

Total Post:214

Posted on    December-28-2015 11:31 PM

The example I have provided below will be helpful and solve your problem because I have also use it in our own application.
This code will execute only on Device not on simulator:

NSString *tel_Number = @"+913337979111";
NSURL *tel_URL = [NSURL URLWithString:[NSString  stringWithFormat:@"telprompt:%@",tel_Number]];
if ([[UIApplication sharedApplication] canOpenURL:tel_URL]) {
    [[UIApplication sharedApplication] openURL:tel_URL];
} else {
    UIAlert *alert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Calling functionality is not available in simulator, please use Device!" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil, nil];
    [alert show];

Modified On Dec-28-2015 11:32:41 PM

Don't want to miss updates? Please click the below button!

Follow MindStick