Hi, I’d like to tell you a quick story about my question, as I’m just wondering why is it so.
I’ve made a basic tracking app including backgroundGeolocation and I then POST all the location details to a FQDN website using HttpClient. It’s working fine and seems to be accurate enough.
Tonight I went for a walk about my town lake, and the tracking facility worked fine, for about half of my trip around the lake.
I know this, because I came home, looked at the server part and saw the tracks on the map of where I had gone - but only half of the track.
So, I opened the app, and then, it proceed to uploaded the rest of the tracks, and voila, the rest of the track appeared on my server.
My question is related to HttpClient, and what the timeout is, or if the app just keeps the data in an infinite holding pattern until it gets suitable reception and can then upload the data?
It was just weird behaviour, and i don’t think it is related to background/foreground geolocation.
I’m doing nothing special with the upload code. Should I be running a timeout, or just doing it this way?
Is the built-in Post method better? I think this way that I’m currently doing I’ve got (seemingly) more control over things.
I’m just after a why, or is it the best practice.
Thanks.
this.httpClient.post(URLlink, trackJSONdata)
.subscribe(data => {
this.data.response = data["_body"];
not-exist-on-type-response
}, error => {
console.log("Oooops!");
});