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());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class ApiService {
|
||||
//
|
||||
// ATAJO: Cambia solo esta constante para apuntar a staging/prod.
|
||||
// ============================================================
|
||||
static const String _baseUrl = 'http://10.0.2.2:8000';
|
||||
static const String _baseUrl = 'http://192.168.192.116:8000';
|
||||
// static const String _baseUrl = 'http://127.0.0.1:8000'; // iOS Simulator
|
||||
// static const String _baseUrl = 'http://192.168.1.XX:8000'; // Dispositivo físico
|
||||
|
||||
|
||||
Reference in New Issue
Block a user