---
description: This app contains the Driver functionality of the platform
---

# Driver App

This Taxi driver app for taxi booking platform is made to provide a great app UI for your own Driver app for taxi booking. Now you can start your own Taxi driver app with these functionalities. This is a great starting point for app development, as more than half the work is done here. All pages and components are set. Hence, all you need here is to integrate your back-end and feed in the data. This app has many features common with popular apps like [Uber](https://play.google.com/store/apps/details?id=com.ubercab\&hl=en_IN), [Ola](https://play.google.com/store/apps/details?id=com.olacabs.customer\&hl=en_IN) etc.‌

## Vehicle tracking location

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsRXD8WxHHliDH_Y2q%2Flocalhost_8100_slides\(iPhone%20X\)%20\(9\).png?alt=media\&token=8581cd47-9ac5-4aa5-b40e-9391291e55f9)

This page does tracking of driver and send location to firebase.‌ Note, this is not a real-time tracking

## Driver offline/Online feature

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsRTklbT0RWha4bg8p%2Flocalhost_8100_slides\(iPhone%20X\)%20\(7\).png?alt=media\&token=4e2b3ad6-3875-45dd-9f73-06c4e5b449bb)

Driver can change his status from Offline to Online and vice-versa by the toggle in header and change the status in firebase.‌

## Ride history page with details of past rides

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsReG0BSbhXcJlkYj7%2Flocalhost_8100_slides\(iPhone%20X\)%20\(15\).png?alt=media\&token=7bb1f670-056d-4b07-a75b-ded94382667b)

It will show the Driver ride history with days and price and it will get data from firebase.‌

## Add Payment/card page

‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsRmWlV8N0XxyrR0fA%2Flocalhost_8100_slides\(iPhone%20X\)%20\(13\).png?alt=media\&token=03858d5c-3bd0-4f2e-adf2-941386d0f821)

In this Page driver can add the payment card.‌

## Login/Sign up page

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsRtOtDLNYOtpQn7Ha%2Flocalhost_8100_slides\(iPhone%20X\)%20\(4\).png?alt=media\&token=e5211dbe-9799-47e7-8afd-0247e0a689ab)

This page will check the authentication of driver from firbase.‌

## OTP Verification page

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsRwpt-ap9cmiY21KW%2Flocalhost_8100_slides\(iPhone%20X\)%20\(6\).png?alt=media\&token=4bd23335-fe9c-4d09-9368-c190c0d92ce5)

This page will verify the driver OTP which comes on his mobile number.‌

## Add vehicle page with vehicle list

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsS2t8ZNfYVFr1VLXS%2Flocalhost_8100_slides\(iPhone%20X\)%20\(24\).png?alt=media\&token=99f5fd54-c5f7-41ab-8b68-58da2e55e3f4)

In this page driver can add his vehicle‌

## Wallet page&#x20;

with multiple payment methods option

‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsS7iGP0hEPCnT5Qcr%2Flocalhost_8100_slides\(iPhone%20X\)%20\(12\).png?alt=media\&token=cb754e35-6596-4ba8-a5d8-905d69f37e31)

## Document Mangement page‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsSCftDbQlaMSYVKfv%2Flocalhost_8100_slides\(iPhone%20X\)%20\(26\).png?alt=media\&token=425bc2d0-a440-41a3-8c0c-5d5c07ee0a48)

This page shows the driver Documents.‌

## Notification page

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsSGDdjj8CJFb9EDtP%2Flocalhost_8100_slides\(iPhone%20X\)%20\(17\).png?alt=media\&token=03a5f465-0f76-432a-9e02-78395044426e)

This page show the notification when driver get ride, offers or etc.‌

## Profile Update page‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsSLIG0F0ynHUEF07a%2Flocalhost_8100_profile\(iPhone%20X\)%2026.png?alt=media\&token=1a8e94c5-ada4-438a-9783-b33aaa064cd3)

Driver can edit profile and it will update on firebase.‌

## User Request page‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsSQ8VKieQQbL0rbfH%2Flocalhost_8100_slides\(iPhone%20X\)%20\(11\).png?alt=media\&token=685810d1-649c-43af-906c-6a307328bf67)

This page show the total current requests of user and driver can pick any one of them.‌&#x20;

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

## Customer Details page

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsSlCONsUNaRl0VnK1%2Flocalhost_8100_slides\(iPhone%20X\)25.png?alt=media\&token=99cd3ce0-4fd4-489a-972c-157514a0ab80)

After accept the request driver can see the detail of customer and driver can call,Message and cancel the user request‌

## Chat/Message/Call feature page

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsSp4P9JgWR8Vc_snb%2Flocalhost_8100_slides\(iPhone%20X\)29.png?alt=media\&token=839f69da-04b8-495c-838d-6cafdd549b83)

Driver can chat with user directly‌

