在 Firebase 中上传图片后,如何获取网址?
2022-09-01 11:41:14
现在,我正在使用以下代码从Firebase的存储中获取图像:
mStoreRef.child("photos/" + model.getBase64Image())
.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
// Got the download URL for 'photos/profile.png'
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
Toast.makeTextthis, "image not dowloaded", Toast.LENGTH_SHORT).show();
}
});
是否可以获取图像中显示的此URL?