fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 929 forks source link

Url schemes for applications intents not working #714

Open rameznabel opened 4 years ago

rameznabel commented 4 years ago

Url schemes for applications intents not working, for example calling whatsapp://xxxx from web application from webview plugin renders error Screenshot_20200410_222416_com brotinni flutterapp

deependra227 commented 4 years ago

This worked for me.

flutterWebviewPlugin.onUrlChanged.listen((String url) async {
      if ( ! (url.startsWith("http:") ) 
       {
        flutterWebviewPlugin.goBack();
        _launchURL(url); //use url launcher plugin
      } 
}
swarupbc commented 3 years ago

@deependra227 where should i put this code?

deependra227 commented 3 years ago

In void initState(){ }

swarupbc commented 3 years ago

@deependra227 I think I'm doing something wrong, can you please tell me image

deependra227 commented 3 years ago

Remove async . check here. image

swarupbc commented 3 years ago

@deependra227 yes it's working, thank you so much