Skip to main content

Overview

The location sharing feature allows passengers and drivers to share their real-time location during active trips. This enables:
  • Passengers to see driver’s approaching location
  • Drivers to navigate to passenger pickup location
  • Real-time trip tracking for safety

Location Sharing URL

The location sharing module is available at:
Configuration:

Generate Sharing Token

The exact endpoint for generating location sharing tokens depends on your backend implementation. Typically, this would be part of the trip creation or assignment process.

Sharing Token Structure


Update Driver Location

Update the driver’s real-time location during an active trip.

Request Body

integer
required
Driver ID
number
required
Current latitude
number
required
Current longitude

Request Example

Dart

Location Tracking Best Practices

Update Frequency

Don’t update location too frequently to avoid:
  • Excessive battery drain
  • High network usage
  • Server overload
Recommended settings:
  • Distance filter: 10-20 meters
  • Time interval: 5-10 seconds
  • Accuracy: High (for active trips)

Battery Optimization


Real-Time Location Display

Passenger View (Track Driver)


Generate a shareable link for real-time location tracking:

Privacy and Security

Privacy Considerations:
  • Location data should only be shared during active trips
  • Share tokens should expire after trip completion
  • Implement rate limiting to prevent abuse
  • Allow users to stop sharing at any time

Token Expiration


WebSocket Integration (Future)

For real-time updates with lower latency, consider implementing WebSocket support:

Error Handling

See Also