HOW CAN I MANAGE CALLING ON IPHONE?

Felix Pickles

Total Post:24

Points:168
Posted by  Felix Pickles
 474  View(s)
Ratings:
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.
  1. Tarun Kumar

    Post:214

    Points:1642
    Re: How can I manage Calling on iPhone?

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!