Skip to main content

Driver App for the Food Delivery App

The driver experience lets delivery workers go online, receive dispatches, accept or reject orders, update delivery status, and provide location data for customer tracking.

Quick Answer

Create a user from the app, set that user document to role: "driver", add the vehicle and location fields expected by your package, deploy the delivery dispatch Functions, then place a test order and verify the driver receives it.

1. Create a Driver User

  1. Sign up from the app with the driver account.
  2. Open Firebase Console > Firestore Database.
  3. Find the user document.
  4. Add or update driver fields.

Example:

{
role: 'driver',
carName: 'Toyota Prius',
carPictureURL: 'https://example.com/car.png',
active: true
}

Exact fields can vary by package version. Search the source for driver requirements:

rg "driver|carName|carPicture|active|location|delivery" src firebase

2. Confirm Location Setup

Driver dispatch and tracking may require:

  • location permissions;
  • current latitude/longitude fields;
  • online/offline status;
  • background location behavior, if supported by the app;
  • map provider configuration.

Do not enable aggressive background location collection unless your privacy policy and store disclosures explain why it is needed.

3. Deploy Dispatch Functions

If the app package includes delivery Functions, deploy them before testing real dispatch:

cd firebase
firebase use --add
firebase deploy --only functions

See:

4. Test Driver Flow

  1. Sign in as a driver.
  2. Set the driver online if the app has an online/offline control.
  3. Sign in as a customer and place an order.
  4. Sign in as a restaurant owner and accept the order.
  5. Confirm the order is dispatched to the driver.
  6. Accept the delivery.
  7. Update pickup and delivered statuses.
  8. Confirm the customer tracking screen updates.

Verification Checklist

  • Driver user has role: "driver".
  • Required vehicle fields are present.
  • Required location fields are present or can be written by the app.
  • Dispatch Functions are deployed.
  • Firestore rules allow the driver to update only allowed delivery fields.
  • Customer tracking updates when driver status changes.

Troubleshooting

ProblemFix
Driver still sees customer screensSign out/in again and check the role field.
Driver gets no ordersCheck driver availability, location fields, restaurant acceptance, and dispatch Function logs.
Location does not updateCheck native permissions, simulator/device settings, and map/location module setup.
Driver can update unrelated ordersTighten Firestore rules before production.
Dispatch works locally but not productionCheck Firebase Functions region, billing, and deployed code.

Next Steps