tags:

views:

141

answers:

2

Hi,

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 ?

A: 

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

Ed Marty
Mmm It doesn't work neither. I get this in the console now :< warning > Ignoring unsafe request to open URL tel:18
Christophe Konig
Well, that seems like it's just not letting you call that number because it knows it's an emergency number or something. Try using a regular phone number and see if that works. If it does, then the SDK is just set up not to let you dial 18 programmatically.
Ed Marty
It seems like it doesn't work for any combination of 2 numbers but I saw another application that could make it. I just wonder how...
Christophe Konig
I'm not familiar with non-US phone numbers, so I don't know what all of the + and # and (Wait) things mean, but have you tried putting something like a + or a - in the number that doesn't actually change the number dialed, but increases its length
Ed Marty
Ok so I tried +, # and the only way it worked was by inserting a pause after 18 like this : "tel:18p" BUT it shows in the phone application : "18," and i would like to avoid it and have only "18"...
Christophe Konig
A: 

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 !

Christophe Konig