【问题标题】:Netflix not opening in Flutter WebViewsNetflix 未在 Flutter WebViews 中打开
【发布时间】:2021-12-28 13:51:34
【问题描述】:

我正在尝试使用非常常见的插件 WebView 打开 Netflix。

我可以导航到 netflix.com 甚至登录,但是当我尝试点击电影或电视节目时,它会返回此错误(在屏幕截图中)。
为什么“intent//:”会在 URL 的前面加入,我该如何解决这个错误?

WebView 的代码非常基本。

import 'package:webview_flutter/webview_flutter.dart';

class Browser extends StatefulWidget {
  const Browser({Key? key}) : super(key: key);

  @override
  _BrowserState createState() => _BrowserState();
}

class _BrowserState extends State<Browser> {
  late WebViewController controller;
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: WebView(
          initialUrl: "https://www.netflix.com/browse",
          javascriptMode: JavascriptMode.unrestricted,
        ),
      ),
    );
  }
}

The Screenshot with the error.

【问题讨论】:

  • 问题在于网站检测到当前设备是 Android 设备,并尝试将用户导航到 Netflix 应用程序,因此使用了intent:// 标签。您可以尝试通过添加不同的用户代理来加载 URL。
  • 我该怎么做?.....我必须使用 if else 从链接中删除 intent//: 还是有其他方法?
  • 您可以尝试将intent:// 替换为https://
  • Ya.....我该如何替换它?
  • 您可能想检查一下,将回调中的intent 替换为httpsstackoverflow.com/a/37145639/6819340

标签: android flutter dart webview


【解决方案1】:
<application
  ....
  android:usesCleartextTraffic="true"
....>

<uses-permission android:name="android.permission.INTERNET" />

【讨论】:

  • 什么都没发生......我仍然遇到同样的错误
猜你喜欢
  • 2022-11-10
  • 2016-11-01
  • 2020-10-18
  • 1970-01-01
  • 2020-07-04
  • 2015-06-15
  • 2019-10-10
  • 2020-10-11
  • 1970-01-01
相关资源
最近更新 更多