新版ios禁止HTTP访问的解决方法

RT,直接访问会提示:

解决方法有2种:

参考自:http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http

See the developer forums: https://forums.developer.apple.com/thread/3544

Also this page: http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

推荐解法,添加域名的白名单:

不推荐解法,允许全部HTTP请求:

Note:

info.plist is an xml file so you can place this code more or less anywhere inside the file

Leave a Reply

Your email address will not be published.