ProKit Flutter - Documentation
ProKit Flutter

πŸ”₯Firebase Configuration

πŸ•’ Estimated Reading Time: 2 minutes
πŸ“‚ Location: Configurations & Customization β†’ Firebase Configuration

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ“Œ What is this file for?

This guide walks you through connecting your mobile application with Firebase for enabling key features like authentication, push notifications, and real-time services.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

🟩 1. Create a New Firebase Project

1. Go to Firebase Console.

2. Click on β€œAdd Project” and create a new one (e.g., named "Example").

3. After project creation, you’ll see a dashboard like this:

4. Navigate to Project Settings and set the Support Email under β€œGeneral”.

🟩 2. Add Your App to Firebase Console

1. On the Firebase dashboard, click the Android icon to register your app.

2. Enter your App Package Name (e.g., com.example.userApp) and click Register App.

3. Once done, download the google-services.json file. Place this file inside your Flutter project at: android/app/google-services.json

🟩 3. Set Up Firebase Authentication

1. In Firebase Console, go to:
Build β†’ Authentication β†’ Get Started

2. Enable the following sign-in methods:

  • Email/Password
  • Google Login
  • Apple Sign-In (if needed)

3. Confirm that all selected login methods are enabled.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

🟩 4. Add SHA Fingerprint (For Login Authorization)

πŸ“Œ Why it’s important?
Google Login & OTP Login require SHA Fingerprint to verify authenticity.

πŸ”Ή How to Add SHA Fingerprint:

1. Follow these steps if you didn’t initially provide a SHA certificate fingerprint for your Firebase Android app or if you need to add an additional one:

  • Go to Project Settings β†’ Your Apps  card
  • Select the Firebase Android app to which you want to add a SHA fingerprint.
  • Click Add fingerprint.
  • Enter or paste the SHA fingerprint, then click Save.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ”Ή How to Generate SHA Fingerprint from Android Studio:

Firebase requires two types of SHA keys:

  • Debug SHA (for testing)
  • Release SHA (for production)

πŸ‘‰ Refer Android Studio tools or terminal commands to generate both.

πŸ“ΈΒ How to generate SHA in Android studio

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

🟩 5. Enable Firebase Notifications (Android & iOS)

This enables push notifications in the mobile app.

  1. Navigate to Project Overview β†’ Project Settings β†’ General
  2. Copy your Project ID from Firebase

🟩 6. Get Firebase Service Account JSON File

Obtain Firebase Service Account Json file

  1. Click on β€œService accounts” in the project Settings.
  2. Click on Generate new Private key Button and Download the service Json file.

⚠️ Trouble Uploading JSON File?

If upload fails due to permission issue:

  1. Open your backend project
  2. Go to this path: storage/app/
  3. Create a folder named: data
  4. Place your service-account JSON file inside this folder

βœ… SUCCESSFUL!!

Great! πŸŽ‰ You have now successfully configured Firebase with your ProKit mobile app. Authentication, push notifications, and cloud services are now connected and ready to use.