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

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

.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 has a great plugin. There is a license fee for Android. Great support and updates. Well worth the money!