Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

"Transport Security has blocked a cleartext HTTP" How do I make the HTTP work?

I am currently working on the Photo Bomber's Objective-C project. When I run the app, the following code displays in the console:

"Photo Bomber[2812:86189] 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."

Am I right in thinking that I have to somehow make this HTTP trusted? If so, how?

1 Answer

Dan Shepherd
Dan Shepherd
4,617 Points

This happens because newer versions of the iOS SDK block non secure requests be default. You can override this behaviour by adding the "App Transport Security Settings" dictionary key to your Info.plist and then adding the "Allow Arbitrary Loads" as a subkey, setting its value to YES.

A picture being worth 1000 words, this is what it should look like.

Thank you Dan, this is very helpful. :)