Dialing a command prefix on the iPhone
Posted
by tewha
on Stack Overflow
See other posts from Stack Overflow
or by tewha
Published on 2010-04-28T01:49:43Z
Indexed on
2010/04/28
1:53 UTC
Read the original article
Hit count: 389
Our application lets users call phone numbers. Users would like to be able to block their caller ID.
On other platforms, we let the user specify a custom dialing prefix. For instance, on my cell provider it's #31#.
I've tried two approaches so far.
First:
id url = [NSURL URLWithString: @"tel:#31#0000000"]
// produces nil
Second:
id encoder = ["#31#0000000" stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
// produces %2331%230000000
id url = [NSURL URLWithString: [NSString stringWithFormat: @"tel:%@", encoded]];
// produces a valid-looking NSURL which doesn't do anything
I'm thinking at this point that I'm just not allowed to dial # and *, even from a Cocoa touch application. (I know it's not allowed from a web app.) Is this true, or am I missing something obvious?
© Stack Overflow or respective owner