views:

320

answers:

1

hi,

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.

A: 

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.

nolim1t
thanks for your accurate answer.
Loda