diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 5c2b151..611ea01 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,5 +1,8 @@ plugins { id("com.android.application") + // START: FlutterFire Configuration + id("com.google.gms.google-services") + // END: FlutterFire Configuration id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..e3232ac --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "956683546941", + "project_id": "blindmaster-54055", + "storage_bucket": "blindmaster-54055.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:956683546941:android:828055a1f543b75f121554", + "android_client_info": { + "package_name": "com.example.blind_master" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBJzL-jeo4xa_rQkHymzku_2lIJ6WJ8hoI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index a439442..9e2d35c 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -19,6 +19,9 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" id("com.android.application") version "8.7.0" apply false + // START: FlutterFire Configuration + id("com.google.gms.google-services") version("4.3.15") apply false + // END: FlutterFire Configuration id("org.jetbrains.kotlin.android") version "1.8.22" apply false } diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..9bce449 --- /dev/null +++ b/firebase.json @@ -0,0 +1 @@ +{"flutter":{"platforms":{"android":{"default":{"projectId":"blindmaster-54055","appId":"1:956683546941:android:828055a1f543b75f121554","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"blindmaster-54055","appId":"1:956683546941:ios:162a6b8aa58f1eb8121554","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"macos":{"default":{"projectId":"blindmaster-54055","appId":"1:956683546941:ios:162a6b8aa58f1eb8121554","uploadDebugSymbols":false,"fileOutput":"macos/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"blindmaster-54055","configurations":{"android":"1:956683546941:android:828055a1f543b75f121554","ios":"1:956683546941:ios:162a6b8aa58f1eb8121554","macos":"1:956683546941:ios:162a6b8aa58f1eb8121554","web":"1:956683546941:web:f66e35806267907c121554","windows":"1:956683546941:web:f5d94d05b6ce6bef121554"}}}}}} \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 2af573e..4db5bcb 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 37168F2E6E0EB2FD2E2670EA /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76A4A76AA7A29FE3F7CE6A5 /* Pods_RunnerTests.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 594276F4616D1396DBF5D0C1 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 86D2D4E2E379E6C7A77A04E3 /* GoogleService-Info.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -52,6 +53,7 @@ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 86D2D4E2E379E6C7A77A04E3 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97606C416DE8FC726A943531 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; @@ -115,6 +117,7 @@ 331C8082294A63A400263BE5 /* RunnerTests */, FB2136F1EB4879FFCA098756 /* Pods */, AAE1A6D2DD25E745E39CFD95 /* Frameworks */, + 86D2D4E2E379E6C7A77A04E3 /* GoogleService-Info.plist */, ); sourceTree = ""; }; @@ -264,6 +267,7 @@ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + 594276F4616D1396DBF5D0C1 /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..61c7616 --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyC0MWniqI8flETaT8zKwXQzBhYRljKIKvk + GCM_SENDER_ID + 956683546941 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.blindMaster + PROJECT_ID + blindmaster-54055 + STORAGE_BUCKET + blindmaster-54055.firebasestorage.app + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:956683546941:ios:162a6b8aa58f1eb8121554 + + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f5ff68a..52ffd44 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -54,6 +54,11 @@ NSAllowsLocalNetworking + UIBackgroundModes + + fetch + remote-notification + NSLocalNetworkUsageDescription Allow the app to find and connect to the Dart VM for debugging purposes. diff --git a/lib/BlindMasterResources/fcm_service.dart b/lib/BlindMasterResources/fcm_service.dart new file mode 100644 index 0000000..77170a8 --- /dev/null +++ b/lib/BlindMasterResources/fcm_service.dart @@ -0,0 +1,18 @@ +import 'package:blind_master/BlindMasterResources/secure_transmissions.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; + +class FcmService { + /// Request permission, fetch the FCM token, and register it with the server. + /// Safe to call on every login/session-restore — the server just upserts the value. + static Future register() async { + try { + final messaging = FirebaseMessaging.instance; + await messaging.requestPermission(alert: true, badge: true, sound: true); + final token = await messaging.getToken(); + if (token == null) return; + await securePost({'token': token}, 'register_fcm_token'); + } catch (_) { + // Non-fatal — push notifications simply won't work until the next successful registration. + } + } +} diff --git a/lib/BlindMasterScreens/Startup/login_screen.dart b/lib/BlindMasterScreens/Startup/login_screen.dart index 19fa2e4..a01b959 100644 --- a/lib/BlindMasterScreens/Startup/login_screen.dart +++ b/lib/BlindMasterScreens/Startup/login_screen.dart @@ -1,3 +1,4 @@ +import 'package:blind_master/BlindMasterResources/fcm_service.dart'; import 'package:blind_master/BlindMasterResources/secure_transmissions.dart'; import 'package:blind_master/BlindMasterScreens/Startup/create_user_screen.dart'; import 'package:blind_master/BlindMasterScreens/Startup/forgot_password_screen.dart'; @@ -84,6 +85,7 @@ class _LoginScreenState extends State { if (token.isEmpty) throw Exception('Token Not Received'); final storage = FlutterSecureStorage(); await storage.write(key: 'token', value: token); + await FcmService.register(); } catch(e) { if (!mounted) return; diff --git a/lib/BlindMasterScreens/Startup/splash_screen.dart b/lib/BlindMasterScreens/Startup/splash_screen.dart index 23e52db..c327280 100644 --- a/lib/BlindMasterScreens/Startup/splash_screen.dart +++ b/lib/BlindMasterScreens/Startup/splash_screen.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:convert'; +import 'package:blind_master/BlindMasterResources/fcm_service.dart'; import 'package:blind_master/BlindMasterResources/secure_transmissions.dart'; import 'package:blind_master/BlindMasterScreens/home_screen.dart'; import 'package:blind_master/BlindMasterScreens/Startup/login_screen.dart'; @@ -50,6 +51,7 @@ class _SplashScreenState extends State { } nextScreen = HomeScreen(); + await FcmService.register(); } else { nextScreen = LoginScreen(); } diff --git a/lib/BlindMasterScreens/email_verification_waiting_screen.dart b/lib/BlindMasterScreens/email_verification_waiting_screen.dart index 0460884..1f7ae63 100644 --- a/lib/BlindMasterScreens/email_verification_waiting_screen.dart +++ b/lib/BlindMasterScreens/email_verification_waiting_screen.dart @@ -121,7 +121,7 @@ abstract class BaseVerificationWaitingScreenState { List occports = []; Widget? peripheralList; String deviceName = "..."; + int? batterySoc; @override void initState() { @@ -48,7 +49,8 @@ class _DeviceScreenState extends State { final body = json.decode(response.body) as Map; setState(() { deviceName = body['device_name']; - }); + batterySoc = body['battery_soc'] as int?; + }); } } catch (e) { if (!mounted) return; @@ -355,12 +357,30 @@ class _DeviceScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text( - deviceName, - style: GoogleFonts.aBeeZee(), - ), + title: Text(deviceName, style: GoogleFonts.aBeeZee()), backgroundColor: Theme.of(context).primaryColorLight, foregroundColor: Colors.white, + actions: [ + if (batterySoc != null) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Row( + children: [ + Icon( + batterySoc! <= 10 ? Icons.battery_alert + : batterySoc! <= 20 ? Icons.battery_1_bar + : batterySoc! <= 40 ? Icons.battery_2_bar + : batterySoc! <= 60 ? Icons.battery_3_bar + : batterySoc! <= 80 ? Icons.battery_5_bar + : Icons.battery_full, + color: batterySoc! <= 10 ? Colors.red : Colors.white, + ), + const SizedBox(width: 4), + Text('$batterySoc%', style: const TextStyle(color: Colors.white)), + ], + ), + ), + ], ), body: peripheralList ?? SizedBox( height: MediaQuery.of(context).size.height * 0.8, diff --git a/lib/BlindMasterScreens/individualControl/peripheral_screen.dart b/lib/BlindMasterScreens/individualControl/peripheral_screen.dart index b74a23b..fa9ffe3 100644 --- a/lib/BlindMasterScreens/individualControl/peripheral_screen.dart +++ b/lib/BlindMasterScreens/individualControl/peripheral_screen.dart @@ -124,6 +124,27 @@ class _PeripheralScreenState extends State { } }); + socket?.on("battery_alert", (data) { + if (data is! Map) return; + if (data['deviceId'] != widget.deviceId) return; + if (!mounted) return; + final type = data['type'] as String? ?? ''; + final soc = data['soc'] as int? ?? 0; + final (String message, Color color) = switch (type) { + 'overvoltage' => ('Battery fault detected. Please check your charger.', Colors.red), + 'critical_low' => ('Battery critically low ($soc%). Device shutting down.', Colors.red), + 'low_voltage_warning' => ('Battery voltage dip detected ($soc%). Monitor closely.', Colors.orange), + 'low_20' => ('Battery low: $soc% remaining. Consider charging soon.', Colors.orange), + 'low_10' => ('Battery very low: $soc% remaining. Charge now.', Colors.deepOrange), + _ => ('Battery alert received ($soc%).', Colors.orange), + }; + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text(message), + backgroundColor: color, + duration: const Duration(seconds: 6), + )); + }); + socket?.on("calib", (periphData) { if (periphData is Map) { if (periphData['periphID'] == widget.peripheralId) { diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart new file mode 100644 index 0000000..7c60b25 --- /dev/null +++ b/lib/firebase_options.dart @@ -0,0 +1,88 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: type=lint +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + return web; + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + return macos; + case TargetPlatform.windows: + return windows; + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions web = FirebaseOptions( + apiKey: 'AIzaSyDnRirxd46eWwUkK9cKi-g0mKaIBY3LODM', + appId: '1:956683546941:web:f66e35806267907c121554', + messagingSenderId: '956683546941', + projectId: 'blindmaster-54055', + authDomain: 'blindmaster-54055.firebaseapp.com', + storageBucket: 'blindmaster-54055.firebasestorage.app', + measurementId: 'G-Y31FSGG3KP', + ); + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyBJzL-jeo4xa_rQkHymzku_2lIJ6WJ8hoI', + appId: '1:956683546941:android:828055a1f543b75f121554', + messagingSenderId: '956683546941', + projectId: 'blindmaster-54055', + storageBucket: 'blindmaster-54055.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyC0MWniqI8flETaT8zKwXQzBhYRljKIKvk', + appId: '1:956683546941:ios:162a6b8aa58f1eb8121554', + messagingSenderId: '956683546941', + projectId: 'blindmaster-54055', + storageBucket: 'blindmaster-54055.firebasestorage.app', + iosBundleId: 'com.example.blindMaster', + ); + + static const FirebaseOptions macos = FirebaseOptions( + apiKey: 'AIzaSyC0MWniqI8flETaT8zKwXQzBhYRljKIKvk', + appId: '1:956683546941:ios:162a6b8aa58f1eb8121554', + messagingSenderId: '956683546941', + projectId: 'blindmaster-54055', + storageBucket: 'blindmaster-54055.firebasestorage.app', + iosBundleId: 'com.example.blindMaster', + ); + + static const FirebaseOptions windows = FirebaseOptions( + apiKey: 'AIzaSyDnRirxd46eWwUkK9cKi-g0mKaIBY3LODM', + appId: '1:956683546941:web:f5d94d05b6ce6bef121554', + messagingSenderId: '956683546941', + projectId: 'blindmaster-54055', + authDomain: 'blindmaster-54055.firebaseapp.com', + storageBucket: 'blindmaster-54055.firebasestorage.app', + measurementId: 'G-WR6581J4P4', + ); +} diff --git a/lib/main.dart b/lib/main.dart index 5f32cd8..a3c0af7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,9 +1,21 @@ import 'package:blind_master/BlindMasterScreens/Startup/splash_screen.dart'; +import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; +import 'firebase_options.dart'; // generated by: flutterfire configure + +// Handles FCM messages that arrive when the app is terminated or in the background. +@pragma('vm:entry-point') +Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { + // The system notification tray handles display automatically — nothing to do here. +} enum DaysOfWeek {Su, M, Tu, W, Th, F, Sa} -void main() { +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); runApp(const MyApp()); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 20e18c2..8dfba1f 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,11 +5,15 @@ import FlutterMacOS import Foundation +import firebase_core +import firebase_messaging import flutter_blue_plus_darwin import flutter_secure_storage_macos import path_provider_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterBluePlusPlugin.register(with: registry.registrar(forPlugin: "FlutterBluePlusPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 87aa811..f4559da 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 510DC9E050C735E1FBF1C1FD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC7515B2D46078310198AFD4 /* Pods_Runner.framework */; }; + BE771B8A9976A1289B08647B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = CBE207412544A4AE810D73E6 /* GoogleService-Info.plist */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -84,6 +85,7 @@ AC7515B2D46078310198AFD4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B470971DD8BAE485C4E2A184 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; BC9EC623BBA5495B6961AC86 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CBE207412544A4AE810D73E6 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; CF16161918037C19DA5DEC89 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; D528F24B7B6048C3ED8D182D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; E3D2DA0696219491C0544B6D /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; @@ -152,6 +154,7 @@ 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, 270DDF1080CFA927F62FC922 /* Pods */, + CBE207412544A4AE810D73E6 /* GoogleService-Info.plist */, ); sourceTree = ""; }; @@ -317,6 +320,7 @@ files = ( 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + BE771B8A9976A1289B08647B /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macos/Runner/GoogleService-Info.plist b/macos/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..61c7616 --- /dev/null +++ b/macos/Runner/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyC0MWniqI8flETaT8zKwXQzBhYRljKIKvk + GCM_SENDER_ID + 956683546941 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.blindMaster + PROJECT_ID + blindmaster-54055 + STORAGE_BUCKET + blindmaster-54055.firebasestorage.app + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:956683546941:ios:162a6b8aa58f1eb8121554 + + \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index d9c5a99..35efcf1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: ff0a84a2734d9e1089f8aedd5c0af0061b82fb94e95260d943404e0ef2134b11 + url: "https://pub.dev" + source: hosted + version: "1.3.59" args: dependency: transitive description: @@ -45,10 +53,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" clock: dependency: transitive description: @@ -121,6 +129,54 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "7be63a3f841fc9663342f7f3a011a42aef6a61066943c90b1c434d79d5c995c5" + url: "https://pub.dev" + source: hosted + version: "3.15.2" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0ed0dc292e8f9ac50992e2394e9d336a0275b6ae400d64163fdf0a8a8b556c37" + url: "https://pub.dev" + source: hosted + version: "2.24.1" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + sha256: "60be38574f8b5658e2f22b7e311ff2064bea835c248424a383783464e8e02fcc" + url: "https://pub.dev" + source: hosted + version: "15.2.10" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + sha256: "685e1771b3d1f9c8502771ccc9f91485b376ffe16d553533f335b9183ea99754" + url: "https://pub.dev" + source: hosted + version: "4.6.10" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + sha256: "0d1be17bc89ed3ff5001789c92df678b2e963a51b6fa2bdb467532cc9dbed390" + url: "https://pub.dev" + source: hosted + version: "3.10.10" flutter: dependency: "direct main" description: flutter @@ -324,18 +380,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.18" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: @@ -505,10 +561,10 @@ packages: dependency: transitive description: name: test_api - sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" url: "https://pub.dev" source: hosted - version: "0.7.7" + version: "0.7.9" typed_data: dependency: transitive description: @@ -566,5 +622,5 @@ packages: source: hosted version: "6.6.1" sdks: - dart: ">=3.8.0 <4.0.0" + dart: ">=3.9.0-0 <4.0.0" flutter: ">=3.29.0" diff --git a/pubspec.yaml b/pubspec.yaml index 08096b6..20cf949 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,6 +42,8 @@ dependencies: flutter_secure_storage: ^9.2.4 flutter_xlider: ^3.5.0 socket_io_client: ^3.1.2 + firebase_core: ^3.0.0 + firebase_messaging: ^15.0.0 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 0c50753..39cedd3 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,12 @@ #include "generated_plugin_registrant.h" +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 4fc759c..1f5d05f 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + firebase_core flutter_secure_storage_windows )