Flutter_webview_plugin net::err_unknown_url_scheme. error while opening external apps

Issue

Flutter_webview_plugin

But in my website there is a button which open whatsapp app and other apps

But in my webview after clicking that button it shows this error with all external app

Can you solve this
this image will show the error

Solution

use this and replace tel,mailto: and whatsapp with your external app links starting string.

` final flutterWebviewPlugin = new FlutterWebviewPlugin();

flutterWebviewPlugin.onUrlChanged.listen((String url) {
  if (url.startsWith('mailto:'))
  {

    _launchURL(url);
    flutterWebviewPlugin.stopLoading();
    flutterWebviewPlugin.reload();



  }
  else if (url.startsWith('tel:'))
  {

    _launchURL(url);
    flutterWebviewPlugin.stopLoading();
    flutterWebviewPlugin.reload();


  }else if (url.startsWith('whatsapp:') ||url.startsWith ('api.'))
  {

    _launchURL(url);
    flutterWebviewPlugin.stopLoading();
    flutterWebviewPlugin.reload();


  }`

Answered By – Shivam Singh

Answer Checked By – Robin (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *