• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Calling *23* with "tel:"-link

New Here ,
Jan 21, 2012 Jan 21, 2012

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

Views

923

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2012 Jan 22, 2012

Copy link to clipboard

Copied

LATEST

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 the stringByAddingPercentEscapesUsingEncoding: method of NSString 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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines