Problem with a call button - doesn't open tel:// URL

I am trying to make a call button that will call 18 which is Fire Dept in France.

So my code is :

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18"]];

It doesn't work and I get this message in the console :

< warning > Ignoring unsafe request to open URL tel://18

But I saw other application that have the same button fully working !

I am trying this on the device of course.

What am I missing ?

Answers


Ok I Found the answer after wasting many hours...

Here is the solution :

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18?1"]];

The iPhone accepts the interrogation mark but ignores it when initiating the call !

In Safari, if you try this :

tel://18

It won't work but if you try this :

tel://18?1

It will call 18 !


The correct url has no backslashes. That is, it should be tel:18


tel://18?1 works fine on iOS4, but it seems that iOS5 ignores everything after the ? character and refuses to just call 18...

However, tel://18♯1 works on iOS5 (and calls number 18) but not on iOS4, so you have to switch according to the iOS version of the client.


Need Your Help

Silverlight programmatically binding from C# code

silverlight binding

I have a Canvas and a custom control called BasicShape