Alex Delgado Alex Delgado - 1 year ago 120
Objective-C Question

Error loading web in UIWebView

I'm using an UIWebView and I can't load facebook. I have to say that I'm using xcode 7 beta 2 and iOS 9.0 beta 4.

This is the error:

Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."

Answer Source

So, I will answer my own question. As CSmith answered, apple wants us to use App Transport Security (ATS). But yet, as there are many people not ready, I'll show the way to avoid it. In your info.plist add the next thing:

  <!--Include to allow all connections (DANGER)-->

related: iOS 9 ... Are WebView(s) exempt from the App Transport Security Exceptions (ATS) rules that block insecure HTTP hosts?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download