Authentication & Notifications

Firebase, Google Sign-In & FCM Push Notifications

Step-by-step instructions detailing exactly where Google Sign-In keys, OAuth client IDs, and Firebase Cloud Messaging credentials are placed in the codebase and admin panel.

🔥 1. Firebase Project Setup

  1. Go to the Firebase Console and click Add Project (e.g., VibeMatch-App).
  2. Disable Google Analytics (or enable if desired) and create the project.
  3. Navigate to Authentication > Sign-in method. Enable Google and Phone authentication.

🤖 2. Android App Credentials

  1. In Firebase Console, click the Android icon to add an Android app.
  2. Enter the package name: com.vibematch.app (or your custom package name).
  3. Add SHA-1 Fingerprint: Crucial for Google Sign-In and Phone SMS Auth. Run in your terminal:
    cd flutter_app/android && ./gradlew signingReport
    Copy the SHA-1 and SHA-256 keys and add them to your Android app settings in Firebase Console.
  4. Download the generated google-services.json file.
  5. Place it in the Flutter codebase at:
    flutter_app/android/app/google-services.json

🍎 3. iOS App Credentials

  1. In Firebase Console, click Add App and choose iOS.
  2. Enter your iOS Bundle Identifier: com.vibematch.app.
  3. Download the generated GoogleService-Info.plist file.
  4. Open flutter_app/ios/Runner.xcworkspace in Xcode, drag and drop GoogleService-Info.plist into the Runner folder, and check Copy items if needed.
    flutter_app/ios/Runner/GoogleService-Info.plist

🔔 4. Firebase Cloud Messaging (FCM) & Backend Setup

To deliver real-time push notifications for incoming video calls, direct messages, and diamond gift alerts when the app is in the background:

  1. In Firebase Console, navigate to Project Settings > Service Accounts.
  2. Click Generate New Private Key. Download the generated JSON credentials file.
  3. Navigate to your VibeMatch Admin Panel: Admin Panel > Settings > Firebase & Auth.
  4. Paste the Firebase Project ID and upload/paste your Firebase Service Account JSON.
  5. Click Save Firebase Settings. The backend initializes the Firebase Admin SDK dynamically.

✅ 5. How to Verify Push Notifications are Delivered

  1. Install the built APK or run flutter run on a physical device.
  2. Log in to the app. When prompted, grant the Notification Permission dialog.
  3. Send the app to the background (press Home button or lock the screen).
  4. From another account (or test user), send a direct text message or start a video call.
  5. Expected Result: An instant push notification banner with sound and partner avatar appears in the Android notification shade / iOS Notification Center.
  6. Log Verification: Check device logs via adb logcat -s "FLTFireMsgService" to inspect token registration.