# Overview

{% hint style="warning" %}
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.
{% endhint %}

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.&#x20;

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.&#x20;

{% hint style="info" %}
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.
{% endhint %}

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](https://enappd.com/blog/implement-ionic-4-firebase-push/34)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enappd.gitbook.io/ionic-taxi-booking-app-starter/extra/firebase-functions/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
