Firebase Storage Getdownloadurl() Always Return Last Result I Select
I'm trying to play the mp3 files which are stored on Firebase storage by getting downloadUrl. I use two spinners to decide the music types and music name which matches the folder n
Solution 1:
getDownloadUrl()
is asynchronous and returns immediately after it's called with a Task object that represents the work in progress. Your code will then display two toasts before the download url is available.
You should only be using the download URL from the moment that the success callback is invoked, so move your code in there, or call a method in there that uses the URL.
To learn more about why Firebase APIs are asynchronous, read this blog.
Post a Comment for "Firebase Storage Getdownloadurl() Always Return Last Result I Select"