我使用StorageReference在Storage Firebase中上传pdf,并保存了与该文件相关的https链接。 我不知道如何通过此链接下载文件。 流程未在addOnSuccessListener中输入。为什么? 我该怎么办?
StorageReference storageRef = FirebaseStorage.getInstance().getReferenceFromUrl(urlResource);
File localFile = File.createTempFile("example", ".pdf");
storageRef.getFile(localFile)
.addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
Log.i("firebase ",";local tem file created created ");
// updateDb(timestamp,localFile.toString(),position);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.i("firebase ",";local tem file not created created " +exception.toString());
}
});