Trying to port an app over which is based on a bunch of node modules using http
.
Is there a solution to this, other than rewriting libraries for fetch
?
Trying to port an app over which is based on a bunch of node modules using http
.
Is there a solution to this, other than rewriting libraries for fetch
?
http
is only an issue on iOS 9+. You can just allow the http
like this - React Native fetch() Network Request Failed
Here is where it is mentioned in the docs - http://facebook.github.io/react-native/releases/0.44/docs/running-on-device.html#app-transport-security
Go to your info.plist file here: /Users/Noitidart/Documents/YOUR_PROJECT_NAME/ios/YOUR_PROJ_NAME/Info.plist
then find NSExceptionDomains
. You will see localhost
is already there. You can add other domains here. This is what it looks like to allow bing as http:
<key>NSAppTransportSecurity</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>bing.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
You can allow all http by setting:
<key>NSAllowsArbitraryLoads</key>
<true/>
Per - https://stackoverflow.com/a/38427829/1828637
On Android, http
is not a problem.