2015-10-19

iOS9, Xcode7 - Could not connect to server

iOS9 사용, 당연히 Xcode7 compile 시에, 문제가 되었음.
문제는 http는 사용할 수 없으니 https로 요청하라 뭐 이런 거임.


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.
 
Info.plist 에서 아래와 같이 세팅.

<key>NSAppTransportSecurity</key>
<dict>
 <key>NSAllowsArbitraryLoads</key>
 <true/>
</dict>
 
NSAppTransportSecurity를 Dictionary로 세팅후 이 항목의 서브항목으로
NSAllowsArbitraryLoads를 Boolean값으로 세팅
 
즉 Info.plist에 아래와 같이 세팅
 
NSAppTransportSecurity<Dictionary>
    - NSAllowsArbitraryLoads<Boolean> : <YES>
 
 
출처:
http://iosdevtips.co/post/121756573323/ios-9-xcode-7-http-connect-server-error 

댓글 없음:

댓글 쓰기