In order to secure my website, I try to link my web Flutter App and my Firebase backend to App Check.
I created a reCAPTCHA v3 which provides me two keys :
- website key (public)
- secret key
For linked it to my project, I use the following code :
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.web,
);
await FirebaseAppCheck.instance.activate(
webRecaptchaSiteKey: 'website key (public)',
);
runApp(MultiProvider(
providers: [
ChangeNotifierProvider(create: (context) => ContentView()),
ChangeNotifierProvider(create: (context) => AuthBase()),
ChangeNotifierProvider(create: (context) => TopCollaboratorsProvider()),
],
child: const MyApp(),
));
}
Then on the Firebase console, I put the secret key.
However, when I try to build my web app online either on Firebase Hosting or on another hosting solution, my screen is completely white and my app is not loading.
On the web emulator, everything is ok, my app is loading correctly.
Am I doing something wrong ?
Thank you for your help