0

I'm trying to troubleshoot some unrelated issues, and I want to make requests to a non-SSL localhost server from my nativescript app running in the iOS sim.

I have updated my info.plist which is located at app/App_Resources/iOS/info.plist and included this at the bottom:

<key>App Transport Security Settings</key>
<dict>
    <key>Allow Arbitrary Loads</key>
    <true/>
</dict>

enter image description here

However, when the request is made to http://localhost:3000 I still get

TypeError: Network request failed: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

I can't find any additional instructions for disabling ATS, but I must have missed something?

My simulator is using iOS 12.1

phauwn
  • 341
  • 3
  • 15
  • Can you make sure that localhost is available? Also try a clean build. Adding `NSAllowsArbitraryLoads` should be suffcient enough – Narendra May 30 '19 at 23:03
  • localhost definitely available. can load it through safari on the simulator as well. I ran tns platform clean ios, tns build ios, then tns run ios --emulator... any other ideas that can help me debug this? – phauwn May 30 '19 at 23:30
  • Additional thought: are you using a non-secure WiFi..? – Jamie Birch May 30 '19 at 23:56
  • 1
    Thanks Jamie, your alternate syntax in the info.plist worked, but I'd like to understand why since almost every other similar solution suggests what I had originally. – phauwn May 31 '19 at 02:21

0 Answers0