Ad

Firestore/Firebase Not Able To Get Images From Folder

I have a folder on firebase. which named 'Item'. 'Item' contains 100 images. I just want to fetch just all images Url in the list.
I have tried google documents. Google showing only for a single image. But I just need complete images URLs.

 FirebaseStorage firestore = FirebaseStorage.getInstance()
 val ref: StorageReference? = firestore.getReference("Item")


I am facing this error =
StorageException has occurred. The object​ does not exist at the  location

enter image description here

Ad

Answer

As i found in documentation this method could help public Task<ListResult> listAll ()

First you need to get needed reference of the folder in your case it is item/

StorageReference mImageStorage = FirebaseStorage.getInstance().getReference().child("items/");

And then with help of listAll() inflate the list of files in it

Here is the description https://firebase.google.com/docs/reference/android/com/google/firebase/storage/StorageReference.html#listAll()

Ad
source: stackoverflow.com
Ad