Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS 7 - 2 digits phone number not working

I'm actually trying to call 2 digits phone numbers via openURL (works properly for 3+ digits).

On IOS 6 i was using an hack, like this :

if (self.numberToCall.length < 3) {
    self.numberToCall = [NSString stringWithFormat:@"%@?000", self.numberToCall];
}    

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", self.numberToCall]]];

Not working on IOS 7 (does nothing).

Someone has a solution ?

like image 575
F. Lambert Avatar asked Sep 26 '13 11:09

F. Lambert


2 Answers

I've found a solution :

tel://18;18

it woorks on iOS6 and iOS7

";" is used for phone context http://www.ietf.org/rfc/rfc2806.txt

the phone number showed is 18;18 but it makes the call.

like image 88
Yableio Avatar answered Oct 20 '22 02:10

Yableio


You can try appending a pause, as in tel:42p, this will show as 42,. Not great, but a workaround. It looks like Apple has been having a lot of issues with this because the behavior changes so often between iOS versions.

like image 1
Yimin Rong Avatar answered Oct 20 '22 00:10

Yimin Rong