Open exp-gokul opened 8 years ago
Tried getCurrentPosition and watchPosition
document.addEventListener('deviceready', function() { // Android customization cordova.plugins.backgroundMode.setDefaults({ text: 'Doing heavy tasks.' }); // Enable background mode cordova.plugins.backgroundMode.enable(); // Called when background mode has been activated cordova.plugins.backgroundMode.onactivate = function() { setTimeout(function() { cordovaGeolocationService.getCurrentPosition(function(position) { console.log("position inside take geolocations : ", position); var currentPosition = position; var latitude = currentPosition.coords.latitude; var longitude = currentPosition.coords.longitude; var string = 'lat:' + latitude + ':long' + longitude; // Modify the currently displayed notification cordova.plugins.backgroundMode.configure({ text: string }); }, function errHandler(err) { console.log("error :", err); }); }, 5000); } }, false);
Tried getCurrentPosition and watchPosition