How to use getdownloadurl in recent versions?

后端 未结 4 634
庸人自扰
庸人自扰 2020-11-22 00:29
                Uri downloaduri=taskSnapshot.getDownloadUrl();//here i cant use getdownloadurl() function
                DatabaseReference new_prod=db.push();
              


        
4条回答
  •  灰色年华
    2020-11-22 00:57

    storageReference.child("YOUR_CHILD")
        .putFile("FILE")
        .addOnSuccessListener(new OnSuccessListener() {
           @Override
           public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                 taskSnapshot
                   .getStorage()
                   .getDownloadUrl()
                   .addOnSuccessListener(new OnSuccessListener() {
                                    @Override
                                    public void onSuccess(Uri uri) {
                                        //Put your result here
                                    }
                                });
    
                       }   
    

提交回复
热议问题