Help for owners
I want customers to see a driver or order moving on a map
Short answer
Live tracking has four parts: the phone sends its location, a server receives it, the other person's screen updates, and a map shows it. The hard part is background location, which both phone platforms limit and Google Play reviews. Decide who is tracked and when, and tell them clearly.
Does this sound like your situation?
- I run deliveries or rides and customers ask where the driver is.
- Location stops updating when the driver's screen is off.
- The tracking is jumpy or late.
- The store asked me about background location.
- I am worried about the battery and about privacy.
Why does this happen?
Background location is restricted
Android's documentation says an app in the background on Android 8.0 and higher can receive location updates only a few times each hour, and that background access should be critical to the core function.
Confirmed by developer.android.com
Google Play reviews background location
Google Play states that background location should be requested only when central to the app's purpose, with a declaration form and a prominent in-app disclosure shown before the permission prompt.
Confirmed by support.google.com
Real-time needs a live connection
The server must push updates to the viewer instead of waiting for the screen to refresh, and some hosting setups close long connections.
Technical detail: WebSockets behind nginx drop when the connection is idle
Accuracy and battery pull apart
More frequent and precise updates use more battery, so the design has to balance them.
Technical detail: The browser cannot open the WebSocket: connection refused
What can I do about it today?
- Decide who is tracked and whenFor example a driver only during an active job. Avoid tracking when it is not needed.
- Write the privacy wordingTell people what is collected, why and for how long. Speak to a lawyer or your privacy regulator about your duties.
- Plan the map choiceMap providers have their own terms and billing. Pick one and read its terms.
- Test on real phonesAsk a driver to try it with the screen off, in a car, in a weak signal area.
- Prepare for the store reviewHave a short video and text ready showing why background location is needed.
When should I bring someone in?
- Drivers' phones stop reporting when the app is in the background.
- The store has rejected the app over location.
- You will track employees or children, where legal rules may apply. Speak to a lawyer.
How do I handle it?
- Design the update rhythmI choose how often location is sent and how it behaves when the signal drops.
- Build the server and the live feedA small server receives positions and pushes them to the viewer's screen.
- Handle background and permissionsThe app asks for permission in the way the stores require and explains it first.
- Test the battery and the bad casesLong trips, tunnels and phone restarts are tried on real devices.
- Prepare the store submissionThe disclosure, declaration and video are written to match what the app does.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Can the map update every second?
Not reliably in the background. Android documents that background apps get location only a few times an hour on Android 8.0 and higher, so the design depends on when the app is in use.
Will the store approve background location?
The decision is the store's. Google Play states it reviews whether background location is essential to the core feature.
Is tracking people legal?
That depends on where you are and who you track. Speak to a lawyer or your regulator.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.
For your developer: the technical fixes
WebSocket closes with code 1006 after roughly 60 seconds of no messagesWebSockets behind nginx drop when the connection is idleWebSocket connection to 'ws://localhost:8080/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSEDThe browser cannot open the WebSocket: connection refusedPlay Console blocks submitting a release whose app bundle targets an API level below 36Play Console will not accept the release because of its target API level