Attach request body with sync url while getting the background geolocations


#1

Here is my code to send locations to my server.

config: BackgroundGeolocationConfig = {
desiredAccuracy: 0,
stationaryRadius: 20,
distanceFilter: 10,
activityType: “AutomotiveNavigation”,
pauseLocationUpdates: false,
saveBatteryOnBackground: false,
debug: true,
interval: 2000, // Android Only
url: “http://server_path/locations.jsp?deviceId=” + this.user._userDevice+"&batteryLevel="+this.BatteryLevel,
syncUrl: “http://server_path/cd/locations.jsp?deviceId=” + this.user._userDevice+"&batteryLevel="+this.BatteryLevel,
syncThreshold: 1,
maxLocations: 10000,
stopOnTerminate: false
};

this.backgroundGeolocation.configure(this.config).subscribe((location: BackgroundGeolocationResponse) => {

console.log('BackgroundGeolocation: ’ + location.latitude + ‘,’ + location.longitude);
console.log(‘interval is -’ + this.config.interval);
console.log(JSON.stringify(location));

});

How can i add my custom request body with config url of background geolocation url
Please provide me the solution ASAP, Thanks in Advance !!!