Can't show Image by URI in React Native iOS Simulator

后端 未结 5 1598
情话喂你
情话喂你 2020-12-17 19:12

I\'m using react-native 0.28.0

I\'m trying to show an image on iPhone simulator according to this tutorial: http://www.appcoda.com/react-native-introduction/

5条回答
  •  余生分开走
    2020-12-17 19:40

    The problem is that your are trying to load the image from a http connection and not from a https connection as it is demanded by apple.
    Try if your code works with another uri which uses https instead of http. In Android it should work fine with either http or https.
    Read more at https://github.com/facebook/react-native/issues/8520 and http://www.techrepublic.com/article/wwdc-2016-apple-to-require-https-encryption-on-all-ios-apps-by-2017/.

    If you really want to load something over http you can edit the info.plist file and add your exception there. More detailed info here https://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

    See also my stackoverflow question here: React-native loading image over https works while http does not work

提交回复
热议问题