Skip to content

[Feature] Live ephemeral location updates (cross-platform with roadflare-ios) #76

@variablefate

Description

@variablefate

Goal

Driver-app side of cross-platform live ephemeral location streaming. Companion to variablefate/roadflare-ios#81 — the iOS side of the same feature. Both should be designed and shipped together, not sequentially.

In short: replace or augment the current periodic Kind 30012 location updates with sub-second/few-second ephemeral streaming during an active ride, so rider and driver see each other's positions in real time without persisted relay storage.

Why it matters

Same as the iOS issue: the periodic Kind 30012 cadence makes "driver has arrived" feel disconnected from the driver's actual on-map position. Riders expect ride-app-grade live tracking. Driver also benefits — knowing if the rider walks to a different pickup spot.

Driver-app-specific concerns

This issue captures the Drivestr Android side specifically. The shared design questions live in the iOS issue; items below are Android-flavored:

  1. Foreground-service requirement. Continuous high-accuracy GPS on Android requires a foreground service with a persistent notification. Current Drivestr already has one for active rides — extend its location-update cadence and message rather than adding a parallel service.
  2. Battery profile. Android's FusedLocationProviderClient with Priority.HIGH_ACCURACY and a 1-2s interval is the obvious starting point. Need to validate battery drain on a real device across a 30-min ride.
  3. Doze mode / app standby. Verify that the active-ride foreground service exempts the app from Doze restrictions during the ride. Otherwise samples get throttled.
  4. Permission flow. Driver already grants location for the existing pipeline; verify background location (ACCESS_BACKGROUND_LOCATION) permission gate doesn't bite for the new stream.

Cross-platform contract

Both apps consume the same shared protocol contract. Ideally implemented in shared logic — though that's gated on variablefate/roadflare-ios#30 (KMP exploration). Until KMP lands, both apps reimplement the wire format independently against a shared spec doc.

Suggested approach:

  1. Co-author a spec doc with the iOS side covering protocol design — kind, payload shape, encryption (NIP-44?), cadence, lifecycle, ephemeral guarantees against relay archival behavior. Should live somewhere both repos can reach (this repo's docs/specs/ is fine; cross-link from the iOS repo).
  2. Implement sender + receiver — Drivestr publishes its own location, subscribes to the rider's pickup-point updates. Mirror on iOS.
  3. Lifecycle hooks to the existing ride state machine — start streaming at enRoute, stop at completed/cancelled. Should not stream outside an active ride session.
  4. Map rendering — smooth interpolation between samples on the driver's map view of the rider's pickup pin (and vice versa).

Priority

P3 — major feature, future enhancement. Coordinate scheduling with the iOS team so neither side ships ahead of the other (one-sided live tracking is worse than no live tracking — it creates an asymmetric expectation).

Companion

iOS-side issue: variablefate/roadflare-ios#81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions