Flutter: 解决WebView无法打开非SSL页面的问题

这个问题主要源于iOS的安全策略,所以解决这个问题就要从iOS入手。方法如下(感谢作者:https://github.com/flutter/flutter/issues/33464#issuecomment-497055810):

 

For the WebView:

  - ADD this in ios/Runner/Info.plist - allows embedded views like webview_flutter
  <key>io.flutter.embedded_views_preview</key>
  <true/>
  
  - ADD this in ios/Runner/Info.plist - allows unsafe sources like http
  <key>NSAppTransportSecurity</key>
  <dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
  </dict>

  - ADD this in pubspec.yaml under dependencies
  webview_flutter: ^0.3.7+1

posted @   GreatK  阅读(298)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2014-06-27 SharePoint 2013:解决爬网出错的问题
点击右上角即可分享
微信分享提示