Learn step-by-step how to add Firebase to an existing project, register your app, integrate the Firebase SDK, and verify your integration on iOS, Android, and Web.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Set Up Firebase Project
Start by navigating to the Firebase Console. Once there, click on "Add Project" or select an existing project if you already created one. You'll be guided to set up various options. Follow these instructions to establish the project:
Step 2: Register Your App in Firebase Console
You'll need to register your app with the Firebase project. This setup varies slightly dependent on your platform (iOS, Android, Web):
AndroidManifest.xml.Each of these will lead to specific instructions.
Step 3: Add Firebase SDK to Your App
To add the Firebase SDK, integrate the Firebase library into your app's codebase. Instructions differ by platform:
Android: Add Firebase to your build.gradle files:
// Add the dependency for the Firebase SDK
dependencies {
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:31.1.0')
// Add the dependencies for any desired Firebase products
// For example, add the Firebase Authentication module
implementation 'com.google.firebase:firebase-auth'
}
iOS: Add Firebase to your Podfile, then install pods:
platform :ios, '10.0'
target 'YourApp' do
use_frameworks!
pod 'Firebase/Core'
end
pod install
Web: Use npm or include Firebase via CDN in your HTML file:
// Install Firebase using npm
npm install firebase
// Or add a script tag in your HTML
Step 4: Initialize Firebase in Your App
Once the Firebase SDK is added to your project, you need to initialize Firebase in your application's code. Here's how:
Android: Inside your MainActivity.java or Application class:
import com.google.firebase.FirebaseApp;
@Override
public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(this);
}
iOS: Usually, this is done in your AppDelegate:
@import Firebase;
(BOOL)application:(UIApplication _)application didFinishLaunchingWithOptions:(NSDictionary _)launchOptions {
[FIRApp configure];
return YES;
}
Web: Initialize Firebase using the configuration object given in the Firebase Console:
import { initializeApp } from 'firebase/app';
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-app.firebaseapp.com",
projectId: "your-project-id",
storageBucket: "your-project.appspot.com",
messagingSenderId: "your-sender-id",
appId: "your-app-id",
measurementId: "your-measurement-id"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
Step 5: Verify the Integration
It's important to confirm that Firebase is properly integrated:
Step 6: Add Additional Firebase Services (Optional)
Based on your app's requirements, you might need to add other Firebase services:
Each additional service will have its setup instructions, generally consistent across platforms but with specific nuances like configuration and initialization.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.