# Web App with Real-Time User Location Tracking

**URL:** https://community.appfarm.io/t/web-app-with-real-time-user-location-tracking/1217
**Category:** Ask the community
**Created:** [May 1, 2024, 5:54am UTC](https://community.appfarm.io/t/web-app-with-real-time-user-location-tracking/1217 "2024-05-01T05:54:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SigurdEileras](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/sigurdeileras/32/2621_2.png) [@SigurdEileras](https://community.appfarm.io/u/SigurdEileras)
#### Post date: [May 1, 2024, 5:54am UTC](https://community.appfarm.io/t/web-app-with-real-time-user-location-tracking/1217/1 "2024-05-01T05:54:12Z")

</div>

Hi,

I’m working on a use case for a client where much of the functionality relies on seeing other users’ locations in real time on a map.

The goal is for users to open the app and view a map displaying the current location of others, even if those users don’t have the app open. Is it possible to build functionality into a web app that retrieves device locations as a background job when users aren’t actively using the app?

An example: similar to Uber, I want users to see the live and updated location of all available cars and their booked car, but we cant assume that all the users I want to show on the map in real time are actively inside the web app.

(Assuming users have agreed to share their location, of course.)

Best regards,  
Sigurd

---

<div class="post-metadata">

### Author: ![Eirik](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/eirik/32/76_2.png) [@Eirik](https://community.appfarm.io/u/Eirik)
#### Post date: [May 6, 2024, 11:30am UTC](https://community.appfarm.io/t/web-app-with-real-time-user-location-tracking/1217/2 "2024-05-06T11:30:30Z")

</div>

Hi there!

Unfortunately, current web technologies for PWAs do not allow users’ geolocation to be tracked when the application is not open. This issue has been heavily discussed over the years, but there doesn’t seem to be much progress:

[ServiceWorker Issue #745](https://github.com/w3c/ServiceWorker/issues/745)  
[Geolocation Sensor Issue #22](https://github.com/w3c/geolocation-sensor/issues/22)

One possibility could be to wrap the web app as a native application, although this is unexplored territory from our side. For example, you can check out Natively: [Natively Documentation](https://docs.buildnatively.com/natively-platform/features/geolocation#how-to-set-up-background-location-tracking)

Best regards,  
Eirik

---

<div class="post-metadata">

### Author: ![SigurdEileras](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/sigurdeileras/32/2621_2.png) [@SigurdEileras](https://community.appfarm.io/u/SigurdEileras)
#### Post date: [May 6, 2024, 11:38am UTC](https://community.appfarm.io/t/web-app-with-real-time-user-location-tracking/1217/3 "2024-05-06T11:38:00Z")

</div>

Thank you for the reply! 🙂

To be honest, this makes me happy with regards to privacy and security — and makes me like PWAs even better.

Have a nice day 🙂
