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.
Asked
Active
Viewed 62 times
1 Answers
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