swift - “StorageMetadata”类型的值没有成员“downloadURL”
问题描述
我刚刚将 Firebase Storage 更新到 5.0.0,它看起来metadata.downloadURL()
不再被识别了。( Value of type 'StorageMetadata' has no member 'downloadURL'
)
虽然在查看文档后它应该仍然可用:
该项目已经清理和重建。
我错过了什么吗?
解决方案
你能试一下吗
// Create a reference to the file you want to download
let starsRef = storageRef.child("images/stars.jpg")
// Fetch the download URL
starsRef.downloadURL { url, error in
if let error = error {
// Handle any errors
} else {
// Get the download URL for 'images/stars.jpg'
}
}
推荐阅读
- python - 比较 Python 中子列表的索引位置
- ios - 在 SwiftUI 中将 @Binding 变量从协议 var 传递给 if
- android - kotlin:检查项目是否为文本框
- python - Numpy int 位长
- selenium-webdriver - 无法启动 Selenium WebDriver:对远程 WebDriver 服务器的 HTTP 请求 URL 超时
- python - 使用 apache(python 应用程序)作为独立进程启动 nginx
- javascript - 如果 JS 在 POST 请求上处理上传文件
- reactjs - 更新 useState 和 AsyncStorage 并根据给定结果重新渲染屏幕
- ibm-mq - 如何使用 MQ Visual Edit 一次性发送多条消息?
- javascript - 遍历对象数组仅返回 1 个对象