O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Firebase Cookbook

Book Description

Practical solutions for developing seamless experiences for application that scales.

About This Book

  • A Solution based approach that would help you create high-quality apps for your businesses
  • Harness the power of real-time database to create apps that work on multiple platforms
  • Build a customized solution for your app development challenges with Firebase

Who This Book Is For

This book will assume you have at least a minimum set of skills in JavaScript, HTML and CSS. Also, having some familiarity with backend technologies will be helpful. After all we’re going to build a backend application that will change the way backend developer works.

What You Will Learn

  • Use Firebase Diverse Authentication systems
  • Integrate easy, secure File Hosting using Firebase Storage services
  • Make your application serverless using Firebase Cloud Functions
  • Use the powerful Firebase Admin SDK for privilege management
  • Use Firebase within NativeScript apps for cross-platform applications
  • Modify, structure, save and serve data in and from Realtime Database
  • Get acquainted with the newly introduce Cloud Firestore, a scalable database for your web and mobile applications

In Detail

Do you feel tired just thinking or even hearing about backend technologies, authentication or the tedious task of deployment? Firebase is here to change the way you develop and make your app a first-class citizen of the cloud.

This books takes a solution based approach by providing you recipes that would help you understand the features of Firebase and implement them in your existing web or mobile applications.

We start-off by creating our first Firebase application and integrating its services into different platforms and environments for mobile as well as web applications. Then we deep dive into Real-time Database and Firebase Storage that allows your users to access data across various devices with realtive ease. With each chapter you will gradually create the building blocks of your application from securing your data with Firebase Rules to authenticating your users with O-Auth.

Moving along we would explore modern application development techniques such as creating serverless applications with Firebase Cloud Functions or turning your traditional applications into progressive apps with Service workers.

Finally you will learn how to create cross-platform mobile apps, integrate Firebase in native platforms, and learn how to monetize your mobile applications using Admob for Android and iOS.

Style and approach

