taskSnapshot.getDownloadUrl() is deprecated

前端 未结 10 1452
时光说笑
时光说笑 2020-11-27 19:39

Until now, the way to get the url from file on Storage in Firebase, I used to do this taskSnapshot.getDownloadUrl, but nowadays is deprecated, which method I

10条回答
  •  日久生厌
    2020-11-27 20:22

    Task task = taskSnapshot.getMetadata().getReference().getDownloadUrl();
    task.addOnSuccessListener(new OnSuccessListener() {
           @Override
            public void onSuccess(Uri uri) {
                  String photoLink = uri.toString();
            }
    });
    

提交回复
热议问题