What is Google Firebase
Nowadays there are a number of server-side technologies in the market and developers have to make a tough decision of choosing the best database for their application. Firebase is the best back end services for web and mobile applications. Firebase is a gem of next generation app development platform on Google Cloud Platform. Developers don’t need to manage servers or make APIs while using Firebase. Firebase helps in developing high-quality applications, grow user engagement and earn more money. Lets see Why to shift to google Firebase along with end to end installation
Firebase products can be divided into three different groups:
1. Develop Products
2. Quality Products
3. Grow Products
How to create Firebase Account
For using Firebase, you need to have a Google Account because it will be integrated with the Firebase and only then you can go to your console and use all the features of Firebase.
Follow the following steps for signing in or creating a new Firebase Account:
1. Go to https://firebase.google.com/ and click on “SIGN IN” Button on the top right corner as shown in the screen below.
2. When you will click on the “SIGN IN” Button you will be directed to Google Account Login page as shown below. If you already have a Google Account then you just have to enter your credentials and you are good to go. But if you don’t have a Google Account then you have to create a new one. For creating a new account click on the “Create Account” button on the bottom left corner.
3. For creating the Google Account, you have to fill in the fields shown in the image below and then click “Next”.
4. On clicking the “Next” button you will be directed to this screen where you have to give your information like date of birth, gender etc. After filling the fields, you have to click on the “Next” button at the bottom.
5. Now you will be directed to the following screen where you just have to accept the Terms and Conditions and then you will successfully create your Google Account.
6. After creating/signing in to your Google Account, you will be directed back to Firebase Page and it will show your account on the top right corner. You click on “Go to Console” button so that you can go to the Firebase Console and start working on your projects.
How to add a new project in Firebase Console
Why to shift to google Firebase along with end to end installation
You can add new projects in Firebase Console with which you can integrate your iOS, Android and Web Applications.
Following are the steps for creating new projects in Firebase Console:
1. Go to the console and click on “Add project” button shown in the image below.
2. Next you will have to give your project name and the project ID is generated automatically. Every project on Firebase has a unique id. You can edit the Analytics and Cloud Firestore locations. Analytics location represents the country/region of your organization and sets the currency for your revenue reporting. Cloud Firestore location shows where your cloud Firestore data resides and this will not be changed later so you have to choose this option before creating the project. Then you will have to check the options for terms and conditions and default settings. Then click on “Create Project” button.
3. Now you will be directed to your project console where you can add your iOS, Android and Web applications in it and you can use all other features of Firebase.
- Firebase is a comprehensive mobile development platform which provides the following services:
1. Develop Services of Firebase:
• Firebase Authentication:
Most of the Smart applications need authentication of the users to validate the identity of the registered users. Applications need authentication so that they can save any user’s data securely which can be used in the application across all of the user’s devices.
Firebase Authentication provides a full set of authentication methods for storing users’ credentials securely. It provides back end services, easy to use SDKs, and ready-made UI Libraries. It supports authentication through following methods:
• Phone number
• Play Games
For signing in users, you need users’ authorization credentials which will be passed to the Firebase Authentication SDK. Then the backend services will verify those credentials and return a response to the user.
You can find authentication under Develop menu on the left side of the screen as shown in the image below.
Here you can set up sign-in methods as shown below.
Firebase real time database stores and sync data with NoSQL Database. The data remains available even when the application goes offline. Data is stored as JSON tree form which means values are stored with their particular keys. Every time data changes, all the connected devices get the update within milliseconds. It also provides security and validation through Security Rules.
How to create Database?
1. Integrate the Firebase Database SDK through gradle, CocoaPods or script includes.
2. Then create Realtime Database References of your JSON Data in your code.
3. Then use these references for setting or listening any changes in the data.
4. You can also enable offline persistence which means data is written to your local disk so that it can be made available to you even if the application is offline.
5. Use Security Rules for securing database.
Cloud Firestore (Beta):
Cloud Firestore is Firebase’s new database for mobile app development. It provides faster and richer queries and scales better than Realtime Database. But it’s still in beta mode.
It provides better querying and structured data. Instead of long JSON tree, it stores data in the form of documents and collections. You can keep your data stored hierarchically. Searching will be fast no matter how big your data set is. It can make simple one-time fetch queries efficiently. Data is stored in documents which contain fields mapping to values. Documents are stored in collections. You can make queries to retrieve data at any level of document without retrieving the whole collection.
How to implement Cloud Firestore (Beta)
1. Set up Cloud Firestore SDK through gradle, Cocoapods or script includes.
2. Setup security Rules for securing your data.
3. Create documents and collections in your database.
4. Create queries or real time listeners to retrieve data.
Cloud Storage is for storing content like photos or videos. Files can be uploaded to Cloud Storage and it will return downloadable link. Uploads and Downloads are robust which means they will restart from where they were stopped. It also provides strong security because it is integrated with Firebase Authentication.
How to implement Firebase Cloud Storage?
• Integrate Cloud Storage SDK through gradle, cocoaPods or a script include.
• Create reference for the path of the file which you want to upload or download.
• Upload or download files.
• Setup Security Rules.
Firebase provides secure and safe static hosting to web applications. It helps in hosting static sites and you can easily deploy static content.
• Content is securely deployed through Zero-configuration SSL.
• Firebase Hosting delivers files all over the world through the fast CDN using HTTPS requests.
• It also provides rapid deployment. Command line tools make it easy for deploying the content rapidly.
• It also allows users one-click rollbacks to undo mistakes.
How to implement Firebase Hosting?
• Install the Firebase CLI
• Add files and assets to your local Hosting folder.
• For deploying site, you can run “firebase deploy” to publish your content on the servers. All the new versions are released at once.
How to implement Cloud Functions
• Install the Firebase CLI and initialize cloud functions in your firebase project.
• Deploy your functions using the Firebase CLI. You can use the Firebase console to view and search through your logs.
ML Kit (Beta)
In today’s fast-moving world, consumers have come to expect mobile apps that are not only intuitive but are also able to provide powerful features and are adaptive to new information. That is why machine learning and artificial Intelligence has become critical to mobile development. Developers are increasingly relying on machine learning to enhance their users’ experience.
ML Kit is a powerful SDK present in Firebase which can bring powerful machine learning features to your application. ML Kit comes with ready-to-use APIs, focused on common mobile use cases like recognizing text, detecting faces, recognizing landmarks, scanning barcodes and labelling images.
You simply pass on the data to the library and it will give you all kinds of useful and interesting information. ML Kit APIs run on the device or in the cloud depending upon the functionalities or in some cases both. On device, APIs work fast and without network connection. Cloud-based APIs use Google Cloud Platforms, ML technology, and provides accurate results.
If you’re an experienced ML Developer and ML Kit doesn’t provide you required APIs then you can use your own custom models. You can upload your own TensorFlow Lite model in the Firebase Console and Firebase will provide hosting for it. If you host your custom model with firebase, ML Kit will automatically update your users with latest version.
o Text Recognition:
ML Kit can help you in recognizing text in any Latin-based languages. It can read data from anything like books, documents, business cards, credit cards, and receipts or help organize photos.
o Detect Faces:
ML Kit helps in detecting faces and key facial features in an image. With face detection, you can get the information you need to perform tasks like embellishing selfies and portraits, or generating avatars from a user’s photo.
You can get the coordinates of eyes, ears, cheeks and mouth of the face detected. You can also recognize the facial expressions i.e. whether the person is smiling or not. You can also track faces across video frames. It is fast enough to be used in real-time applications.
o Scan Barcodes:
ML Kit can also be used to detect the data encoded in the barcodes. Barcodes are a convenient way to pass information from the real world to your app. In particular, when using 2D formats such as QR code, you can encode structured data such as contact information or Wi-Fi network credentials. Because ML Kit can automatically recognize and parse this data, your app can respond intelligently when a user scans a barcode.
It can read standard barcode formats. It can automatically detect the format of the barcode. Structured data stored using one of the supported 2D formats are automatically parsed. Supported information types include URLs, contact information, calendar events, email addresses, phone numbers, SMS message prompts, ISBNs, Wi-Fi connection information, geographic location, and AAMVA-standard driver information. It works with any orientation.
o Label Images:
With ML Kit’s image labeling APIs, you can recognize entities in an image without having to provide any additional contextual metadata, using either an on-device API or a cloud-based API.
o Recognize Landmarks:
You can also recognize well-known landmarks through ML Kit APIs. You can get geographical coordinates and the region of the image
Quality Services of Firebase
Stability issues derail the success of even the best applications. Buggy apps effect the user experience and might make the user unhappy. Applications might generate a lot of crashes and tracking them manually is time consuming.
Firebase Crashlytics help in tracking the issues in applications by analyzing and organizing them. It can also help you prioritize the crashes which are most important. It consists of real-time dashboard and alerts to keep you aware of newest issues. Crashes are grouped across all the versions of your application with stack trace. Stack trace helps you in determining what your app was doing before the crash. All the crashes are visible in the dashboard and gives you the context of the cause of the crash. When your code fails but the app doesn’t crash, it is can also be seen in the dashboard. You can always count on Crashlytics to stay on top of the stability of your app.
You gain insight to your app’s performance issues through Firebase Performance Monitoring. Waiting for things to load is every app’s experience but sometimes loading takes a lot of time depending upon the devices or network. There’s a wide variety of networks and devices all across the globe. Now if you want to optimize the usage of your app then you should know what’s happening in the critical moments of your app’s use and this information comes directly from the users. Firebase Performance Monitoring solves this problem for you.
By integrating the SDK, and without any code, your performance dashboard collects information about your application. You’ll get data about your app’s startup time and HTTP transaction. You can also break down information in the dashboard according to different countries or device types etc.
People uses different devices according to their requirements and demands. Now you should make sure that your app gives the same great user experience across all types of devices regardless of screen size, OS version and the features of the app users use most. You cannot buy all types of devices and test your application in them, therefore Firebase Test Lab solves this problem for you.
Firebase Test Lab makes sure that your application works great on all varieties of device. Tests will be according to the latest technology. Test results include detailed reports with screenshots, device logs and crashes that may have occurred.
Firebase makes predictions based on the experience which helps in increasing user retention, reduce churn, and improve in-app purchase revenue with predictive analytics and targeting. A machine learned model is created which will predict that what users might do. It can predict which users might stop using the application so that you can offer them with something by personalizing your application for them through Remote Config. Predictions are refreshed on daily basis for you to improve your user experience.
For start using Predictions, you must use Firebase Analytics as it is corelated to predictions. If you are already using Analytics then you have to enable “Analytics Data Sharing”.
Predictions will be shown like this:
You can also create custom predictions
A/B Testing (Beta):
A/B Testing runs on top of Remote Config, Cloud Messaging and Analytics to test and measure just about anything in your app. Go to the Firebase Console, decide what users you are going to target, decide what elements you want to change and what kinds of results you are looking to optimize.
Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.
In-App Messaging (Beta):
This feature of Firebase is used for engaging active users of the application with custom messages. Firebase In-App Messaging helps you to engage your app’s active users by sending them targeted, contextual messages that encourage them to use key app features. You can send these messages to guide people through the application, send promotions or updates about the application. You can set these messages in Firebase Console where you can also customize its look and behavior.
Firebase Remote Config:
Firebase Remote Config is used to send updates to your application instantly. You can change the behavior and appearance of your app without publishing an app update, at no cost, for unlimited daily active users. It is a cloud service that lets you send an app update and your users don’t have to download the updated application again and again.
With Dynamic Links, your users get the best available experience for the platform when they open your link on iOS or Android. They can be taken directly to the linked content in your native app. If a user opens the same Dynamic Link in a desktop browser, they can be taken to the equivalent content on your website.
Firebase Dynamic Links provide deep links that lets you create one link for your application that behaves one way on iOS, Android and Web Applications. You can also change the behavior of your application on the factor i.e. whether user has installed your application or not.
AdMob is trusted by over 650,000 applications. It let developers implement first-class monetization strategies. It is integrated with Firebase SDK and its APIs are built to create customized banners, interstitials, and videos adds to your applications. AdMob automatically selects ads which pay you the most. You can also create CSS templates to improve user experience. AdMob also helps you earn in-app purchases too.
There are different kinds of analytical tools for app developers to use. There are in-app behavioral tools, which measures who your users are, what they’re doing. Then you have attribution analytics, which you use to measure effectiveness. And then there is push notification and crash reporting. Firebase Analytics provides all such data in one place and you don’t have to use different tools and gather data from different sources which is time consuming. It gives you free unlimited logging and reporting. There are no quotas, no sampling and no paid tiers.
Simply by installing Firebase SDK, Analytics automatically starts providing insights into your application. You receive demographic information which shows who your users are, how regularly they use your app, how much time they spend, and how much they’ve spent on your application. You can find out what your users are up to by getting details from the logging events. You can also setup custom user behaviors to find out who your users are. Custom audiences can be defined in the Firebase console based on device data, custom events, or user properties. These audiences can be used with other Firebase features when targeting new features or notification messages.
Firebase App Indexing gets your application in Google Search. It helps you in reengaging the users by integrating Google Search. You have to just add your application in the index and when user searches any content on Google that is present in your application, your application will be showed in the Google Search.
Firebase invites help users to share your app through referral codes or any content of your application so that people can know about your application and install it. Firebase invites helps in getting exposure for your app.
Firebase Pricing Plans
How firebase is good for your project
Firebase provides a complete set of products which can help in building an efficient application. It provides services for developing application, growth of application and testing the quality of application. It has free pricing for simple small applications, then scales up linearly with volume. Firebase makes everything easy for the developers as they don’t have to write APIs or manage back end servers while using it. It helps in giving amazing user experience. You can perform a number of complex functions easily with the help of Firebase to build high-quality and bug-free applications for Android, iOS and Web. It helps to save a lot of time aiding the developer to concentrate on the core functionalities that make application or websites faster, extraordinary and user-centric. So if you’re planning to start an application, you should consider Firebase for it.