【问题标题】:How to get https:// url from firebase storage如何从 Firebase 存储中获取 https:// url
【发布时间】:2020-07-06 13:58:23
【问题描述】:

如何获取此链接的网址?

【问题讨论】:

标签: android firebase firebase-storage


【解决方案1】:

您指向的内容称为文件的下载 URL。要获取该 URL,您需要按照 accessing a file through a URL 上的说明进行操作:

StorageReference photoRef = storageRef.child("path/to/photo2.jpg");

photoRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
    @Override
    public void onSuccess(Uri uri) {
        System.out.println(uri.toString());
    }
}).addOnFailureListener(new OnFailureListener() {
    @Override
    public void onFailure(@NonNull Exception exception) {
        throw exception
    }
});

【讨论】:

    猜你喜欢
    • 2020-06-28
    相关资源
    最近更新 更多