Skip to content

Latest commit

 

History

History
61 lines (39 loc) · 2.22 KB

File metadata and controls

61 lines (39 loc) · 2.22 KB

Firebase Setup for Weeklies

This project is prepared for Firebase-based real-time synchronization using Firebase Core and Cloud Firestore. Follow these steps to complete the platform-specific configuration.

1. Dependencies

Already configured in pubspec.yaml:

  • firebase_core
  • cloud_firestore

Run in your own environment (with Flutter installed):

flutter pub get

2. Initialization in Code

Firebase is initialized in lib/main.dart:

  • WidgetsFlutterBinding.ensureInitialized();
  • await Firebase.initializeApp();
  • App bootstrapped only after Firebase initialization completes.

This ensures the app is ready to interact with Firebase services (e.g., Firestore) from startup.

3. Android Configuration (Required)

  1. Create a Firebase project in the Firebase Console.

  2. Add an Android app with your applicationId.

  3. Download the generated google-services.json.

  4. Place it at:

    • android/app/google-services.json
  5. In your local Android project (outside this repo’s scope), ensure:

    • com.google.gms:google-services classpath is added to android/build.gradle.
    • apply plugin: "com.google.gms.google-services" is added in android/app/build.gradle.

Do not commit real google-services.json with production keys to version control.

4. iOS Configuration (Required)

  1. In the same Firebase project, add an iOS app with your iOS bundle identifier.

  2. Download GoogleService-Info.plist.

  3. Add it to the Xcode project:

    • Drag GoogleService-Info.plist into the Runner target.
  4. Ensure Firebase initialization is enabled in your iOS Runner configuration according to official Firebase Flutter docs.

Do not commit real GoogleService-Info.plist with production keys to public repos.

5. Notes and Expectations

  • This repository intentionally does not include any real Firebase configuration files or secrets.
  • Once platform config files are added correctly in your local environment:
    • Firebase.initializeApp() in lib/main.dart will succeed.
    • You can safely add Firestore-based real-time synchronization in subsequent phases (5.3+).
  • Keep separate configs for dev/stage/prod using different Firebase projects if needed.