Streamit Laravel - Documentation
Streamit Laravel

Firebase Configuration

Estimated reading: 6 minutes

Setting up Firebase for your Streamit Laravel Project

Create A New Firebase Project

1.We are creating the “Example” sample project.

2. After completing the project, you will be presented with this type of dashboard.

3. Go to the project settings and configure the support email.

Add App With The Package Name In Firebase Console

1.On the firebase console, click the android icon.

2. Enter package name (e.g., com.iqonic.example) and click on register app.

3. After registering the app, you will receive the Google JSON file download it and save it to the android folder.

Set Up Firebase Authentication

1. Go to Build -> Authentication tab and click on Get started.

2. Then select the Email/Password, Google, Apple, and Phone Number one by one and enable them.

3. Re-check if all these 3 modes of authentication are enabled or not.

4. For Connecting Chat server

  • Click on Setting tab
  • Select Users Action
  • Disable “Email Enumeration Protection” option

Add SHA certificate fingerprints

SHA FINGERPRINT

SHA-1 fingerprint is used as part of the OAuth 2.0 flow to verify the identity of the Android app.
It ensures that only authorized apps can authenticate users and access Firebase Authentication services securely.

SHA-256 fingerprint is used to enhance the security of authentication mechanisms provided by Firebase, such as Google Sign-In or Phone Authentication.

We need SHA1 and SHA256 for variant & config Debug and Release

WHY SHA IS NEEDED?

SHA (Secure Hash Algorithm) fingerprints are used for authentication and security purposes. When you integrate Firebase services into your Android app, such as Firebase Authentication, Firebase Cloud Messaging (FCM), Firebase Dynamic Links, etc., you need to register your app’s digital fingerprint, typically its SHA-1 or SHA-256 hash, with the Firebase project

Firebase Authentication uses SHA fingerprints to ensure the security of authentication requests. When you register your app with Firebase, you provide its SHA-1 or SHA-256 fingerprint. Firebase uses this fingerprint to authenticate communication between your app and the Firebase backend servers. This helps prevent unauthorized access to Firebase resources and enhances the security of user authentication.

Follow these steps to add a SHA certificate fingerprint for your Firebase Android app initially or if you want to add an additional one:

1. In your Project settings, go to the Apps

2. Select the Firebase Android app to which you want to add a SHA fingerprint

3. Click Add fingerprint.

4. Enter or paste the SHA fingerprint, then click Save.

Add iOS App With The Package Name In Firebase Console

1.On the firebase console, click the ios icon.

2. Enter package name(e.g com.iqonic.example) and click on register app.

3. After registering the app, you will receive the Google Service-Info.plist file download it and drag and drop to xcode as location shown in image here is the steps how to open ios in xcode.

  • Select open another project.
  • Open the ios directory within your app.
  • Now, click on done button.

Enable Firebase Notification In Mobile For Both Android And IOS

INFO

After completing firebase configuration. Please make sure you complete the Default Firebase configuration steps in Flutter Configuration make sure you complete those steps before you proceed for this step.

For Firebase Details

  • Obtain Firebase Service Account json file
    • Click on Service accounts in the project Settings.
    • Click on Generate new Private key Button and download the service json file.
  • Copy “project_id” , “private_key” and “client_email” from the generated json file
  • Firstly, go to the Admin Panel select the Mobile Setting –> Select App Configurations and enable to Firebase Notification Paste the values into respective fields.
  • No need to add “Firebase Serve Key” and Save the changes.

For iOS Notification .p12 Certification:

  1. Create APNs Certificate, Please visit the below link and follow the link Click here .
  2. Login into Firebase and select the your project.
  3. Go to the Project Settings and select the Cloud Messaging section.
  4. Scroll down and you can show Apple app configuration section and select your iOS build identifiers which you have used for the Specific App.
  5. You can get Upload APNs Certificates popup and drag or select your support.p12 certificate.

SUCCESSFULL !!

Great! You Have Successfully Configured Firebase!