In PWA, we can get device's current position with W3C geolocation API. It is easy.
if (!navigator.geolocation) {
status.textContent = 'Geolocation is not supported by your browser';
} else {
status.textContent = 'Locating…';
navigator.geolocation.getCurrentPosition(success, error);
}
But, in Android, W3C location API is affected by user's mock location setting. So user easily able to spoof there current position.
Are there any way to prevent mock location setting in PWA?
check mock location using this condition: