Closed ggichure closed 5 years ago
Hello, I had a similar issue like you I just found out the method taskSnapshot.getDownloadUrl() is deprecated. So going back to the firebase documentation I found this code to achieve the same purpose
`uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task
// Continue with the task to get the download URL
return photoRef.getDownloadUrl();
}
}).addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
if (task.isSuccessful()) {
// IT IS HERE THAT YOU CAN GET THE DOWNLOADABLE URL
Uri downloadUri = task.getResult();
firebaseUrl = downloadUri;
//TRY CALLING YOUR "setProfilePhoto" METHOD HERE LIKE BELOW
setProfilePhoto(firebaseUrl.toString());
} else {
// Handle failures
// ...
}
}
});`
here is my code i have tried different code from stackoverflow nothing works for me.cant seem to fix the error Uri firebaseUrl = taskSnapshot.getDownloadUrl();
uploadTask.addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri firebaseUrl = taskSnapshot.getDownloadUrl();