Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70757

How to update the user's location when the app runs in background?

$
0
0

@ioclaudio wrote:

Hi,
I’m using the Geolocation plugin to watch the position of the user.
This is the code I’m using:

this.geolocation.watchPosition(geo_options)
.subscribe(position => {
  this.currentLatitude = position.coords.latitude;
  this.currentLongitude = position.coords.longitude;
  this.currentAltitude = position.coords.altitude;
  this.currentHeading = position.coords.heading;
  this.currentSpeed = position.coords.speed;
}, err => {
	console.log('@@@ERR-watchPosition:', err);
});

It seems that the position is not updated when the app is not in foreground.
Is there a way to update the user’s location when the app is not in foreground that works for both Android and iOS?

Thank you very much

Claudio

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70757

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>