Hello, I am using this code to get gps coordinates every 3 sec. it works as i need.
but some times navigator.geolocation.getCurrentPosition stop working. I am using my app, everything is good, i close my app. 2-3 hours left, I open, my app again and can not get coordinates. Also open browser chrome or native browser and go http://www.w3schools.com/html/html5_g... to check coordinates, and it does not work too! it can not get my coordinates. only full reboot of phone helps me, and after that it works again very well.
I am using plugin.
What can be the reason geolocation crashes after my app ? the problem not very often, but sometimes happen.
function currentLocation(){
navigator.geolocation.getCurrentPosition(successLocation, errorLocation, {enableHighAccuracy: true, timeout: 10000, maximumAge: 0});
}
var successLocation = function(position){
localStorage.setItem('Lat', position.coords.latitude);
localStorage.setItem('Lon', position.coords.longitude);
};
var errorLocation = function(position){
console.log('errorLocation');
};
setInterval(currentLocation, 3000);
but some times navigator.geolocation.getCurrentPosition stop working. I am using my app, everything is good, i close my app. 2-3 hours left, I open, my app again and can not get coordinates. Also open browser chrome or native browser and go http://www.w3schools.com/html/html5_g... to check coordinates, and it does not work too! it can not get my coordinates. only full reboot of phone helps me, and after that it works again very well.
I am using plugin.
What can be the reason geolocation crashes after my app ? the problem not very often, but sometimes happen.
function currentLocation(){
navigator.geolocation.getCurrentPosition(successLocation, errorLocation, {enableHighAccuracy: true, timeout: 10000, maximumAge: 0});
}
var successLocation = function(position){
localStorage.setItem('Lat', position.coords.latitude);
localStorage.setItem('Lon', position.coords.longitude);
};
var errorLocation = function(position){
console.log('errorLocation');
};
setInterval(currentLocation, 3000);



