Copy link to clipboard
Copied
I have a link in my Flash Builder project that when you press a button it should automatically call that code (using the normal telephone app in iOS). The current code:
navigateToURL(new URLRequest("tel:*23*3")) ;
will not work. Nothing happens when clicking the button. If I change the code to the following:
navigateToURL(new URLRequest("tel:823\,3")) ;
it will work (you get the same function from the operator if you call *23* as if you call 823, but by using *23* it will be a lot faster and you won't have to wait for the answer).
Can anyone help me get it to work calling *23*?
Best regards from Camilla in Sweden
Copy link to clipboard
Copied
So after some more research I found the fullowing:
To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account, the Phone application supports most, but not all, of the special characters in the
tel
scheme. Specifically, if a URL contains the*
or#
characters, the Phone application does not attempt to dial the corresponding phone number. If your application receives URL strings from the user or an unknown source, you should also make sure that any special characters that might not be appropriate in a URL are escaped properly. For native applications, use thestringByAddingPercentEscapesUsingEncoding:
method ofNSString
to escape characters, which returns a properly escaped version of your original string.
In Xcode there is apperantly a way to get around this, by using the following code:
- ( void ) callPhoneNumber: ( NSString *) phoneNumber
{
phoneString = [[ NSString stringWithFormat: @"tel:%@", [ phoneNumber stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding ]];
phoneURL = [ NSURL URLWithString: phoneString ];
if ([[ UIApplication sharedApplication ] canOpenURL: phoneURL ])
{
[[ UIApplication sharedApplication ] openURL: phoneURL ];
}
}
Can I do something similar with Flash builder?