【发布时间】:2020-02-12 05:37:08
【问题描述】:
在 PWA 中,我们可以通过 W3C 地理定位 API 获取设备的当前位置。 这很容易。
if (!navigator.geolocation) {
status.textContent = 'Geolocation is not supported by your browser';
} else {
status.textContent = 'Locating…';
navigator.geolocation.getCurrentPosition(success, error);
}
但是,在 Android 中,W3C 位置 API 会受到用户模拟位置设置的影响。 因此用户可以轻松地欺骗当前位置。
有什么方法可以防止 PWA 中的模拟位置设置?
【问题讨论】:
-
你好,我和你有同样的问题,你找到解决办法了吗?
-
我有机器学习的基本想法,并确定合法和虚假 GPS 采集数据之间的行为差异,并希望在未来进行开发。但是,我的这项活动不是我的日常工作,而是一种休闲爱好,所以我没有关于何时解决它的路线图。
标签: android geolocation progressive-web-apps mock-location