Hello Stackoverflow,
I keep getting this error after I moved my swift app onto Swift2.0:
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.
And I took a look at the following link https://forums.developer.apple.com/thread/5835
and added the following code to my info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict/>
</dict>
And it still doesn't work, anyone have an alternative solution?
Its not a Swift 2.0
issue its actually an iOS 9.0
issue where iOS 9.0
forces web traffic to go over https
setting the below flag allows http
traffic.
You have to set the NSAllowsArbitraryLoads key to YES under NSAppTransportSecurity dictionary in your .plist file. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With