Cmabios
This commit is contained in:
@@ -44,18 +44,18 @@ void main() async {
|
||||
// binding entre Flutter y el sistema operativo.
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// Inicializar Firebase — REQUIERE que hayas corrido:
|
||||
// > flutterfire configure
|
||||
// Ese comando genera lib/firebase_options.dart automáticamente.
|
||||
//
|
||||
// ATAJO: Si aún no tienes Firebase configurado, comenta las
|
||||
// siguientes 3 líneas y la app correrá sin notificaciones.
|
||||
// -------------------------------------------------------
|
||||
// await Firebase.initializeApp(
|
||||
// options: DefaultFirebaseOptions.currentPlatform,
|
||||
// );
|
||||
// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
|
||||
// -------------------------------------------------------
|
||||
try {
|
||||
// CAMBIAMOS EL BLOQUE COMENTADO POR ESTO:
|
||||
// Al no pasarle opciones, lee el google-services.json automáticamente en Android.
|
||||
await Firebase.initializeApp();
|
||||
|
||||
// Vinculamos el handler de notificaciones en segundo plano
|
||||
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
|
||||
|
||||
debugPrint('🔥 Firebase inicializado con éxito en modo nativo.');
|
||||
} catch (e) {
|
||||
debugPrint('❌ Error al inicializar Firebase: $e');
|
||||
}
|
||||
|
||||
runApp(const ResiduosApp());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user