Solución:
Necesitas usar esta llamada al método:
StorageReference photoRef = mFirebaseStorage.getReferenceFromUrl(mImageUrl);
Luego elimine como estaba:
photoRef.delete().addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
// File deleted successfully
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");
}
});
Utilice la función getReferenceFromUrl (URL)
FirebaseStorage firebaseStorage = FirebaseStorage.getInstance();
StorageReference storageReference = firebaseStorage.getReferenceFromUrl(pd.getUrl());
storageReference.delete().addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.e("Picture","#deleted");
}
});
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)