iOS9 出现 the resource could not be loaded because the app transport security policy requires the use

今天更新了Xcode 7 正式版,App编译出现不少警告,在App运行的时候出现以下的提示.........html

the resource could not be loaded because the app transport security policy requires the use of a secure connection ios

资源不能被加载,由于该应用程序传输的安全策略要求使用安全链接安全

 

iOS9引入了新特性App Transport Security (ATS)。详情:App Transport Security (ATS)网络

新特性要求App内访问的网络必须使用HTTPS协议。意思是Api接口之后必须是HTTPS 
可是如今公司的项目使用的是HTTP协议,使用私有加密方式保证数据安全。如今也不能立刻改为HTTPS协议传输。app

暂时解决办法:ui

  1. 在Info.plist中添加NSAppTransportSecurity类型Dictionary
  2. NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
相关文章
相关标签/搜索