By default iOS isn’t supporting HTTP requests, only HTTPS requests are allowed.
But what if you have an API that only works with HTTP, you can easily change the setting’s to support HTTP requests.
When I first tried to do a request to an HTTP address it gave me the error “Network Request Failed”. I couldn’t get why.
But after some digging, I figured iOS was only supporting HTTPS.
To change this, open the “info.plist”. You can find this at ‘ios/ProjectName’.
<key>NSAppTransportSecurity</key>. If it’s there already you only need to this code below it:
<br /><dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
Now close your simulator and kill the running process (if you already started it). Run react-native run-ios again, and now your iOS app will support HTTP calls.
Hope this will help to fix your problem with React Native 🙂