firebase_app_check 0.0.4
firebase_app_check: ^0.0.4 copied to clipboard
App Check works alongside other Firebase services to help protect your backend resources from abuse, such as billing fraud or phishing.
example/lib/main.dart
// ignore_for_file: require_trailing_commas
import 'package:firebase_app_check/firebase_app_check.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: const FirebaseOptions(
apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0',
authDomain: 'react-native-firebase-testing.firebaseapp.com',
databaseURL: 'https://react-native-firebase-testing.firebaseio.com',
projectId: 'react-native-firebase-testing',
storageBucket: 'react-native-firebase-testing.appspot.com',
messagingSenderId: '448618578101',
appId: '1:448618578101:web:772d484dc9eb15e9ac3efc',
measurementId: 'G-0N1G9FLDZE'),
);
// Activate app check after initialization, but before
// usage of any Firebase services.
await FirebaseAppCheck.instance
.activate(webRecaptchaSiteKey: 'Your reCAPTCHA v3 site key...');
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Firebase App Check',
home: FirebaseAppCheckExample(),
);
}
}
class FirebaseAppCheckExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Text('App Check Example');
}
}