此 getDownloadUrl()
方法在更新为
'com.google.firebase:firebase-storage:15.0.2'
官方网站上没有任何其他方式来实现 url,那么有什么方法可以以非弃用的方式实现 Url 吗?
/** @deprecated */
@Deprecated
@Nullable
public Uri getDownloadUrl() {
StorageMetadata var1;
return (var1 = this.getMetadata()) != null ? var1.getDownloadUrl() : null;
}
}
最佳答案
在文档中是这样说的:
The
getDownloadUrl()
andgetDownloadUrls()
methods of theStorageMetadata
class are now deprecated. UsegetDownloadUrl()
fromStorageReference
instead.
所以你需要使用getDownloadUrl()
在 StorageReference
里面
public Task<Uri> getDownloadUrl ()
Asynchronously retrieves a long lived download URL with a revokable token. This can be used to share the file with others, but can be revoked by a developer in the Firebase Console if desired.
更多信息在这里:
关于java - 使用 getDownloadUrl() 的 Firebase 存储 "retrieves a long lived download URL"现在已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50158921/