w3c / geolocation-sensor

Geolocation Sensor
https://www.w3.org/TR/geolocation-sensor/
Other
59 stars 21 forks source link

Support geolocation (especially geofencing) in the "background" #22

Open kenchris opened 6 years ago

kenchris commented 6 years ago

Background here meaning out living the document and service worker lives.

https://github.com/WICG/background-fetch/issues/82

adamjimenez commented 3 months ago

We operate a food delivery platform and use background tracking to monitor driver activity without excessive battery usage. Our stack is predominately web-based but is complicated by the fact that we need to use an app platform in order to access native API's for background tracking. This has added unneccesary costs and complexity to our codebase. There is so much the web platform can access from push messages to bluettoth but background tracking seems like a crucial oversight. User privacy is clearly the main concern but this can be solved using a combination of browser permissions and notifications.

Lucho-git commented 1 month ago

I operate a Farming vehicle tracking service, which uploads the operators vehicles location and trail path as they move around the paddock. This coordinates all of the farmers and allows them to see the overall picture of everyone who's working.

It's very frustrating that the location can't be set to update in the background while it's moving around the paddock. I build the entire thing as a PWA without realising this and might need to move to a dedicated app which I don't have time to implement on both IOS and Android as the sole developer.

sedubois commented 1 month ago

We had the case of a client who wanted to build an app where users could track their movement while using a hot air balloon. This data would be gathered so that they get a history of all their flights and can optionally compare this with other balloons in the area. The location data to be collected would be not only the latitude and longitude but ideally also the accuracy, altitude, heading and speed (to the extent that these are available from the device sensors). After building a PWA proof of concept, we were forced to conclude that this would require building a native app, as such data could be obtained through the navigator.geolocation API but only while the web page is in the foreground, and we cannot expect users of the balloons to constantly keep their app open and visible on screen in order to ensure that their movement gets tracked reliably throughout their flight.

What would be needed on the web from a user's point of view is what native apps allow: initially ask the user for the permission to collect and process their location data both while the app is in foreground and in the background, then let the user remove this permission at any time through some system setting.