From 2eac2348a9dba4fdf9d12e5abe46bf444e978e9b Mon Sep 17 00:00:00 2001 From: Van Leemput Dayron Date: Sun, 2 Nov 2025 19:02:39 +0100 Subject: [PATCH] feat: Configure Firebase initialization with platform-specific options and add URL types for Google authentication --- ios/Podfile.lock | 153 +++++++++++++++++++++++++++--------------- ios/Runner/Info.plist | 12 ++++ lib/main.dart | 26 +++---- 3 files changed, 120 insertions(+), 71 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 94af164..5e428d8 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1204,50 +1204,57 @@ PODS: - BoringSSL-GRPC/Implementation (0.0.37): - BoringSSL-GRPC/Interface (= 0.0.37) - BoringSSL-GRPC/Interface (0.0.37) - - cloud_firestore (6.0.2): - - Firebase/Firestore (= 12.2.0) + - cloud_firestore (6.0.3): + - Firebase/Firestore (= 12.4.0) - firebase_core - Flutter - - Firebase/Auth (12.2.0): + - Firebase/Auth (12.4.0): - Firebase/CoreOnly - - FirebaseAuth (~> 12.2.0) - - Firebase/CoreOnly (12.2.0): - - FirebaseCore (~> 12.2.0) - - Firebase/Firestore (12.2.0): + - FirebaseAuth (~> 12.4.0) + - Firebase/CoreOnly (12.4.0): + - FirebaseCore (~> 12.4.0) + - Firebase/Firestore (12.4.0): - Firebase/CoreOnly - - FirebaseFirestore (~> 12.2.0) - - firebase_auth (6.1.0): - - Firebase/Auth (= 12.2.0) + - FirebaseFirestore (~> 12.4.0) + - Firebase/Storage (12.4.0): + - Firebase/CoreOnly + - FirebaseStorage (~> 12.4.0) + - firebase_auth (6.1.1): + - Firebase/Auth (= 12.4.0) - firebase_core - Flutter - - firebase_core (4.1.1): - - Firebase/CoreOnly (= 12.2.0) + - firebase_core (4.2.0): + - Firebase/CoreOnly (= 12.4.0) - Flutter - - FirebaseAppCheckInterop (12.2.0) - - FirebaseAuth (12.2.0): - - FirebaseAppCheckInterop (~> 12.2.0) - - FirebaseAuthInterop (~> 12.2.0) - - FirebaseCore (~> 12.2.0) - - FirebaseCoreExtension (~> 12.2.0) + - firebase_storage (13.0.3): + - Firebase/Storage (= 12.4.0) + - firebase_core + - Flutter + - FirebaseAppCheckInterop (12.4.0) + - FirebaseAuth (12.4.0): + - FirebaseAppCheckInterop (~> 12.4.0) + - FirebaseAuthInterop (~> 12.4.0) + - FirebaseCore (~> 12.4.0) + - FirebaseCoreExtension (~> 12.4.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.1) - GoogleUtilities/Environment (~> 8.1) - GTMSessionFetcher/Core (< 6.0, >= 3.4) - RecaptchaInterop (~> 101.0) - - FirebaseAuthInterop (12.2.0) - - FirebaseCore (12.2.0): - - FirebaseCoreInternal (~> 12.2.0) + - FirebaseAuthInterop (12.4.0) + - FirebaseCore (12.4.0): + - FirebaseCoreInternal (~> 12.4.0) - GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Logger (~> 8.1) - - FirebaseCoreExtension (12.2.0): - - FirebaseCore (~> 12.2.0) - - FirebaseCoreInternal (12.2.0): + - FirebaseCoreExtension (12.4.0): + - FirebaseCore (~> 12.4.0) + - FirebaseCoreInternal (12.4.0): - "GoogleUtilities/NSData+zlib (~> 8.1)" - - FirebaseFirestore (12.2.0): - - FirebaseCore (~> 12.2.0) - - FirebaseCoreExtension (~> 12.2.0) - - FirebaseFirestoreInternal (~> 12.2.0) - - FirebaseSharedSwift (~> 12.2.0) - - FirebaseFirestoreInternal (12.2.0): + - FirebaseFirestore (12.4.0): + - FirebaseCore (~> 12.4.0) + - FirebaseCoreExtension (~> 12.4.0) + - FirebaseFirestoreInternal (~> 12.4.0) + - FirebaseSharedSwift (~> 12.4.0) + - FirebaseFirestoreInternal (12.4.0): - abseil/algorithm (~> 1.20240722.0) - abseil/base (~> 1.20240722.0) - abseil/container/flat_hash_map (~> 1.20240722.0) @@ -1256,16 +1263,26 @@ PODS: - abseil/strings/strings (~> 1.20240722.0) - abseil/time (~> 1.20240722.0) - abseil/types (~> 1.20240722.0) - - FirebaseAppCheckInterop (~> 12.2.0) - - FirebaseCore (~> 12.2.0) + - FirebaseAppCheckInterop (~> 12.4.0) + - FirebaseCore (~> 12.4.0) - "gRPC-C++ (~> 1.69.0)" - gRPC-Core (~> 1.69.0) - leveldb-library (~> 1.22) - nanopb (~> 3.30910.0) - - FirebaseSharedSwift (12.2.0) + - FirebaseSharedSwift (12.4.0) + - FirebaseStorage (12.4.0): + - FirebaseAppCheckInterop (~> 12.4.0) + - FirebaseAuthInterop (~> 12.4.0) + - FirebaseCore (~> 12.4.0) + - FirebaseCoreExtension (~> 12.4.0) + - GoogleUtilities/Environment (~> 8.1) + - GTMSessionFetcher/Core (< 6.0, >= 3.4) - Flutter (1.0.0) - - Google-Maps-iOS-Utils (5.0.0): - - GoogleMaps (~> 8.0) + - geolocator_apple (1.2.0): + - Flutter + - FlutterMacOS + - Google-Maps-iOS-Utils (6.1.0): + - GoogleMaps (~> 9.0) - google_maps_flutter_ios (0.0.1): - Flutter - Google-Maps-iOS-Utils (< 7.0, >= 5.0) @@ -1275,11 +1292,9 @@ PODS: - FlutterMacOS - GoogleSignIn (~> 9.0) - GTMSessionFetcher (>= 3.4.0) - - GoogleMaps (8.4.0): - - GoogleMaps/Maps (= 8.4.0) - - GoogleMaps/Base (8.4.0) - - GoogleMaps/Maps (8.4.0): - - GoogleMaps/Base + - GoogleMaps (9.4.0): + - GoogleMaps/Maps (= 9.4.0) + - GoogleMaps/Maps (9.4.0) - GoogleSignIn (9.0.0): - AppAuth (~> 2.0) - AppCheckCore (~> 11.0) @@ -1409,6 +1424,8 @@ PODS: - GTMSessionFetcher/Core (3.5.0) - GTMSessionFetcher/Full (3.5.0): - GTMSessionFetcher/Core + - image_picker_ios (0.0.1): + - Flutter - leveldb-library (1.22.6) - location (0.0.1): - Flutter @@ -1417,6 +1434,8 @@ PODS: - nanopb/encode (= 3.30910.0) - nanopb/decode (3.30910.0) - nanopb/encode (3.30910.0) + - package_info_plus (0.4.5): + - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS @@ -1425,17 +1444,24 @@ PODS: - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS + - url_launcher_ios (0.0.1): + - Flutter DEPENDENCIES: - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - Flutter (from `Flutter`) + - geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`) - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - location (from `.symlinks/plugins/location/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) SPEC REPOS: trunk: @@ -1453,6 +1479,7 @@ SPEC REPOS: - FirebaseFirestore - FirebaseFirestoreInternal - FirebaseSharedSwift + - FirebaseStorage - Google-Maps-iOS-Utils - GoogleMaps - GoogleSignIn @@ -1473,55 +1500,71 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_auth/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" + firebase_storage: + :path: ".symlinks/plugins/firebase_storage/ios" Flutter: :path: Flutter + geolocator_apple: + :path: ".symlinks/plugins/geolocator_apple/darwin" google_maps_flutter_ios: :path: ".symlinks/plugins/google_maps_flutter_ios/ios" google_sign_in_ios: :path: ".symlinks/plugins/google_sign_in_ios/darwin" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" location: :path: ".symlinks/plugins/location/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" shared_preferences_foundation: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: abseil: a05cc83bf02079535e17169a73c5be5ba47f714b AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063 AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508 - cloud_firestore: 0ae27252a2f1c0484af67b4a23b6e3589f102e37 - Firebase: 26f6f8d460603af3df970ad505b16b15f5e2e9a1 - firebase_auth: 069b05a861a7c2f7a73112dd616a49a40f35ae52 - firebase_core: dfc4bd142bee4bc53a5d482397ca322c2dd3165d - FirebaseAppCheckInterop: a1b2598c64c5a8c42fd6f6a1c3d0938ae4324678 - FirebaseAuth: 059c11702bdb759bb49b6c7ec6ff67abf21f39c4 - FirebaseAuthInterop: 217702acd4cc6baa98ba9d6c054532e0de0b8a16 - FirebaseCore: 311c48a147ad4a0ab7febbaed89e8025c67510cd - FirebaseCoreExtension: 73af080c22a2f7b44cefa391dc08f7e4ee162cb5 - FirebaseCoreInternal: 56ea29f3dad2894f81b060f706f9d53509b6ed3b - FirebaseFirestore: 2baa1360623e942007726627653d43a5bc618ba8 - FirebaseFirestoreInternal: 6506aef21ac270bf137c34cd7283723d930eddb0 - FirebaseSharedSwift: 52d868d4c269fcb4e4e1310c548435a9c1f46e25 + cloud_firestore: 79014bb3b303d451717ed5fe69fded8a2b2e8dc2 + Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e + firebase_auth: c2b8be95d602d4e8a9148fae72333ef78e69cc20 + firebase_core: 744984dbbed8b3036abf34f0b98d80f130a7e464 + firebase_storage: 0ba617a05b24aec050395e4d5d3773c0d7518a15 + FirebaseAppCheckInterop: f734c802f21fe1da0837708f0f9a27218c8a4ed0 + FirebaseAuth: 4a2aed737c84114a9d9b33d11ae1b147d6b94889 + FirebaseAuthInterop: 858e6b754966e70740a4370dd1503dfffe6dbb49 + FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3 + FirebaseCoreExtension: 7e1f7118ee970e001a8013719fb90950ee5e0018 + FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6 + FirebaseFirestore: 2a6183381cf7679b1bb000eb76a8e3178e25dee2 + FirebaseFirestoreInternal: 6577a27cd5dc3722b900042527f86d4ea1626134 + FirebaseSharedSwift: 93426a1de92f19e1199fac5295a4f8df16458daa + FirebaseStorage: 20d6b56fb8a40ebaa03d6a2889fe33dac64adb73 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - Google-Maps-iOS-Utils: 66d6de12be1ce6d3742a54661e7a79cb317a9321 + geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e + Google-Maps-iOS-Utils: 0a484b05ed21d88c9f9ebbacb007956edd508a96 google_maps_flutter_ios: 0291eb2aa252298a769b04d075e4a9d747ff7264 google_sign_in_ios: 205742c688aea0e64db9da03c33121694a365109 - GoogleMaps: 8939898920281c649150e0af74aa291c60f2e77d + GoogleMaps: 0608099d4870cac8754bdba9b6953db543432438 GoogleSignIn: c7f09cfbc85a1abf69187be091997c317cc33b77 GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 "gRPC-C++": cc207623316fb041a7a3e774c252cf68a058b9e8 gRPC-Core: 860978b7db482de8b4f5e10677216309b5ff6330 GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238 GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 + image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326 leveldb-library: cc8b8f8e013647a295ad3f8cd2ddf49a6f19be19 location: 155caecf9da4f280ab5fe4a55f94ceccfab838f8 nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 + package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 RecaptchaInterop: 11e0b637842dfb48308d242afc3f448062325aba shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 + url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b PODFILE CHECKSUM: 53a6aebc29ccee84c41f92f409fc20cd4ca011f1 diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index b4adf39..3cc8320 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -51,5 +51,17 @@ Cette application a besoin de votre position pour afficher votre localisation sur la carte GIDClientID 521527250907-3i1qe2656eojs8k9hjdi573j09i9p41m.apps.googleusercontent.com + CFBundleURLTypes + + + CFBundleURLName + REVERSED_CLIENT_ID + CFBundleURLSchemes + + com.googleusercontent.apps.521527250907-3i1qe2656eojs8k9hjdi573j09i9p41m + + + + diff --git a/lib/main.dart b/lib/main.dart index d57900b..6c49a61 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,10 +4,11 @@ import 'package:firebase_core/firebase_core.dart'; import 'package:travel_mate/blocs/balance/balance_bloc.dart'; import 'package:travel_mate/blocs/expense/expense_bloc.dart'; import 'package:travel_mate/blocs/message/message_bloc.dart'; +import 'package:travel_mate/firebase_options.dart'; import 'package:travel_mate/services/balance_service.dart'; import 'package:travel_mate/services/error_service.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:travel_mate/services/expense_service.dart'; +import 'package:travel_mate/services/expense_service.dart'; import 'blocs/auth/auth_bloc.dart'; import 'blocs/auth/auth_event.dart'; import 'blocs/theme/theme_bloc.dart'; @@ -31,19 +32,19 @@ import 'pages/signup.dart'; import 'pages/resetpswd.dart'; /// Entry point of the Travel Mate application. -/// +/// /// This function initializes Flutter widgets, loads environment variables, /// initializes Firebase, and starts the application. void main() async { WidgetsFlutterBinding.ensureInitialized(); await dotenv.load(fileName: ".env"); - await Firebase.initializeApp(); + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); runApp(const MyApp()); } /// The root widget of the Travel Mate application. -/// +/// /// This widget sets up the BLoC providers, repositories, and MaterialApp /// configuration. It manages the application's theme, routing, and global state. class MyApp extends StatelessWidget { @@ -51,7 +52,7 @@ class MyApp extends StatelessWidget { const MyApp({super.key}); /// Builds the widget tree for the application. - /// + /// /// Sets up repository providers for dependency injection, BLoC providers /// for state management, and configures the MaterialApp with themes and routing. @override @@ -105,7 +106,6 @@ class MyApp extends StatelessWidget { expenseRepository: context.read(), ), ), - ], child: MultiBlocProvider( providers: [ @@ -125,22 +125,17 @@ class MyApp extends StatelessWidget { ), // Trip BLoC for managing travel trips BlocProvider( - create: (context) => - TripBloc(context.read()), + create: (context) => TripBloc(context.read()), ), // User BLoC for managing user data BlocProvider(create: (context) => UserBloc()), // Message BLoC for managing in-app messaging - BlocProvider( - create: (context) => MessageBloc(), - ), + BlocProvider(create: (context) => MessageBloc()), // Account BLoC for managing user account settings BlocProvider( - create: (context) => AccountBloc( - context.read(), - ), + create: (context) => AccountBloc(context.read()), ), - + // Expense BLoC for managing trip expenses BlocProvider( create: (context) => ExpenseBloc( @@ -156,7 +151,6 @@ class MyApp extends StatelessWidget { expenseRepository: context.read(), ), ), - ], child: BlocBuilder( builder: (context, themeState) {