Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It is possible to watch the location in the background on Mobile (iOS / Android)?

With watch I mean using HTML5's native Geolocation watch support. This is meant for a web app, not a native one. Thanks for helping out :D

like image 777
Niels Avatar asked Nov 25 '15 20:11

Niels


People also ask

How can get background location in Android?

Background location access checklist Use the following checklist to identify potential location access logic in the background: In your app's manifest, check for the ACCESS_COARSE_LOCATION permission and the ACCESS_FINE_LOCATION permission. Verify that your app requires these location permissions.

What is background location on Iphone?

Background location useIf you give an app permission to access your location while it's in use, the app can then ask to know where you are at all times.

What does it mean when an app uses your location in the background?

Access to location is considered in the foreground if it happens while the app is open and visible to the user. If the user closes the app, or hits the home button to return to their main screen, then the app's access to location is considered in the background.

How can I set my background location?

In order to enable background location access, users must set the Allow all the time option for your app's location permission on a settings page, as described in the guide on how to Request background location.


2 Answers

You cannot watch the user's location from a Web App in background. I have checked it on Chrome (Android M), and as soon as the Web App goes to background the GPS icon disappears and the watch position process is stopped. (Once the Web App is in the foreground again, the watch process is resumed).

The same is happening when the device is locked. The watch process is stopped until the user unlocks it and the Web App is in the foreground.

like image 58
sergi Avatar answered Sep 22 '22 23:09

sergi


UPDATE 2021-04

There is a new API in discussion, "Geotracking", that will allow for background tracking. The issue needs votes, though. If you are interested in doing so, go here: https://bugs.chromium.org/p/chromium/issues/detail?id=898536

like image 39
Robert Wildling Avatar answered Sep 21 '22 23:09

Robert Wildling