升级到Xcode7.0 不能联网的问题

来源:互联网 发布:linux nobody 用户 编辑:程序博客网 时间:2024/05/21 22:35
 由于Xcode的更新,当开发者升级到Xcdoe7.0后,发现不能联网了

#warning: 获取app配置信息失败: 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协议传输。
最终找到以下解决办法:
在Info.plist中添加NSAppTransportSecurity类型Dictionary。在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES


2F5721B6-2C74-4B59-84B3-7D77C541038F.png


转载自:
文/_会飞的鱼(简书作者)
原文链接:http://www.jianshu.com/p/4dd5773270f4
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。


0 0
原创粉丝点击