Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get downloadUrls for Multiple files in firebase android? #57

Open
DevPokhraj opened this issue Jan 10, 2019 · 1 comment
Open

Comments

@DevPokhraj
Copy link

DevPokhraj commented Jan 10, 2019

storageReference = mRef.child("Images").child(mAuth.getCurrentUser().getUid()).child(image_name);
UploadTask uploadTask = storageReference.putBytes(data);
uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task>() {
@OverRide
public Task then(@nonnull Task<UploadTask.TaskSnapshot> task) throws Exception {
return storageReference.getDownloadUrl();
}
}).addOnCompleteListener(new OnCompleteListener() {
@OverRide
public void onComplete(@nonnull Task task) {
if (task.isSuccessful()) {
Uri downloadUri = task.getResult();
//It will return the downloadUrl;
//If i tried to store them in the list
storeImageUrls.add(downloadUri.toString()); // storeImageUrls is a list

                                }
                            }

}

//If i upload different images to the storage then different images get uploaded but getting only 1 url and it get stored in the list.
So, if i upload 10 images, the images get uploaded but getting only 1 url stored like 10 images but same url for 10 images stored in the list.

@DeepakGurav4444
Copy link

I also has this condition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants