1、iOS9 HTTP 不能正常使用的解决办法

时间:2023-03-08 20:29:54

升级Xcode7.0 bata发现网络请求访问失败

输出的错误信息:

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
IOS9引入了新特性 App Transport Security (ATS),详情:App Transport Security(ATS)新特性要求APP内访问的网络必须使用HTTPS协议。
现在公司的项目使用的是HTTP协议,使用私有加密方式保证数据的安全。现在也不能马上改成HTTPS协议传输。
问题解决
1、在Info.plist中添加NSAppTransportSecurity类型Dictionary。 2、在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
如图
1、iOS9 HTTP 不能正常使用的解决办法
1、iOS9 HTTP 不能正常使用的解决办法

相关文章