2

I'm new to Flutter and I'm stuck trying to upload an image from a Flutter App to Firebase Storage. It always throws the same exception:

W/ExponenentialBackoff( 1185): network unavailable, sleeping.
W/StorageUtil( 1185): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: 16:

I have already connected my Firebase Console to my Flutter App. My Firestore is working, except for Cloud Storage. I believe it's because of the App Check that needs to be configured using a recaptcha key to be run in "main.dart" below Firebase.initializeApp(), as FlutterFire specifically instructs: https://firebase.flutter.dev/docs/app-check/usage#activating-the-default-provider

  await FirebaseAppCheck.instance.activate(webRecaptchaSiteKey: 'recaptcha-v3-site-key');
  

Thing is, I don't know where to find that recaptcha key from my Firebase Console or how to set it up. I've tried plugging in the WEB API KEY in my Firebase Project but it still doesn't work. Can anyone help?

2
  • Did you solve the problem? Commented Aug 2, 2021 at 22:28
  • didn't . my problem wasnt on firebaseappcheck, it was just my internet connection having a different proxy. Commented Aug 6, 2021 at 9:43

1 Answer 1

1

Here are the steps to get the webRecaptchaSiteKey according to the documentation:

  1. Add Firebase to your JavaScript project if you haven’t already done so.

  2. Register your site for reCAPTCHA v3 and get your reCAPTCHA v3 site key and secret key.

  3. Register your apps to use App Check with the reCAPTCHA provider in the Project Settings > App Check section of the Firebase console. You will need to provide the secret key you got in the previous step.

After following these steps, you can pass the site key (public key), say 'abcdefghijklmnopqrstuvwxy-1234567890abcd', from step 2 and use it like below:

  await FirebaseAppCheck.instance.activate(webRecaptchaSiteKey: 'abcdefghijklmnopqrstuvwxy-1234567890abcd');
Sign up to request clarification or add additional context in comments.

3 Comments

I forgot to mention, my app is not web. And what "site" will I register, if in mobile development?
This is the official documentation, this should solve your doubts, for mobile development: firebase.flutter.dev/docs/app-check/usage
Seems like the register link is with some kind of issue at the moment: Invalid Dynamic Link - Blocked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.