my flutter android app was working well until i want to upload something to firebase storage. i get 'No app check token for request' error message
does anyone know what to do to solve this problem?
my flutter android app was working well until i want to upload something to firebase storage. i get 'No app check token for request' error message
does anyone know what to do to solve this problem?
Go to Firebase console, then navigate to the storage tab. You should see something like this:
Click "Configure App Check" and there will be a config page. Ensure that your Firebase Storage is not set to enforce app check.
Of course, the ideal option would be to set up app check. Invertase recently released this plugin for setting it up with Flutter. You can check out the article here.
In my case I solved the problem by using the await typecasting. You are not getting the error related to app check token request. You are getting the error for not waiting for the completion of download. Just add the line after await which is required for the UploadTask finished and it works.
final Reference storageReference = firebase_storage.FirebaseStorage.instance
.ref()
.child("products")
.child("product_$productId.png");
String downloadURL;
UploadTask uploadTask = storageReference.putFile(mFileImage);
downloadURL = await (await uploadTask).ref.getDownloadURL();