Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone emulator URL schema for phone call

I'm new to iPhone dev. I could solve most of my problem reading stackoverflow/apple doc, but now I'm kind of stuck.

I'm trying to make a phone call from a phone number.

from the doc and example I found, I made this:

// "9312345678"
-(void) doCall:(NSString*) phoneNumber{
    DsLog(phoneNumber);
    NSString * s = [NSString stringWithFormat:@"tel:%@",phoneNumber];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:s]];
}   

This do nothing ! (no exception, no dialgo, no phone call)

Did I did something wrong? Is it because it's the emulator?

any help appreciated,

Loda

PS: I got something similar to open the browser, and it's working fine; The log show in the debugger console with a valide phone number.

like image 341
Loda Avatar asked Aug 11 '09 11:08

Loda


1 Answers

btw its tel:// not tel:

But it does not work in the simulator.

If you want to see what handlers work, you can open up the simulator and safari (within the simulator) and then try it out. You can also do it from a real phone.

like image 124
nolim1t Avatar answered Sep 27 '22 20:09

nolim1t