getDownloadUrl() is now deprecated to make Firebase Storage "get long-lived download URL"


Muhammad Ali Jr:

getDownloadUrl()After updating to, this method appears to be deprecated

'com.google.firebase:firebase-storage:15.0.2'

There is no other way to implement the url on the official site, so is there any way to implement the url in a deprecated way?

/** @deprecated */
@Deprecated
@Nullable
public Uri getDownloadUrl() {
    StorageMetadata var1;
    return (var1 = this.getMetadata()) != null ? var1.getDownloadUrl() : null;
    }
}
Peter Haddad:

In the documentation it says:

getDownloadUrl()and getDownloadUrls()methods of this class are StorageMetadatanow deprecated. Use getDownloadUrl()from StorageReferenceinstead.

Therefore, you need getDownloadUrl()toStorageReference

public Task<Uri> getDownloadUrl ()

Asynchronously retrieve a long-lived download URL with a revocable token. Can be used to share files with others, but developers can undo it in the Firebase console if desired.

More info here:

https://firebase.google.com/docs/reference/android/com/google/firebase/storage/StorageReference#getDownloadUrl()

Related


Flutter : getDownloadUrl (firebase storage)

killian I have a problem with my flutter application. I want to upload an image to firebase storage and get the URL but the getDownloadUrl method doesn't work. Here is my code : import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; ...

Flutter : getDownloadUrl (firebase storage)

killian I have a problem with my flutter application. I want to upload an image to firebase storage and get the URL but the getDownloadUrl method doesn't work. Here is my code : import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; ...

Flutter : getDownloadUrl (firebase storage)

killian I have a problem with my flutter application. I want to upload an image to firebase storage and get the URL but the getDownloadUrl method doesn't work. Here is my code : import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; ...

Flutter : getDownloadUrl (firebase storage)

killian I have a problem with my flutter application. I want to upload an image to firebase storage and get the URL but the getDownloadUrl method doesn't work. Here is my code : import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; ...

Token validity for Firebase Storage getDownloadUrl

Bumblebee I have a problem with the "token" in the url(&token=) when using FirebaseStorage's getDownloadUrl. https://firebasestorage.googleapis.com/v0/b/someapplication.appspot.com/o/images%2Fsample.png?alt=media&token=123456 It says to return a "long lived" d

Token validity for Firebase Storage getDownloadUrl

Bumblebee I have a problem with the "token" in the url(&token=) when using FirebaseStorage's getDownloadUrl. https://firebasestorage.googleapis.com/v0/b/someapplication.appspot.com/o/images%2Fsample.png?alt=media&token=123456 It says to return a "long lived" d

Token validity for Firebase Storage getDownloadUrl

Bumblebee I have a problem with the "token" in the url(&token=) when using FirebaseStorage's getDownloadUrl. https://firebasestorage.googleapis.com/v0/b/someapplication.appspot.com/o/images%2Fsample.png?alt=media&token=123456 It says to return a "long lived" d

Firebase Storage "getDownloadURL" returns undefined

Oy3 I am trying to add an image to firebase storage and use the image URL to add data to firestore. The image is uploading to firebase storage, but if I use the getDownloadUrl method, it doesn't return the URL. It returns this error: Uncaught TypeError: Cannot

Token validity for Firebase Storage getDownloadUrl

Bumblebee I have a problem with the "token" in the url(&token=) when using FirebaseStorage's getDownloadUrl. https://firebasestorage.googleapis.com/v0/b/someapplication.appspot.com/o/images%2Fsample.png?alt=media&token=123456 It says to return a "long lived" d

Token validity for Firebase Storage getDownloadUrl

Bumblebee I have a problem with the "token" in the url(&token=) when using FirebaseStorage's getDownloadUrl. https://firebasestorage.googleapis.com/v0/b/someapplication.appspot.com/o/images%2Fsample.png?alt=media&token=123456 It says to return a "long lived" d

How to get URL getDownloadURL from Firebase Storage

Jonathan Fager: I'm trying to get "Long Persistent Download Links" for a file in a Firebase bucket. I have changed its permissions to service firebase.storage { match /b/project-xxx.appspot.com/o { match /{allPaths=**} { allow read, write; }

Firebase Storage's getDownloadUrl() method cannot be resolved

Neeraj Sewani To upload images to Firebase Storage, attach to a StorageReference instance . When I override the method, the instance I am calling , but it gives me an erroraddOnSuccessListeneronSuccessgetDownloadUrl()taskSnapshot Cannot resolve method getDownl

getDownloadUrl Firebase Storage returns Null (Android)

Franklin David Macias Avilan I'm working on a small project and I have some questions about firebase Storage and getDownloadUrl. I have uploaded some images on FirebaseStorage but when I try to get the download Url it returns null. Here is the code: Import: im

How to get URL getDownloadURL from Firebase Storage

Jonathan Fager I'm trying to get "Long Persistent Download Links" for a file in a Firebase bucket. I have changed its permissions to service firebase.storage { match /b/project-xxx.appspot.com/o { match /{allPaths=**} { allow read, write; } }

Firebase Storage's getDownloadUrl() method cannot be resolved

Neeraj Sewani To upload images to Firebase Storage, attach to a StorageReference instance . When I override the method, the instance I am calling , but it gives me an erroraddOnSuccessListeneronSuccessgetDownloadUrl()taskSnapshot Cannot resolve method getDownl

How to get URL getDownloadURL from Firebase Storage

Jonathan Fager: I'm trying to get "Long Persistent Download Links" for a file in a Firebase bucket. I have changed its permissions to service firebase.storage { match /b/project-xxx.appspot.com/o { match /{allPaths=**} { allow read, write; }

Firebase Storage's getDownloadUrl() method cannot be resolved

Neeraj Sewani To upload images to Firebase Storage, attach to a StorageReference instance . When I override the method, the instance I am calling , but it gives me an erroraddOnSuccessListeneronSuccessgetDownloadUrl()taskSnapshot Cannot resolve method getDownl

Firebase getDownloadURL cannot set Img Src from storage

Ethan I am trying to replicate the results of this question here . I can call a getDownloadURL()valid database child, but the result it returns can't seem to be set to IMG's src. This is the code I'm currently using to try and get the download URL: var storage