I am trying to adopt iOS9 ATS support in my app. For that the following code will work for sure
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>YOURHOST.COM</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
But the problem here is that I have defined the server URL
in xcconfig file
which are different for development and distribution environment.
So, the problem here is that I want to get the server URLs from xcconfig file which will serve as key names in place of 'YOURHOST.COM'
in above code.
So when I try to fetch the server URL as
${SERVER_URL}
, I get the following error as
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.
This clearly means that the key name is not properly taken , on the other hand if I directly set the key value here, it works perfectly.
My xcconfig file
contains following code:
SERVER_URL=myserverUrl.com
I am unable to set the key name which I have to directly take from xcconfig file.
How can I do that?