iOS 移动端开发

出现HTTP load failed (error code:

2018-04-27  本文已影响560人  shouyu

当应用在某个设备上跑起来是出现HTTP load failed (error code: -1004 [1:61])的错误,但在其他设备上没有问题时,你需要在.plist中添加下面一段

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>mydomain.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
                <key>NSRequiresCertificateTransparency</key>
                <false/>
            </dict>
        </dict>
    </dict>

完美解决

上一篇 下一篇

猜你喜欢

热点阅读