The Question
How can I track a user's movements via ESRI's JavaScript API in a web browser when their phone is shut/locked?
This would ideally work for all web browsers (i.e. Android and Apple versions of Chrome, Firefox etc..). However, any platform specific suggestions would also be very welcome.
What I've tried
I've thought about playing a video on loop (hidden) on the maps page so the phone doesn't automatically lock, keeping the browser open. However, this would potentially be a huge waste of battery for users and false clicks may get recorded while in the user's pocket so I'd like to avoid this solution if possible.
Some more context:
I'm developing a charity webapp for a community group trying to track their movements when out on patrols which can last between 30 mins and a couple of hours.
The tracking should work similarly to strava and should record their movements at regular intervals (I've decided on every 10 secs but this is somewhat arbitrary).
I've already written the majority of the app including the backend/database code and deployment scripts so I really wouldn't want to start again creating a stand-alone Android and iOS app.