Until now, the way to get the url from file on Storage in Firebase, I used to do this
taskSnapshot.getDownloadUrl, but nowadays is deprecated, which method I
Use this implementation for your uploadTask and will work. :)
uploadTask.addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Task firebaseUri = taskSnapshot.getStorage().getDownloadUrl();
firebaseUri.addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(Uri uri) {
String url = uri.toString();
Log.e("TAG:", "the url is: " + url);
String ref = yourStorageReference.getName();
Log.e("TAG:", "the ref is: " + ref);
}
});
}
});