swift - 类型 'StorageMetadata' 的值没有成员 'downloadURL'

标签 swift xcode firebase swift4 firebase-storage

我刚刚将 Firebase Storage 更新到 5.0.0,但 metadata.downloadURL() 似乎不再被识别。 (“StorageMetadata”类型的值没有成员“downloadURL”)

尽管查看文档后它应该仍然可用:

https://firebase.google.com/docs/reference/swift/firebasestorage/api/reference/Classes/StorageMetadata#/c:objc(cs)FIRStorageMetadata(im)downloadURL

该项目已经清理和重建。

我错过了什么吗?

最佳答案

你能试试Google Firebase docs

// 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'
  }
}

关于swift - 类型 'StorageMetadata' 的值没有成员 'downloadURL',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56148503/

相关文章:

ios - 使用自定义警报 View 中的按钮在 Swift 中的另一个 ViewController 中继续

ios - 可以将传入的电话号码存储为 iO 上的变量吗?

swift - 初学者 : My swift code wont run on the side of playground even though it gives no error?

xcode - 反向地理编码以仅以英文返回结果?

objective-c - Command/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ 失败,退出代码为 1

android - fcm 刷新 token 何时创建

ios - 如何在 Storyboard中设计 UIScrollView

c++ - 包含 openCV 的 .hpp 文件,但未找到 C++ 绘图函数

android - 如何在 Firebase 中向数组添加新对象

firebase - 写入 FireStore - 失败时如何显示错误(如果没有网络)