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

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


该项目已经清理和重建。


我错过了什么吗?


BIG阳
浏览 587回答 3
3回答

慕妹3146593

你能试一下吗// Create a reference to the file you want to downloadlet starsRef = storageRef.child("images/stars.jpg")// Fetch the download URLstarsRef.downloadURL { url, error in  if let error = error {    // Handle any errors  } else {    // Get the download URL for 'images/stars.jpg'  }}
打开App,查看更多内容
随时随地看视频慕课网APP