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/51209931/

相关文章:

swift - 打开电话应用程序的方法(Swift)

ios - 升级到 Xcode7 后现有项目中出现警告消息

Android - Firebase 通知不工作

java - 如何在 Firebase 中从 .push() 获取随机生成的 userID

ios - Swift 4 尝试呈现其 View 不在窗口层次结构中的 ViewController

ios - HMAC SHA256 JWT 签名不正确

swift - 从其父类(super class)重写方法

ios - tapGestureRecognizer 在 UIScrollView Swift 上不触发 Action

ios - 在 iPad Air 上运行时应用程序的屏幕尺寸是多少?

ios - 如何从 View Controller 移动到 skscene