【发布时间】:2020-04-09 07:49:07
【问题描述】:
我正在尝试以 react native 显示 firebase 存储图像。我设法将图像写入 Firebase 存储,但现在我还想在应用程序中显示它。不幸的是,我试图理解文档但没有成功。有没有人可以帮助我?
我正在尝试让用户上传图像,然后它应该显示为图像。上传成功,在此处查看我的 firebase 存储:
现在我正在尝试从 firebase 存储中获取图像并使用以下代码显示它:
componentDidMount(){
this.imageUploaded = firebase.storage().ref('images/profilepictures/536887a2-c8fe-4c60-b2f1-3864f691fa9e.jpg').getDownloadURL().toString();
console.log(this.imageUploaded);
}
但是,console.log (this.imageUploaded) = [object object] 和图像中的结果保持空白:
<Avatar size="large" rounded source={{uri: this.imageUploaded }} onPress={() => console.log("Works!")} activeOpacity={0.7} />
什么都不显示。有没有人可以帮助我理解这一点?非常感谢您!
【问题讨论】:
标签: react-native firebase-storage