使用flutter_inappbrowser库iOS无法加载链接问题

flutter中使用webview,用了 flutter_inappbrowser 这个库,Android端显示正常,iOS出不来,最初网上找大多数都是说是因为没有添加对http请求的信任,需要在info里面添加

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

但是试过之后没有,后来一阵折腾,在官方库的文档中找到

  • InAppWebView: Flutter Widget for adding an inline native WebView integrated into the flutter widget tree. To use InAppWebView class on iOS you need to opt-in for the embedded views preview by adding a boolean property to the app's Info.plist file, with the key io.flutter.embedded_views_preview and the value YES.

就是说在info添加 io.flutter.embedded_views_previewtrue 就行了

<plist version="1.0">
<dict>
        ...
    <key>io.flutter.embedded_views_preview</key>
    <true/>
</dict>
</plist>

使用各种类库之前先看认真文档、说明很重要。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 12,866评论 0 6
  • 说实话,我很喜欢这种天气,喜欢大风摇晃树木的刷刷声,更喜欢下雨的周末能窝在家里,泡一杯茶,茶是喝的越来越浓了,继续...
    紫苏薄荷唇形科阅读 1,605评论 0 0
  • 我拔了琴弦,起奏,千里之外 你回音和赞 如一首赞歌 早已传颂 诗是一根长弦 你在那边 我在这边 我们同样诗心的频率...
    鱼在海里游鱼儿阅读 2,732评论 2 6
  • 我喜欢这样的恋爱方式: 两个人相处在一起,我调侃你,你调侃我。即便生气时也不会转身离开,而是默默陪伴。 你生病时,...
    更读传家阅读 2,801评论 3 2
  • 芝受香决心抓住机会。她施展浑身解数,把老大服侍得相当满意,于是当下给她减去四十万元。即使这样她还有一百五十万的债务...
    弱水一杯阅读 1,865评论 2 9