Trying to do the notification for all users.

This commit is contained in:
Van Leemput Dayron
2025-12-03 17:32:06 +01:00
parent fd19b88eef
commit a74d76b485
10 changed files with 505 additions and 227 deletions

View File

@@ -11,6 +11,8 @@ import 'package:travel_mate/services/error_service.dart';
import 'package:travel_mate/services/activity_places_service.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:travel_mate/services/expense_service.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:travel_mate/services/notification_service.dart';
import 'blocs/auth/auth_bloc.dart';
import 'blocs/auth/auth_event.dart';
import 'blocs/theme/theme_bloc.dart';
@@ -34,6 +36,8 @@ import 'pages/home.dart';
import 'pages/signup.dart';
import 'pages/resetpswd.dart';
import 'package:intl/date_symbol_data_local.dart';
/// Entry point of the Travel Mate application.
///
/// This function initializes Flutter widgets, loads environment variables,
@@ -42,6 +46,12 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
await dotenv.load(fileName: ".env");
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
await initializeDateFormatting('fr_FR', null);
// Set the background messaging handler early on, as a named top-level function
FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler);
await NotificationService().initialize();
runApp(const MyApp());
}