## Invite your friend page

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsT3XH7JJjlBoNhRGn%2Flocalhost_8100_slides\(iPhone%20X\)%20\(19\).png?alt=media\&token=567af6b2-6836-48bd-bd5f-91333ea4b148)

It will help to invite other user‌

* Invite sharing with SocialShare plugin

‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-LdsL1BFJQabgRq7EN9i%2F-LdsXceJmfJvafYqcguv%2Flocalhost_8100_slides\(iPhone%20X\)%20\(20\).png?alt=media\&token=b46058d3-9cd1-457c-a922-f8999b8ad443)

This page does the driver contact list which is use to share the invite code of driver‌

## Code Structure <a href="#code-structure" id="code-structure"></a>

Driver app Code Structure‌

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-Ldmyc0iaFQevF6V4nTx%2F-Ldn1JJhMVE_B8UKl3tP%2F2019-05-01_16h25_19.png?alt=media\&token=6f287a7b-0ba0-4934-99dc-3127665747c3)

The `src/app/pages` folder contains the code related to‌

* Login - Email login
* Signup - Email signup
* Home - Online & offline feature
* Location - Get Driver Current Location
* Profile - Edit Driver Profile
* Customer -Request - Ride requests show
* History - Show Previous Rides

‌

These files use service data and functions provided in `src/app/`‌

* `auth.service.ts` - For Authentication functions
* `driver-status.service.ts` - For Driver status purpose
* `firestore.services.ts` - For CRUD functions

‌

## Plugins&#x20;

* **Camera**

{% hint style="info" %}
You can find more details on Camera integration in Ionic 4 App in [our tutorial here](https://enappd.com/blog/image-picker-in-ionic-4-app/67)
{% endhint %}

We have written this code for access the camera in user device.

```
async openCamera() {
      const options: CameraOptions = {
        quality: 100,
        destinationType: this.camera.DestinationType.FILE_URI,
        encodingType: this.camera.EncodingType.JPEG,
        mediaType: this.camera.MediaType.PICTURE
      }
  
    await this.camera.getPicture(options).then((imageData) => {
      const base64Image = 'data:image/jpeg;base64,' + imageData;
      this.photos.push(base64Image)
      }, (err) => {
        // Handle error
        console.log(err)
      });
    }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/native/camera)

* **Geolocation**

{% hint style="info" %}
You can find more details on Geolocation integration in Ionic 4 App in [our tutorial here](https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45)
{% endhint %}

We have written this code for getting driver Current location

```
public getcurrentLocations() {
    this.geolocation
      .getCurrentPosition()
      .then(resp => {
        this.lat = resp.coords.latitude;
        this.lng = resp.coords.longitude;
        const obj = {};
        obj['lat'] = this.lat;
        obj['lng'] = this.lng;
        this.locationOrigin = obj;
        const uid = this.userId.uid;
        this.fire.updateData(obj, uid);
      })
      .catch(err => {
        console.error('Error getting location', err);
      });
  }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/enterprise/geolocation)

* **In-app-browser**

&#x20;We have written this code for open external browser in our app

```
openUrl(url) {
    const browser = this.iab.create(url);
    browser.show()
  }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/enterprise/inappbrowser)

* **Background Geolocation**

We have written this code for Continue update the driver Current location

```
geoLocations() {
    this.backgroundGeolocation
      .configure(config)
      .then((location: BackgroundGeolocationResponse) => {
        console.log('location', location);
        this.backgroundGeolocation.finish(); // FOR IOS ONLY
      });
  }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/native/background-geolocation)

* **Social-sharing**

We have written this code for Share your content on user social media.

```
shareAlert() {
    this.socialSharing.share();
  }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/native/social-sharing)

* **Launch-navigator**&#x20;

We have written this code for Open Google Map Navigation in user device

```
 getnavigations() {
    console.log('navigations')
    const options: LaunchNavigatorOptions = {
      start: 'London, ON',
      app: this.launchNavigator.APP.GOOGLE_MAPS,
    }

    this.launchNavigator.navigate('Toronto, ON', options)
      .then(
        success => console.log('Launched navigator', success),
        error => console.log('Error launching navigator', error)
      );
  }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/native/launch-navigator)

* **Call-number**

We have written this code for open the call window in Driver device.

```
userCall() {
    this.callNumber.callNumber('18001010101', true)
      .then(res => console.log('Launched dialer!', res))
      .catch(err => console.log('Error launching dialer', err));
  }
```

For More Information about this plugin check out [this link](https://ionicframework.com/docs/native/call-number)

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LdmV17nYtICLrl3bl_d%2F-Ldmyc0iaFQevF6V4nTx%2F-LdnHgXvEFcWmJhX87RS%2FiondriverLayers.jpg?alt=media\&token=d91cd683-acd0-47b6-bd66-1af849782928)
