【问题标题】:Flutter : By default, Android Pie will request that apps use HTTPS no HTTP requestFlutter:默认情况下,Android Pie 会请求应用使用 HTTPS 没有 HTTP 请求
【发布时间】:2019-03-05 11:45:31
【问题描述】:

默认情况下,Android Pie 会要求应用使用 HTTPS 连接而不是 HTTP。 所以无法在 HTTP 中访问 restful API

【问题讨论】:

    标签: http networking https flutter android-9.0-pie


    【解决方案1】:

    https://android-developers.googleblog.com/2018/04/protecting-users-with-tls-by-default-in.html?m=1 解释如何选择退出特定域或任意域

    <network-security-config>
        <domain-config cleartextTrafficPermitted="true">
            <domain includeSubdomains="true">insecure.example.com</domain>
            <domain includeSubdomains="true">insecure.cdn.example.com</domain>
        </domain-config>
    </network-security-config>
    

    我不确定 Android Pie 中引入的限制以及此处提到的选择退出是否适用于使用 dart:io 建立的 HTTP 连接。

    【讨论】:

    • 在原生 android 开发的情况下我知道这一点,但现在我已经在 Flutter 应用程序的情况下实现了同样的功能谢谢兄弟...
    • 这对你有用吗?我加了,不影响
    猜你喜欢
    • 1970-01-01
    • 2011-12-06
    • 1970-01-01
    • 2018-05-20
    • 2017-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多