40

Is it possible to read from local storage and track geolocation in PWAs with a service worker while app is not open on phone (in background)

So far my research is pointing to no, and I am finding that the PWA needs to be open for location services.

Thank you,

1 Answer 1

38

The solution is at hand and has been for some years now as this POC clearly testifies. Unfortunately W3C have fought tooth and nail to prevent it from being made available :-(

Why? I know not. The "cui bono" argument points to plug-in vendors such as Ionic whose whole raison d'etre appears to be background geolocation.

See this link for complete story.

Sign up to request clarification or add additional context in comments.

6 Comments

Thank you for the info, read a few things about this prior and was hoping there was more movement for it cause the articles that I read were older and PWA concept seems to be a fast changing landscape at this point.
If every installed service worker could track a person's movement wither the client page/app was open or not, that would be a serious privacy intrusion. You'd need a permissions flow before you could even think of doing that and you'd probably want app permissions to be visible from a device's permissions page.
Are there any news on this? I don't understand why this is such a big argument, specially with the line between PWA and native apps getting more and more blurry... I am developing a mountaineering PWA which is going to have to have background location recording pretty soon... If there is a still open Github issue on which I could make my voice heard I'd be happy to do so.
@McMurphy I would lika a clarification, do you mean that you can use Ionic in a PWA to get background geolocation? I have no experience with Ionic and I can't find that this is possible without building a native app in the documentation. Thanks in advance!
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.