Xcode 7提示App Transport Security has blocked a cleartext HTTP (http://) resource load的解决办法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Xcode 7提示App Transport Security has blocked a cleartext HTTP (http://) resource load的解决办法相关的知识,希望对你有一定的参考价值。
Xcode 7提示App Transport Security has blocked a cleartext HTTP (http://) resource load的解决办法
简而言之:ATS禁止了HTTP的明文传输,因为它不安全。可以修改Info.plist文件,让它临时允许明文传输。
解决办法:
在Info.plist文件中添加主Key值"NSAppTransportSecurity", Type为"Dictionary",
再添加次Key值"NSAllowsArbitraryLoads", Type 为"Boolean",“Value”为“YES”即可。
在info.plist中添加代码实现为
<key>NSAppTransportSecurity</key><dict>
<key>NSAllowsArbitraryLoads</key>
<true/></dict>
修改info.plist文件中可视化操作:
以上是关于Xcode 7提示App Transport Security has blocked a cleartext HTTP (http://) resource load的解决办法的主要内容,如果未能解决你的问题,请参考以下文章
iOS开发-Xcode 7 App Transport Security has blocked a cleartext HTTP 报错解决办法
Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
The resource could not be loaded because the App Transport