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)

Firebase Function in Code

PreviousOverviewNextHow to Deploy Firebase Functions

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.

Firebase Functions in Code

In the source code, Firebase functions are located in the User app in the functions folder

There are five Firebase functions in-built currently

  • getDriver - This function is called when User books a ride. This function finds a suitable driver and responds to User app, writes appropriate Data to customer and driver tables. Note, for demo purpose, the functions currently only looks for the driver who is logged in with the demo login (i.e. admin@enappd.com). You can change the logic here.

  • acceptRide - This function is called when Driver accepts an incoming ride request. This function writes appropriate info to customers table and gives back response to Driver app. User app receives a signal that driver has accepted. After this functions completion, driver can not accept new ride, and customer can not book new ride until ride is completed.

  • rejectRide - This function is called when Driver rejects an incoming ride request. This function writes appropriate info to customers table and gives back response to Driver app. User app receives a signal that driver has rejected. After this functions completion, driver can accept new ride, and customer can book new ride.

  • driverNoRespond - This function is called when Driver does not respond to an incoming ride request for a limited amount of time. This function writes appropriate info to customers and drivers table and gives back response to Driver app. User app receives a signal that driver is not responding. After this functions completion, driver can accept new ride, and customer can book new ride.

  • completeRide - This function is called when the Driver completes ride at destination. This function writes appropriate information to customers and drivers table. After this functions completion, driver can accept new ride, and customer can book new ride.