Web App with Real-Time User Location Tracking

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

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
Geolocation Sensor Issue #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

Best regards,
Eirik

Thank you for the reply! :slight_smile:

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

Have a nice day :slight_smile:

3 Likes