Google Firebase is a Google-backed application development software that enables developers to develop, manage, and grow iOS, Android and Web apps. Firebase provides back-end tools to implement various services including authentication, notification, messages, real time database, cloud storage, analytics, and many more.
In this Firebase project tutorial, I will show you how to create a new Firebase project in Firebase Console and teach you important Firebase Project Configuration.
Create Firebase Project
Creating a Firebase Project is actually pretty simple and can be achieved very easily. Ff you follow the next steps in this article, you’ll be good to go.
- Visit Firebase Console
If you don’t already have an account, you can simply log in with your email or create a new account.
- Click on Add Project
- Enter your project name
To create a new project, enter the name of your project, check the confirmation message, and click continue
- Set up Google Analytics
In this step, you’ll be asked to enable or disable Google Analytics which is an optional feature.
If you choose to disable it, you can simply uncheck “Enable Google Analytics for this project” and click on create project. You’ll be directed to Firebase Dashboard afterwards.
However, if you choose to enable Google Analytics, you’ll be required to choose or create a Google Analytics account. You can set Google Analytics account to be your default Firebase account or create a new account for Google Analytics, that’s totally up to you. Once that’s done, click on Create project.
In both case, it will take a while to create the project, then you’ll be directed to Firebase Dashboard.
Now, right after creating the Firebase project, you have to configure the platform which you want to integrate Firebase with. Based on your app platform, you can configure Firebase on Android, IOS, or Web platforms.
Configure Firebase on Android
- From the dashboard, select the Android icon
- Next you need to register your app by entering your Android package name, App nickname, and SHA-1 then click register app. You can get the Android package name from applicationId in app-level build.gradle file in Android Studio. Take note that SHA-1 is optional and you only need to enter it if you’re planning to implement features like Google and Phone number sign in.
- download google-services.json and add it to Android app module root directory
- follow the instructions specified and copy the code to where the instruction says and sync Gradle to finish.
And that’s it, you’ve successfully configured Firebase on Android platform.
Configure Firebase on IOS
- From the dashboard, select IOS icon
- Enter your iOS bundle ID and an app nickname.
- Download the
GoogleService-Info.plistfile. Then, from your ios project, open IOS folder in XCode, add the GoogleService-info.plist into your Runner folder, and click Next.
- Add Firebase SDK
Before installing Firebase SDK package, you need to install CocoaPods which is a dependency manager that helps you install third-party packages to your project. To install it, click on Download Zip in Firebase Console.
Once you install CocoaPods, you need to create a Podfile. To do so, open the terminal window and navigate to the location of your XCode project folder then type the following command
This will take a few seconds to create the Podfile, once it’s done, you need add Firebase Pod to the PodFile. Open up the PodFile and add the code below under # Pods for FirebaseiOSDemo and save the file.
Finally, go to Terminal and locate the Xcode project folder and run the following command
This will take a few seconds to download Firebase dependencies and integrate it into your Xcode project.
Once that’s done, you can see a few files added to the project when looking at the project folder in Finder. Now from Firebase dashboard click Next to go for the next step
- Add initialization code
To connect Firebase when your app starts up, copy the initialization code from the dashboard and it to the code below to your main AppDelegate class then click Next and you’re all set up.
Configure Firebase on Web
- From Firebase dashboard, click on Web icon
- Enter your app nick name and click on Register app
- Add Firebase SDK
click on use a script tag then copy the scripts into the bottom of your body tag and click continue to console
And there you go, you’ve configured Firebase on Web platform.
Congratulations! You have learned how to create Firebase project and integrate it on Android, IOS, and Web platforms. I hope you enjoyed this tutorial and learnt from it.
Don’t forget to share this post with your friends who are interested in learning more about Firebase.