Details
Description
I tried to open geo: link (to launch navigation software from webapp) in Android WebView, and it failed with ERR_UNKNOWN_URL_SCHEME error.
Looks like scheme handling must be implemented explicitly. Here's QtAndroidWebViewClient extra method is needed to make it work:
@Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // handle http: and http: as usual if(URLUtil.isNetworkUrl(url)) return false; // try to handle geo:, tel:, mailto: and other schemes try { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); view.getContext().startActivity(intent); return true; } catch (Exception e) { e.printStackTrace(); return false; } }
It starts to suggest GPS navigation app, email app and so forth, while passing "invalid:" scheme gives same "ERR_UNKNOWN_URL_SCHEME" error.
I'll try to send it to codereview, if maintainers are not against, when I find free time.
iOS webview handles mailto, tel, sms schemes by default (though geo: has to be changed into maps://).