IOS 7 - 2 digits phone number not working
Asked Answered
H

2

8

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 ?

Halfcocked answered 26/9, 2013 at 11:44 Comment(2)
Hey did you sort this? I'm having this issue now.Measly
@AdamWaite how about tel:4-7Torero
J
2

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.

Joshia answered 29/11, 2013 at 6:28 Comment(2)
That works. Thanks. I can't mark correct because it's not my question but the bounty is yours.Measly
Great find & congrats. Reading the RTC, I think the correct format would be something like this: tel:18;phone-context=+2125551234. With the context being used so that someone dialing from outside can still connect.Flatto
F
1

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.

Flatto answered 26/11, 2013 at 14:49 Comment(1)
Telephony requires a pause command of some sort. It's a matter of finding what it maps to. It might be as simple as using a comma.Flatto

© 2022 - 2024 — McMap. All rights reserved.