In my new android firebase project, I used com.google.firebase:firebase-storage:16.0.1
library.
I get the following Error:
I opened ano
Firebase upadated their method so kindly update yourself use this method kindly:
this is the basic line at which you feeling annoying, very simple justget the download path in this way
StorageReference ref = storageReference.child("images/"+ UUID.randomUUID().toString());
UploadTask uploadTask = ref.putFile(filePath);
Task urlTask = uploadTask.continueWithTask(new Continuation>() {
@Override
public Task then(@NonNull Task task) throws Exception {
if (!task.isSuccessful()) {
throw task.getException();
}
// Continue with the task to get the download URL
return ref.getDownloadUrl();
}
}).addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
Uri downloadUri = task.getResult();
///here is your image url enjoy this
Toast.makeText(CloudStorageActivity.this, "Uploaded", Toast.LENGTH_SHORT).show();
}
} else {
// Handle failures
// ...
}
}
});