Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

HTML5 telephone links not working in iOS webview

$
0
0

In our Xamarin Forms project we have a webview, and that webview loads a page from the web. That page contains HTML, including a link to a telephone number with the following HTML:
<a href="tel:18005555555">1-800-555-5555</a>

In Android, the user clicks the link in the webview and it opens the dialer no problem, but in iOS, it does nothing.

Here is the C# code inside the Xamarin page that handles the link click:
`
void bodyContent_Navigating(object sender, WebNavigatingEventArgs e)
{
var url = e.Source.GetValue(UrlWebViewSource.UrlProperty).ToString();
bool isAboutUsPage = url.Equals(aboutUsPageUrl);

        if ((Device.OS != TargetPlatform.iOS || !isAboutUsPage))
        {
            e.Cancel = true;
        }

        if (!isAboutUsPage)
           Device.OpenUri(new Uri(url));
    }

`

Any idea why this isn't opening the dialer in iOS?


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>