0

At first, I cannot request the network,so I got the way:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

But there turned up the question:

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.

Someone know this ? help!

samoye
  • 73
  • 1
  • 10

3 Answers3

2

Try This.

    <key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>yourserver.com</key>
    <dict>
      <!--Include to allow subdomains-->
      <key>NSIncludesSubdomains</key>
      <true/>
      <!--Include to allow HTTP requests-->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
      <!--Include to specify minimum TLS version-->
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.1</string>
    </dict>
  </dict>
</dict>
Darshan Karekar
  • 681
  • 3
  • 16
1

Need to change the Settings you need to change,Target -> Info enter image description here

Shangari C
  • 792
  • 1
  • 5
  • 17
0

Try to add External Hosts as a string with item 0 having * value in Info.plist. Check below image:

enter image description here

And,

Add below details: App Transport Security Settings as Dictionary and add Allow Arbitrary Loads to true.

Check underneath image:

enter image description here

Hope this will solve your problem.

Dhruv
  • 1,801
  • 1
  • 15
  • 27
  • It did not work: the error is :‘error==The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.’ – samoye May 11 '16 at 08:11
  • What is not working for you? Have added App Transport Security Settings in Info.plist? – Dhruv May 11 '16 at 08:23
  • I have already mentioned the same as accepted answer. At least you should upvote if you can not accept the answer in the case of helpful answer. – Dhruv May 11 '16 at 08:34