i need to delete a file from firebase storage, i am following this code:
static deleteFile(String urlFile) async {
try {
final ref = FirebaseStorage.instance.refFromURL(urlFile);
await ref.delete();
} catch (e) {
if (kDebugMode) {
print(e.toString());
}
}
}
the file is deleted, but the console displays this error:
W/StorageUtil(13434): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
the user is successfully authenticated.
usually this is a network connection problem
App Check Attestation Providers: For IOS: DeviceCheck or App Attest & For Android: Play Integrity or SafetyNet
Use Anyone of these you like, I personally use SafetyNet for my android apps.
dependencies { implementation 'com.google.firebase:firebase-appcheck-safetynet:16.0.0' }
FirebaseApp.initializeApp(/context=/ this); FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance(); firebaseAppCheck.installAppCheckProviderFactory( SafetyNetAppCheckProviderFactory.getInstance());
I hope it fix your error. for more you can follow official doc: [https://firebase.google.com/docs/app-check/android/safetynet-provider].
Another Temporary fix... for TP & Practice Apps
Simply Remove If Condition from your firebase storage/db/auth rules
rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if false; } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With