使用HTTPS(SSL)工作的图像源URI,HTTP不起作用(React Native v0.30.0) [英] Image Source URIs with HTTPS (SSL) Work, HTTP do NOT Work (React Native v0.30.0)

查看:187
本文介绍了使用HTTPS(SSL)工作的图像源URI,HTTP不起作用(React Native v0.30.0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在React-Native版本30中,某些图像未加载。

In React-Native version 30 certain images are not loading.

这是有效的

<Image style={styles.messageImage} 
       source={{uri:'https://facebook.github.io/react/img/logo_og.png'}}/>

这不起作用

<Image style={styles.messageImage} 
       source={{uri:'http://i.imgur.com/lDz3wVn.png'}}/>

看起来带有 https 链接的图片正在运行而那些 http 链接不起作用。还有其他人面临这个问题吗?

Looks like images with https link are working while those with http link are not working. Is anyone else facing this issue?

谢谢。

推荐答案


  1. 打开xos中的ios / YourProject.xcodeproj

  2. 打开info.plist作为属性列表

  3. 右键单击App Transport Security Settings> Add Row

  4. 添加允许任意加载 布尔值并将其设置为

  5. 重建你的应用。

  1. open ios/YourProject.xcodeproj in xcode
  2. open info.plist as Property List
  3. Right click on App Transport Security Settings > Add Row
  4. Add Allow Arbitrary Loads Boolean and set it to Yes
  5. rebuild your app.

Xcode默认阻止所有http请求,只允许https请求。因为这是正确的做法。

Xcode by default blocks all the http request and only allows https request. Because it is the right thing to do.

这是一篇关于App Transport Security的博文:https://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx -10-11 /

Here is a blog post about App Transport Security: https://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

这篇关于使用HTTPS(SSL)工作的图像源URI,HTTP不起作用(React Native v0.30.0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