How to use getdownloadurl in recent versions?

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


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-11-22 01:00

    This worked for me after hours of research and differents ways :

    filepath.putFile(resultUri).addOnSuccessListener(new OnSuccessListener() {
         @Override
         public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
    
               //here
               Task urlTask = taskSnapshot.getStorage().getDownloadUrl();
               while (!urlTask.isSuccessful());
               Uri downloadUrl = urlTask.getResult();
    
               final String sdownload_url = String.valueOf(downloadUrl);
    

提交回复
热议问题