How to add NSExceptionDomains to plist of xcode Version 7.0.1? How to add NSExceptionDomains to plist of xcode Version 7.0.1? xcode xcode

How to add NSExceptionDomains to plist of xcode Version 7.0.1?


Firstly, your Info.plist has two separate NSAppTransportSecurity key-value pairs. You should fix that so there is only the one pair.

Your question doesn’t say what domains your images are loaded from. It would be easier to give a specific answer if you could include this information.

If, for example, your images are loaded from example.com or subdomains, you could add an exception as follows:

<key>NSAppTransportSecurity</key><dict>    <key>NSExceptionDomains</key>    <dict>        <key>appanalytics.embarcadero.com</key>        <dict>            <key>NSExceptionAllowsInsecureHTTPLoads</key>            <true/>        </dict>        <key>example.com</key>        <dict>            <key>NSIncludesSubdomains</key>            <true/>            <key>NSExceptionAllowsInsecureHTTPLoads</key>            <true/>        </dict>    </dict></dict>

If you don’t know in advance what domains the images will be loaded from, then you can instead allows HTTP access to all domains:

<key>NSAppTransportSecurity</key><dict>    <key>NSAllowsArbitraryLoads</key>    <true/>    <key>NSExceptionDomains</key>    <dict>        <key>appanalytics.embarcadero.com</key>        <dict>            <key>NSExceptionAllowsInsecureHTTPLoads</key>            <true/>        </dict>    </dict></dict>

Note that although the inclusion of appanalytics.embarcadero.com in this second example is technically redundant, it is recommended that you specify ATS exceptions for all known domains that your app will access.


You can read this tutorial on how to configure App Transport Security or you could just allow everything as before by adding Dictionary "NSAppTransportSecurity" with a Boolean key named "NSAllowsArbitraryLoads" with the value "YES" in your info.plist.


Your key name is NSExceptionAllowsInsecureHTTPLoads but it should be NSTemporaryExceptionAllowsInsecureHTTPLoads

Also, did you try to add

<key>NSExceptionRequiresForwardSecrecy</key><false/>

to ATS domain's key?
Some domains requires it.