Skip to main content
Known Participant
September 22, 2012
Question

StageWebView Does Not Support "tel:" or "mailto:" URIs ???

  • September 22, 2012
  • 1 reply
  • 2009 views

I'm using FB 4.6 and StageWebView in my Android app. Basically the app is just a wrapper for a mobile website. Everything is working except links that contain the "tel:" URI and links that contain the "mailto:" URI do not work in StageWebView.

So, after a bit of research I discovered two events that appeared to offer a solution, LOCATION_CHANGING and LOCATION_CHANGE. I had planned to read the location property of the LOCATION_CHANGING event and then if it had a "tel:" URI I would just cancel the operation and use navigateToURL() to launch the URI in the system browser.

Trouble is, the location property of LOCATION_CHANGING is the current page location and not the location indicated by the link that was clicked.

So I tried LOCATION_CHANGE but although the location property is now correct, the page has already been loaded or an error thrown due to the unrecognized URI.

How can I make this work or is there any workaround to StageWebView's lack of support for these URIs?

This topic has been closed for replies.

1 reply

Known Participant
September 28, 2012

Does anyone from Adobe monitor these discussions? It would be great to get some sort of answer as to whether this issue is being addressed, considered or ignored!

Participating Frequently
December 13, 2012

I landed here with exact problem, from my experience:

1. Seems tel:, mailto:, and other local uri's works on Android (Tested with Air 3.5 sdk and Samsung Galaxy SIII ICS 4.0.4) and those 2 events DOES GET fired, then like you noted, you can use them to filter the telephone number and call navigateToURL("... method to open the system phone dialer etc. The LOCATION_CHANGING event will have the new location as the event property, but you must prevent default when you detect the phone number.

2. Neither of local uri's work on iOS, because StageWebView doesn't detect them as a link, so those 2 events NEVER get fired. (Tested on iOS 6.0, iPhone 3GS and iPhone 4S, Air 3.5 sdk). If you added the ErrorEvent to your StageWebView instance you will catch this error:  [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="The protocol is not supported.: tel:xxxxxxxx" errorID=3229]

Solution (both ugly and nasty, but what can we do ...)

1. Hack the onEror handler for StageWebView, check if text of ErrorEvent has tel: inside, prevent default and call navigateToURL again with parsed part of telephone number.

2. Change your html on server side, like for example .... <a href="http://telephone/123456789">Call Me</a> ... then do like you proposed already, parse the telephone number, prevent default and call navigateToURL ...

Cheers