小编典典

类型“ StorageMetadata”的值没有成员“ downloadURL”

swift

我刚刚将Firebase Storage更新为5.0.0,看来metadata.downloadURL()不再被认可了。(Value of type 'StorageMetadata' has no member 'downloadURL'

尽管在查阅文档之后,它仍然应该可用:

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

该项目已经清理和重建。

我想念什么吗?


阅读 261

收藏
2020-07-07

共1个答案

小编典典

你能试一下吗

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