'No app check token for request' flutter firebase error

Viewed 4817

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?

2 Answers

Go to Firebase console, then navigate to the storage tab. You should see something like this:

Firebase console storage tab

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();  
Related