“The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.”
I started getting this error when making network requests to our dev server after upgrading and testing our app using Xcode 7 and iOS 9.
It turns out that this is a feature introduced in iOS 9, App Transport Security. It basically requires the app to make requests to https urls. These also should be specified in the info.plist.
It is possible to switch this off and at the time of writing this post that was the easiest course of action.
<key>NSAppTransportSecurity</key> <dict> <!--Include to allow all connections (DANGER)--> <key>NSAllowsArbitraryLoads</key> <true/> </dict> |
** This is not the advised way to deal with this error **
Have a look at Steven Peterson’s blog post going into a lot more detail about how to configure your app for App Transport Security