For example there are 10 folders in a storage and each folder have 5 images. How do I retrieve one specific image from each folder in a loop? or any methods.
CodePudding user response:
Nevermind I got it.
I don't know if this is right but i just named the images some incrementing numbers using loop and retrieve the first one by calling "0".
But please if you have any suggestions, I would be glad.
CodePudding user response:
Currently, there is no way to list all files in a folder in the Firebase Storage. If you need such a functionality, you will have to store the metadata of the files (such as the download URLs) where you can list them. I think Firebase Realtime Database is good to use.
add image name to the other place and fetch from it
and get Url like
myStorageRef.child("<folderNameInStorage>/" <imageName>).getDownloadUrl().addOnSuccessListener();