-3

I have tried with the following code:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phone]];

and also registered strings in LSApplicationQueriesSchemes, but still not working phone call.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • 1
    Possible duplicate of [Make a phone call programmatically](http://stackoverflow.com/questions/4929717/make-a-phone-call-programmatically) – Teja Nandamuri Dec 14 '15 at 19:51
  • 1
    You need to update your question with more details. What is the exact value (including any possible whitespace) of `phone`? Is there any messages in the debug console when you try to call `openURL:`? – rmaddy Dec 14 '15 at 21:12
  • have you check that call facility available or not in your device? – kb920 Dec 15 '15 at 04:43

1 Answers1

1
NSURL *pho_No = [NSURL URLWithString:[NSString stringWithFormat:@"tel:1231231234"]];

if ([[UIApplication sharedApplication] canOpenURL:pho_No])
{
    [[UIApplication sharedApplication] openURL:pho_No];
}
else
{
    // iPad or iPod Touch, can't make a call
}

Also check that, NSURL object must not be nil.

Wolverine
  • 4,264
  • 1
  • 27
  • 49