Firebase how to get Image Url from firebase storage?

后端 未结 12 687
悲&欢浪女
悲&欢浪女 2020-12-23 15:15

Right now i am fetching image from Storage of Firebase by using below code :

mStoreRef.child("photos/" + model.getBase64Image())
          .getDownl         


        
12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 15:41

    In the past the firebase used getMetadata().getDownloadUrl(), and today they use getDownloadUrl()

    It should be used this way:

    .addOnSuccessListener(new OnSuccessListener() {
        @Override
        public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
            String image = taskSnapshot.getDownloadUrl().toString());
        }
    });
    

提交回复
热议问题