是否可以在 PWA 未打开时使用 Service Worker 跟踪地理位置 [英] Is it possible to track geolocation with a service worker while PWA is not open

查看:28
本文介绍了是否可以在 PWA 未打开时使用 Service Worker 跟踪地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序未在手机上打开时(在后台),是否可以使用 Service Worker 从本地存储读取并跟踪 PWA 中的地理位置

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)

到目前为止,我的研究表明没有,而且我发现 PWA 需要为定位服务开放.

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

谢谢,

推荐答案

解决方案就在眼前,并且已经存在好几年了,因为这个 POC 清楚地证明了这一点.不幸的是,W3C 和 Jake Archibald 等游说者竭尽全力阻止它被提供:-(

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

为什么?我不知道.cui bono"论点指向插件供应商,例如 Ionic,其整个存在的理由似乎是背景地理定位.

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.

这篇关于是否可以在 PWA 未打开时使用 Service Worker 跟踪地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