From e129be5a5921a63a118b8161dc5c4d0a909bc6e0 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Sun, 8 Mar 2026 21:55:52 +0530 Subject: [PATCH] feat: Implement Firebase push notifications with support for flavor-specific configurations. --- android/app/build.gradle.kts | 1 + android/app/src/demo/google-services.json | 48 ++++ android/app/src/dev/google-services.json | 29 ++ android/app/src/local/google-services.json | 67 +++++ android/app/src/main/AndroidManifest.xml | 5 + android/settings.gradle.kts | 1 + ios/Podfile | 3 +- ios/Podfile.lock | 120 ++++++++- ios/Runner.xcodeproj/project.pbxproj | 18 ++ ios/Runner/AppDelegate.swift | 31 +++ ios/Runner/GoogleService-Info.plist | 30 +++ ios/config/demo/GoogleService-Info.plist | 30 +++ ios/config/dev/GoogleService-Info.plist | 30 +++ ios/config/local/GoogleService-Info.plist | 30 +++ ios/scripts/copy-firebase-config.sh | 27 ++ .../services/push_notification_service.dart | 195 ++++++++++++++ lib/core/widgets/app_shell.dart | 26 +- .../screens/agent_home_screen.dart | 249 +++++++++--------- .../presentation/providers/auth_provider.dart | 12 + .../data/notification_repository.dart | 33 +++ lib/main.dart | 2 + macos/Flutter/GeneratedPluginRegistrant.swift | 6 + pubspec.lock | 96 +++++++ pubspec.yaml | 5 + .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 26 files changed, 974 insertions(+), 124 deletions(-) create mode 100644 android/app/src/demo/google-services.json create mode 100644 android/app/src/dev/google-services.json create mode 100644 android/app/src/local/google-services.json create mode 100644 ios/Runner/GoogleService-Info.plist create mode 100644 ios/config/demo/GoogleService-Info.plist create mode 100644 ios/config/dev/GoogleService-Info.plist create mode 100644 ios/config/local/GoogleService-Info.plist create mode 100755 ios/scripts/copy-firebase-config.sh create mode 100644 lib/core/services/push_notification_service.dart diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f725ae1..07e980c 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -3,6 +3,7 @@ plugins { id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") + id("com.google.gms.google-services") } android { diff --git a/android/app/src/demo/google-services.json b/android/app/src/demo/google-services.json new file mode 100644 index 0000000..c8ca78e --- /dev/null +++ b/android/app/src/demo/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "703616926518", + "project_id": "real-estate-2d71e", + "storage_bucket": "real-estate-2d71e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:703616926518:android:270639d6887d2cb4fca997", + "android_client_info": { + "package_name": "com.requestn.real_estate_mobile.demo" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAwb_9fc7n9gbN_IQqWeYRkHSSykzVHCyc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:703616926518:android:4342b796fbabb690fca997", + "android_client_info": { + "package_name": "com.requestn.real_estate_mobile.dev" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAwb_9fc7n9gbN_IQqWeYRkHSSykzVHCyc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/dev/google-services.json b/android/app/src/dev/google-services.json new file mode 100644 index 0000000..40df83f --- /dev/null +++ b/android/app/src/dev/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "703616926518", + "project_id": "real-estate-2d71e", + "storage_bucket": "real-estate-2d71e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:703616926518:android:4342b796fbabb690fca997", + "android_client_info": { + "package_name": "com.requestn.real_estate_mobile.dev" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAwb_9fc7n9gbN_IQqWeYRkHSSykzVHCyc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/local/google-services.json b/android/app/src/local/google-services.json new file mode 100644 index 0000000..dfa204c --- /dev/null +++ b/android/app/src/local/google-services.json @@ -0,0 +1,67 @@ +{ + "project_info": { + "project_number": "703616926518", + "project_id": "real-estate-2d71e", + "storage_bucket": "real-estate-2d71e.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:703616926518:android:270639d6887d2cb4fca997", + "android_client_info": { + "package_name": "com.requestn.real_estate_mobile.demo" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAwb_9fc7n9gbN_IQqWeYRkHSSykzVHCyc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:703616926518:android:4342b796fbabb690fca997", + "android_client_info": { + "package_name": "com.requestn.real_estate_mobile.dev" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAwb_9fc7n9gbN_IQqWeYRkHSSykzVHCyc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:703616926518:android:2eb242f07b174c25fca997", + "android_client_info": { + "package_name": "com.requestn.real_estate_mobile.local" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAwb_9fc7n9gbN_IQqWeYRkHSSykzVHCyc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ceb1fe5..bfab90a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ + + +