Firebase Configuration

Estimated reading: 4 minutes 5067 views
NOTE
  1. For Firebase, you can only create one project, but you must include two apps in that project.
  2. Remember to set up the remote settings.

Creating a new firebase project

  • We are creating the “Example” sample project.
  • After completing the project, you will be presented with this type of dashboard.
  • Go to the Project Settings and configure the Support Email

Adding app with the package name in firebase console.

  • On the Firebase console, click the Android icon.
  • Enter Package Name(e.g com.iqonic.example) and click on register app

Setting Up Firebase Authentication

  • Go to Build->Authentication tab and click on Get started
  • Then Select the Email/Password, Google, Apple, and Phone Number one by one and Enable it.
  • Re-check if all this 3 modes of authentication are enabled or not.

Activating the Firestore Database

  • Go to Build->Firestore Database tab and click on Get Started
  • When you click the Get Started button, a dialogue will appear asking you to choose a mode, because we are testing, we will select the Start in Test Mode option and then click Next and then Enable it.
  • Change the firestore’s rules to save the data in a database.

Before Changing Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if
          request.time < timestamp.date(2022, 8, 26);
    }
  }
}

After Changing Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

SHA Fingerprint

IMPORTANT

SHA-1 fingerprint is a unique key generated for your PC that can be used for signing. It is important to have in the add firebase as we are using Google Login and OTP Login and to authorize this logins we need a SHA Fingerprint cerificate.

Add a SHA fingerprint to Firebase

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

  1. In your Project settings, go to the Your apps card.
  1. Select the Firebase Android app to which you want to add a SHA fingerprint
  1. Click Add fingerprint
  1. Enter or paste the SHA fingerprint, then click Save

How to generate the and SHA from Andriod Studio

IMPORTANT

There are two types of SHA Fingerprint, Release SHA Fingerprint and Debug SHA Fingerprint, Here we will how to generate both type of SHA Fingerprint

1. Debug SHA Fingerprint

  • Open Android Module and wait for the build to finish
  • On the right side of the screen, look for the “gradle” option and click it
  • By clicking, you will access the menu options. Select the first tab, and a dialog will appear
  • Enter “signingReport” into the dialog box
  • After building the gradle, the SHA and SHA256 will be displayed in the console log
  • Copy the SHA and SHA256 one by one and paste them into the above-mentioned open firebase window

2. Release SHA Fingerprint

  • Launch Android Module and wait for the build to finish
  • From the file menu, Select Project Structure
  • Navigate to the module section and Select App -> Singing Configurations
  • Click on “+” icon and add new module name “release”
  • Please select the JKS that you created at the time of release here (if JKS is not created then please create first and then select.)
  • Check that the release configuration is selected in the gradle file
  • Repeat the preceding steps to run the command, and the Release SHA will be displayed in the console log

Generating The Configure Key For OTP Login In iOS

  • Select the Keys to option from the left panel
  • Select the Add Key button
  • Add Key Name and select Apple Push Notifications service (APNs) option
  • Then Select on Continue button and download the support p8 certificate
  • Login into Firebase and select the your project
  • Go to the Project Settings and select the Cloud Messaging section
  • Scroll down and you can show Apple app configuration section and select your iOS build identifiers which you have used for the Customer App
  • You can get Upload APNs auth key popup and drag or select your support.p8 certificate
  • Added your Key ID and Team ID
Great! You have successfully configured Firebase!

Leave a Comment

Share this Doc

Firebase Configuration

Or copy link

CONTENTS