react-native0.44, i am use fetch request "http", but network request failed?

i'm from official find fetch only support https, but now, i use Mock data, the url is http, official said if support http must change info.plist, add NSAppTransportSecurity and NSAllowsArbitraryLoads, below the image:

infoPlist seetting

i add App Transport Security Settings and children row Allow Arbitrary Loads,

the request http not support! please ask how to resolve support Mock http request in react-native ? Thanks!

i use Mock is Alibaba "Rap" Mock address, it's only support Mock http request!

2 answers

  • answered 2018-04-14 16:00 Stackia

    Info.plist will take effect after recompiling your app.

    Probably you need to recompile your app by rerun react-native run-ios or rerun from Xcode.

  • answered 2018-04-14 16:13 Pritish Vaidya

    You should not use NSAllowsArbitraryLoads must be set to false. Instead you should add an exception to your domain.

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

    Right now you are exposing your device to vunerabilities.

    Checkout this post