本文介绍了“StorageMetadata"类型的值没有成员“downloadURL"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将 Firebase Storage 更新到 5.0.0,看起来 metadata.downloadURL() 不再被识别.('StorageMetadata' 类型的值没有成员 'downloadURL')

I just updated Firebase Storage to 5.0.0 and it looks like metadata.downloadURL() is not recognized anymore. (Value of type 'StorageMetadata' has no member 'downloadURL')

虽然在查看文档后它应该仍然可用:

Though after looking in the documentation it should still be available :

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

项目已清理干净已经重建了.

The project was cleaned & rebuilt already.

我错过了什么吗?

推荐答案

你可以试试吗

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

这篇关于“StorageMetadata"类型的值没有成员“downloadURL"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 09:13