How to get URL from Firebase Storage getDownloadURL

后端 未结 10 1982
小蘑菇
小蘑菇 2020-11-21 04:54

I\'m trying to get the \"long term persistent download link\" to files in our Firebase storage bucket. I\'ve changed the permissions of this to

service fireb         


        
10条回答
  •  隐瞒了意图╮
    2020-11-21 05:33

    change the received URI to URL

     val urlTask = uploadTask.continueWith { task ->
                if (!task.isSuccessful) {
                    task.exception?.let {
                        throw it
                    }
                }
    
    
                spcaeRef.downloadUrl
            }.addOnCompleteListener { task ->
                if (task.isSuccessful) {
    
                    val downloadUri = task.result
    
                    //URL
                    val url = downloadUri!!.result
    
                } else {
                    //handle failure here
                }
            }
    
    

提交回复
热议问题