'Continuos location tracking in web application

I have been researching the ability to make a sportstracker (continous GPS tracking) as a web-app/PWA, but this still seems impossible.

I have made one that somehow works, by using the Wake Lock API which works on Android, not iOS, but it still seem flaky and does turn off the screen ocasionally and javascript and tracking stop.

A web worker does not allow GPS tracking as far as I can tell.

I am totally fine with user consent and icons, bells and whistles that tells the user that tracking is going on. And battery drain should not be a bigger issue than it is on native apps for this use case.

Is there any way around this in 2022?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source