在Flutter中,我使用flutter webview plugin来启动一个网址:
flutterWebviewPlugin.launch(url)
要么
WebviewScaffold(
url: url,
appBar: new AppBar(title: Text(title), actions: [
new IconButton(
icon: const Icon(Icons.share),
onPressed: () => Share.share(url),
)
]),
withZoom: true,
withLocalStorage: true,
withJavascript: true,
);
但是,如果打开的网页中的任何链接是应用程序链接,例如:fb:// profile,我将获得net :: ERR_UNKNOWN_URL_SCHEME .
在android中,我发现解决方案是覆盖here中提到的shouldOverrideUrlLoading,但是我该怎么办呢?
3 回答
看起来你可以使用这个插件实现你所需要的:https://pub.dartlang.org/packages/flutter_web_view
听取你的重定向:
获取 Value 使用:
获得网址后,您可以使用此包https://pub.dartlang.org/packages/url_launcher
你可以使用web插件
这可能不是你想要的,但我会建议一个带有指向AppStore直接页面链接的按钮 .
这些AppStore链接可以使用Apple提供的this one等网站进行 .
这是android提供的一个click me
它只是一个链接,可以立即打开App Store而不是进入Web视图 .