Fix ERR_UNKNOWN_URL_SCHEME on Android WebView for tel:\sms:\geo:\etc links

I am building a hybrid mobile app with Visual Studio Tools for Apache Cordova that is able to make phone calls, send text message or emails, view a location on a map, etc. These are all handled with external applications (for instance use Gmail to send an email or Maps to pinpoint a location). They are placed in an anchor tag in HTML, such as <a href="tel:12345678">, <a href="sms:12345678">, <a href=""> or <a href="geo:...">. These work fine except that when you execute one of these actions and the system opens another app you see for a short time a webview with an error: “Web page not available”. Then the external app opens, you take the action and then go back to the app. At that point you again see this webview with the error as shown below.

ERR_UNKNOWN_URL_SCHEME when sending a text message
ERR_UNKNOWN_URL_SCHEME when sending a text message

This seem to be a known issue as I found many references of it on the web. Here are several for reference:

I am using the InAppBrowser plugin to open links in external apps. In order for this to work the schemes must be white-listed in Cordova’s config.xml file and the launch-external attribute should be set to true (which was already set in my case).

The indicated solution is to override WebView.shouldOverrideUrlLoading method.

I added the following in plugins\cordova-plugin-inappbrowser\src\android\ in the plugin’s WebView extension, but that did not work as the code did not even execute.

Looking for a solution I have noticed that this was only working OK for tel: and for others it was exhibiting this behavior. Then I found the following code in the InAppBrowser plugin class, in the execute() method.

I have changed that to include the other schemes and that fixed the problem.

With this in place, the web page error no longer shows up for any URL scheme.

I’m not sure if this is the best solution, but it is the only one that I managed to implement.

12 Replies to “Fix ERR_UNKNOWN_URL_SCHEME on Android WebView for tel:\sms:\geo:\etc links”

  1. public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if( url.startsWith(“http:”) || url.startsWith(“https:”) ) {
    return false;

  2. Hello sir I got one issue like it’s like d pop up notification in which it gives web page is not available n I want to know what is the actual problem

  3. I was using WHATSAPP and suddenly it stop and shows net::ERR_UNKNOWN_URL_SCHEME. WHAT WILL I DO. Now I cannot downliad Whatsapp

  4. Viber on my cellphone couldn’t installed in spite repeatedly trying.Could you

  5. Salut am citit cu interes implementarea facuta de tine cum as putea face in cazul ca as dori sa deschis linkuri care incep cu “sop://” si “acestream://”
    daca ma poti ajuta iti multumesc anticipat

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.