Ionic 5 - Taxi Booking Platform with Firebase
  • Ionic 5 Taxi Complete Platform using Firebase - User, Driver Admin Apps
  • Why use this Starter
  • Setup and Deployment
    • Initial Dev Environment Setup
    • Running the App (Web Browser)
    • Deploying app as PWA
    • Building App on device
  • How to Use this Starter
    • Taxi Booking Complete Setup
    • Taxi User App - Setup
    • Taxi Driver App - Setup
    • Taxi Admin App - Setup
    • Testing Complete Platform
  • Platform Features
    • User App
    • Driver App
    • Admin App
  • Firebase Setup
    • New Firebase Project Setup
    • Firebase Integration Into User App
  • Extra
    • App Specific Requirements
    • Add More Features
    • FAQs
    • Firebase Setup (Ionic 4 Version)
    • Firebase Functions (Ionic 4 version)
      • Overview
      • Firebase Function in Code
      • How to Deploy Firebase Functions
Powered by GitBook
On this page

Was this helpful?

  1. Extra
  2. Firebase Functions (Ionic 4 version)

Overview

PreviousFirebase Functions (Ionic 4 version)NextFirebase Function in Code

Last updated 5 years ago

Was this helpful?

This section is for the Ionic 4 version of this platform, where Firebase Functions were used to make the apps talk to each other. Ionic 5 version does not use Firebase Functions.

All three apps are connected to the Firebase back-end for most functionalities. But there are events when the apps need to talk to each other directly. E.g. When user books a ride, the Driver app needs to know. And when Driver app confirms the ride, the user app needs to know that immediately as well.

Normally, a server response is sent only when app requests it via an API call. But for the situations mentioned above, we can't keep calling APIs to expect a response at some point of time. In this situation we use a combination of Firebase real-time DB and Firebase functions.

For example, in above scenario - User books a ride , the following things will happen

  • User app will call a Firebase function (via an API). The firebase function will take user's location etc information and search for drivers from the available database. Yes, Firebase function will have access to the database

  • Once a suitable Driver is found, his app will be sent a notification via Firebase socket connection (or real-time DB you can say). Driver will see the alert on his app

  • When Driver accepts or rejects the ride, another Firebase function is called. This function writes the relevant information in DB, as well as, sends a real-time notification to User app. User app shows relevant alert if ride is cancelled, or a confirmation if the ride is confirmed

Similarly, when the ride is ended from Driver side, the User app is informed of this via real-time DB notification.

Please note, the DB notification, or the real-time socket connection is different from push notification. Push notifications can be received in closed apps as well, but DB information update will be received in open app only.

Also, if you want to implement a push notification feature for booking flow, you can follow our detailed tutorial for the same

Implement push notification in Ionic 4 apps