Http request failed because of the app transport security policy on iOS


#1

I am new to nativescript.
When I try to fetch some resource

  fetchModule.fetch("http://xxxxx").then(function(res){
    console.log(res)
  }).catch(function(err) {
    alert(err)
  });

It alerts.
I googled, and added to MyProject/platforms/ios/MyProject/MyProject-Info.plist

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

But it still alerts.


#2

I find the solution from a closed issue in nativescript repo.


#3

Adding that key to Info.plist, should do it, I believe. Can you post the solution here? Otherwise closing.