I hope to call with * character. ex> *711313.
Currently, I’m using this code:
NSString *str = [NSString stringWithFormat:@"tel:%@", tmp];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
I tested two cases:
-
tmp = @”719929292″; //this is ok. make call.
-
tmp = @”*7128282″; //app no reaction. not to call.
How can I call with *(star character)?
The star may have to be encoded for use in a URL. Try
%2Ainstead of*.This replacement is not done by
stringByAddingPercentEscapesUsingEncoding:since*is a valid URL character, albeit with a special meaning.