您好我正在尝试使用文件URL从Firebase存储中删除文件.
我的问题是无法解析getReferenceFromUrl().
示例代码:
StorageReference mStorageRef;
String storageurl = "http:sample"
mStorageRef = FirebaseStorage.getInstance().getReference();
StorageReference ref2 = mStorageRef.getReferenceFromUrl(storageurl);
ref2.delete().addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(Void aVoid) {
// File deleted successfully
Toast.makeText(getContext(),"file deleted",Toast.LENGTH_SHORT).show();
Log.d(TAG,"onSuccess: deleted file");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Uh-oh,an error occurred!
Log.d(TAG,"onFailure: did not delete file");
}
});
任何帮助,将不胜感激.