【问题标题】:React Native : Not Fetched Firebase Storage ImageReact Native:未获取 Firebase 存储映像
【发布时间】:2018-04-14 21:16:57
【问题描述】:

我正在使用 react-native-image-cache-hocBlob

const CacheableImage = imageCacheHoc(Image, {
  fileHostWhitelist: ['firebasestorage.googleapis.com']
});

并渲染

<CacheableImage style={styles.image} source={{ uri: this.props.uri }} permanent={false} />

this.props.uri:

https://firebasestorage.googleapis.com/v0/b/tura-113e0.appspot.com/o/userImages%2Fa@a.com%2Fimages%2FG%C3%B6khan%20Geyik?alt=media&token=54864e18-b9ce-42f3-84ae

* 然后错误: props.source.uri 应该是具有有效协议和主机的 Web 可访问 url。注意:默认有效协议为 https,默认有效主机为 .

你能帮帮我吗? 谢谢。

【问题讨论】:

  • 您的图片网址返回 404。这可能是问题所在。
  • 您好,不,我在 url 中删除了我的应用名称。所以你不能打开它。但它工作正常。

标签: react-native react-native-fetch-blob react-native-image


【解决方案1】:

我解决了问题。我将 'react-native-cacheable-image' 更改为 Fast Image 'react-native-fast-image。

如果你想使用它,你可以阅读: https://github.com/DylanVann/react-native-fast-image

我使用了这段代码然后问题解决了

<FastImage source={{  uri: this.props.uri }} />

谢谢

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-26
    • 2017-01-16
    • 2020-03-06
    • 2020-03-23
    • 2018-07-08
    • 2017-08-28
    • 2017-10-21
    相关资源
    最近更新 更多