This recipe-based practical guide presents each topic with step-by-step instructions on how you can create collaborative and efficient progressive applications using the latest features and capabilities in Firebase.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Preface
    1. Introduction
    2. What this book covers
    3. What you need for this book
    4. Who this book is for
    5. Conventions
    6. Reader feedback
    7. Customer support
      1. Downloading the example code
      2. Downloading the color images of this book
      3. Errata
      4. Piracy
      5. Questions
  2. Firebase - Getting Started
    1. Introduction 
    2. Creating your first Firebase application
      1. How to do it...
    3. Adding Firebase to an existing frontend project
      1. How to do it...
      2. How it works...
    4. Integrating Firebase into the backend
      1. How to do it...
      2. How it works...
    5. Integrating Firebase in Android applications
      1. Getting ready 
      2. How to do it...
    6. Integrating Firebase in iOS applications
      1. Getting ready 
      2. How to do it...
  3. Firebase Real-Time Database
    1. Introduction 
    2. Saving and serving data in and from our Realtime Database
      1. How to do it...
      2. How it works...
    3. Updating and deleting data from our Realtime Database
      1. How to do it...
      2. How it works...
    4. Structuring data within our Realtime Database
      1. How to do it...
    5. Implementing offline capabilities support
      1. Getting ready
      2. How to do it...
      3. How it works...
  4. File Management with Firebase Storage
    1. Introduction
    2. Creating file storage references
      1. Getting ready
      2. How to do it... 
      3. How it works...
    3. Implementing file upload
      1. How to do it...
      2. How it works...
    4. Implementing file serving and downloading
      1. How to do it...
      2. How it works...
    5. Implementing file deletion
      1. How to do it...
    6. Implementing file metadata updates
      1. How to do it...
    7. Firebase file storage error handling
      1. How to do it...
  5. Firebase Authentication
    1. Introduction
    2. Implementing email/password authentication
      1. How to do it...
    3. Implementing anonymous authentication
      1. How to do it...
    4. Implementing Facebook login
      1. Getting ready 
      2. How to do it...
    5. Implementing Twitter login
      1. Getting ready
      2. How to do it...
    6. Implementing Google Sign-in
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Implementing user metadata retrieval
      1. How to do it...
      2. How it works...
    8. Implementing the linking of multiple authentication providers
      1. How to do it...
      2. How it works...
  6. Securing Application Flow with Firebase Rules
    1. Introduction
    2. Configuring the Firebase Bolt language compiler
    3. Configuring database data security rules
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Configuring database user data security rules
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Configuring storage files security rules
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Configuring user storage files security rules
      1. Getting ready
      2. How to do it...
      3. How it works...
  7. Progressive Applications Powered by Firebase
    1. Introduction
    2. Integrating Node-FCM in a NodeJS server
      1. How to do it...
    3. Implementing service workers
      1. How to do it...
      2. How it works...
    4. Implementing sending/receiving registration using Socket.IO
      1. How to do it...
      2. How it works...
    5. Implementing sending/receiving registration using post requests
      1. How to do it...
      2. How it works...
    6. Receiving web push notification messages
      1. How to do it...
      2. How it works...
    7. Implementing custom notification messages
      1. How to do it...
      2. How it works...
  8. Firebase Admin SDK
    1. Introduction
    2. Integrating the Firebase Admin SDK
      1. Getting ready
      2. How to do it...
    3. Implementing user account management by fetching users
      1. How to do it...
    4. Implementing user account management by creating accounts
      1. Getting ready
      2. How to do it...
    5. Implementing user account management by deleting accounts
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Implementing notification sending
      1. How to do it...
      2. How it works...
  9. Extend Firebase with Cloud Functions
    1. Introduction 
    2. Getting started with Cloud Functions 
      1. Getting ready
      2. How to do it...
    3. Implementing data manipulation
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Implementing data-change monitoring
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Welcoming users upon account creation
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Implementing account email confirmation
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Sending re-engagement emails to inactive Firebase users
      1. Getting ready
      2. How to do it...
      3. How it works...
  10. We’re Done, Let’s Deploy
    1. Introduction
    2. Deploying our application to Firebase
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Customizing the Firebase hosting environment
      1. How to do it...
      2. How it works...
  11. Integrating Firebase with NativeScript
    1. Introduction
    2.  Starting a NativeScript project
      1. How to do it...
    3. Adding the Firebase plugin to our application
      1. How to do it...
    4. Pushing/retrieving data from the Firebase Realtime Database
      1. Getting ready 
      2. How to do it...
      3. How it works...
    5. Authenticating using anonymous or password authentication
      1. Getting ready 
      2. How to do it...
      3. How it works...
    6. Authenticating using Google Sign-In
      1. Getting ready 
      2. How to do it...
      3. How it works...
    7. Adding dynamic behavior using Firebase Remote Config
      1. Getting ready
      2. How to do it...
      3. How it works...
  12. Integrating Firebase with Android/iOS Natively
    1. Introduction
    2. Implementing the pushing and retrieving of data from Firebase Realtime Database
      1. How to do it...
    3. Implementing anonymous authentication
      1. How to do it...
      2. How it works...
    4. Implementing password authentication on iOS
      1. How to do it...
      2. How it works ...
    5. Implementing password authentication on Android
      1. Getting ready 
      2. How to do it...
      3. How it works...
    6. Implementing Google Sign-in authentication
      1. Getting ready...
      2. How to do it...
      3. How it works...
    7. Implementing Facebook login authentication
      1. Getting ready...
    8. Facebook authentication in Android
      1. Getting ready...
      2. How to do it...
      3. How it works
    9. Facebook authentication in iOS
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Generating a crash report using Firebase Crash Report
      1. How to do it...
    11. Adding dynamic behavior using Firebase Remote Config in Android
      1. Getting ready
      2. How to do it...
      3. How it works...
    12. Adding dynamic behavior using Firebase Remote Config in iOS
      1. Getting ready
      2. How to do it...
      3. How it works...
  13. Hack Application's Growth
    1. Introduction
    2. Implementing sending/receiving app invite in Android/iOS
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Implementing topic subscription in Android/ iOS
      1. How to do it...
      2. How it works...
  14. Adding Analytics and Maximizing Earnings
    1. Introduction
    2. Integrating Firebase analytics into Android/iOS applications
      1. How to do it...
    3. Implementing event logging on Android/iOS
      1. How to do it...
    4. Implementing user properties for data and audience filtering
      1. How to do it...
    5. Integrating Firebase AdMob with Android/iOS applications
      1. How to do it...
    6. Implementing Firebase AdMob banner ads on Android/iOS
      1. Getting ready
      2. How to do it...
      3. How it works... 
    7. Implementing Firebase AdMob native ads express on Android/iOS
      1. Getting ready
      2. How to do it...
      3. How it works... 
    8. Implementing AdMob ads targeting
      1. Getting ready
      2. How to do it...
      3. How it works... 
  15. Firebase Cloud FireStore