W3C home > Mailing lists > Public > public-device-apis-log@w3.org > April 2021

Re: [geolocation-sensor] Support geolocation (especially geofencing) in the "background" (#22)

From: Carlos Lopez via GitHub <sysbot+gh@w3.org>
Date: Wed, 14 Apr 2021 20:49:16 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-819822318-1618433354-sysbot+gh@w3.org>
We track vehicles live. Think emergency vehicles, delivery, transport services, courier, etc. When a driver arrives at a location, we would like the application to notify the driver. When a driver doesn't reach his location a remote dispatcher would like to query where the driver is.

Everything works 100% fine when the PWA is in the foreground. But the moment a driver decides to use a third-party navigation application (eg: Google Maps, Waze, Apple Maps), all geolocation services stop. On Android Chrome, we can still send audio at times, but if memory pressured, it's gone and the user has no idea.

I present this because we "cheat" with background audio support. Because PWAs essentially have two states in Android Chrome: "foreground" and "background". iOS is more like "Running" or "Paused". Nothing happens when iOS goes to the background. This seems like user agent quirks.

I don't see a strong use case, personally, for background tracking of geolocation with just a service worker. But a somewhat persistent state of a PWA could be useful. In this third state (background but persistent), I feel geolocation should be allowed. I feel like trying to just open *any* service worker to collect geolocation could invoke some battery and security concerns. Of course, a new permission dialog might be enough.

I'm not sure if my use case falls into this. Maybe it's a better distinction as to what "background" means. I know JavaScript will continue to run while the window loses focus.

GitHub Notification of comment by clshortfuse
Please view or discuss this issue at https://github.com/w3c/geolocation-sensor/issues/22#issuecomment-819822318 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 14 April 2021 20:49:17 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:58 UTC