2

I am developing a fitness-related web app that needs to track a user's geolocation in the background (with the user's permission, of course) in order to suggest recommendations.

Since no browser has currently implemented Geolocation Sensor API and the current Geolocation API doesn't support background tracking, I am trying to find workarounds.

Is there a way to implement it with any other method?

An alternate can be to collect geolocation using Service Worker, save it in the queue when the phone is locked and send it all at once when the user visits the website. Does anyone have a use case for using Service Worker in this manner?

All other methods look like a dead-end and using Service Worker is a shot in the dark. Open to novel ideas.

1 Answers1

3

Build a simple native app with GPS background capability and stream position updates to the webapp, then use either a service worker or setinterval to pull the updates.

user265505
  • 409
  • 6
  • 21