I want to get this full URL:
I want to show images in android slider using full URL.
I got this URL gs://myapppakage-f7aa6.appspot.com/flat 44/image_1.jpg
But I can`t access images to show in my slider.
My Kotlin Code
private fun retriveImagesFromStorage(flatName: String) {
val firebaseStorage = FirebaseStorage.getInstance().reference
val storageRef: StorageReference = firebaseStorage.child(flatName)
storageRef.listAll().addOnSuccessListener { result ->
// go through all the files/folders
imageList.clear()
result.items.forEach { storageRef ->
// get the download URL for each of the file
storageRef.downloadUrl.addOnSuccessListener { uri ->
imageList.add(uri.path.toString())
}
}
}
.addOnFailureListener {
Toast.makeText(this, "Unable to fetch items!", Toast.LENGTH_SHORT).show()
it.printStackTrace()
}
}