我刚刚将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

该项目已经清理和重建。

我想念什么吗?

最佳答案

你能试一下吗

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

10-10 21:48