问题人生[20160112] the App Transport Security policy requires the use of a secure connection

来源:互联网 发布:sys types.h windows 编辑:程序博客网 时间:2024/05/17 08:43


    错误信息:


    App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

    The resource could not be loaded because the App Transport Security policy requires the use of a secure connection


    原因:


    iOS9引入的新特性ATS(App Transport Security)要求App内访问的网络必须使用https协议,而目前我们使用的是http协议,所以无法连接服务器 。

 

    解决方法:


    设置info.plist文件

    在顶层添加字典项:App Transport Security Settings,

    同时在该项下添加子项:Allow Arbitrary Loads,并设置其值为YES


          




0 0
原创粉丝点击