0

I understand that there is no possibility to call number of format like this"*100#" directly from app, but is there any chance to put number in native dialing panel and the user will choose to call or not to call? Thanks in advance.

Tino
  • 1
  • 1
  • I think that it is the way how to call directly to someone. I want just the user's decision to press on call or cancel button. – Tino Apr 24 '16 at 16:02

1 Answers1

1

The following code should do the job.

if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:+11111"]])
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:+11111"]];
}

Replace "+11111" with the number that you want to dial.

This code only works on an real iPhone and not on simulator.

Equivalent code in swift is

var url:NSURL? = NSURL(string: "tel://+11111")
UIApplication.sharedApplication().openURL(url!)
Marimuthu
  • 437
  • 4
  • 14