iOS 9 请求网络数据出现:App Transport Security has blocked a cleartext HTTP (http://) resource load since it

来源:互联网 发布:淘宝开店卖捕鱼游戏币 编辑:程序博客网 时间:2024/05/21 07:10

iOS 9 请求网络数据出现:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure

问题原因:在iOS9.0之后版本中,苹果将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据。
解决方案:(1)打开xcode项目中的Supporting Files文件夹;
        (2)选中Info.plist;
(3)在Info.plist中增加如下键值对:

(4)再次运行程序完美解决问题!
1 0