MiRiNMan MiRiNMan - 1 year ago 91
iOS Question

ios 9 and NSAppTransportSecurity

There is a problem with iOS 9 and work with the server.
I info.plist set:


When you run the application through Xcode, everything is fine. Work with the server takes place perfectly. But as soon as I stop the application and try to run it by simply clicking on the icon in the simulator. The network stops working. The same problem when I send the application to the Review in TestFlight. The application is installed, but the network stops working again.

Xcode 7.0 (7a220)
iOS 9.0

Answer Source

Are you sure it's not working? I tested it and everything is fine.

Possible actions:

Having a Debug mode enabled, build your app, run it from Xcode and make sure that you don't get an App Transport Security error:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

when launching it from Xcode using your simulator. Now find a DEVICE_CODE of the same very simulator

(Hint: it will be one of these ~/Library/Developer/CoreSimulator/Devices/. The easiest way to find this code from Xcode is to go Window->Devices)

and open with Console its log file:


Clear the history (just in case you can launch your app from Xcode once again and make sure your output is getting into the log-file you opened, and that you still don't get App Transport Security error in there).

Now launch your app from the simulator and check if you have any errors related to App Transport Security in the log.

For me I don't have any if none of them I get when working from Xcode.



It's strongly recommended to not set an NSAllowsArbitraryLoads to true, you'd rather want to achieve the desired result with:

      <!--Include to allow subdomains-->
      <!--Include to allow HTTP requests-->
      <!--Include to specify minimum TLS version-->