and-nd-firebase
and-nd-firebase copied to clipboard
Uri downloadUrl = taskSnapshot.getDownloadUrl(); not working
getDownloadUrl() does not seem to exist anymore. Looking at the firebase-documentation it looks like this method is called on the reference now not taskSnapShot. I have tried the following but the image is not uploaded:
StorageReference taskSnapshotStorage = taskSnapshot.getStorage();
Uri downloadUrl = taskSnapshotStorage.getDownloadUrl().getResult();
Try using this
Task<Uri> task = taskSnapshot.getMetadata().getReference().getDownloadUrl();
task.addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
String photoLink = uri.toString();
}
});
This things works.... tnxs alot... i worked for me after trying so many solutions
I faced the same problem but I got the answer
Just add .getStorage()
infront of .getDownloadurl
to be like this below
.getStorage().getDownloadUrl
LEAVE EVERYTHING IN THAT LINE DONT ALTER JUST ADD .getStorage()
I hope this gist might help you: https://gist.github.com/jonathanbcsouza/13929ab81077645f1033bf9ce45beaab
I have a problem, I am getting the storage location instead of the download URL. From my Firebase storage. How can I fix this?
I tried the code below.
Task<Uri> task = taskSnapshot.getMetadata().getReference().getDownloadUrl(); task.addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { String photoLink = uri.toString(); } });
Worked really well for me. Thanks