transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
656 stars 277 forks source link

Unable to get location at specified interval or distance while re launch the app again #1452

Open kmanikandan8122 opened 3 weeks ago

kmanikandan8122 commented 3 weeks ago

Your Environment

Plugin version:4.16.5

Platform: :Android

OS version:Android 14

Device manufacturer / model:Vivo

Cordova version (cordova -v):12.0.0 (cordova-lib@12.0.1)

Cordova platform version (cordova platform ls):

Installed platforms: android 10.1.2 ios 6.3.0 Available platforms: browser electron PASTE_YOUR_CODE_HERE backgroundgeolocationupdate(){ BackgroundGeolocation.ready({ distanceFilter:0,

  stopOnTerminate: true,
  logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
  debug: true,
  locationUpdateInterval:30000

}, (state) => {
  console.log("- BackgroundGeolocation is ready: ", state);

  if (!state.enabled) {

    BackgroundGeolocation.start( ()=>{

      console.log("- Start success");

      BackgroundGeolocation.changePace(true);

BackgroundGeolocation.onLocation (location => { console.log("[Location -manual movement changes] ", location);

console.log("send gps call")
       this.sendgps();
console.log("send gps called")

console.log(location.is_moving)

});
BackgroundGeolocation.onMotionChange(event => { console.log("[motionchange] ", event);

});

BackgroundGeolocation.onHttp(response => { console.log("[http] ", response); });

BackgroundGeolocation.onActivityChange(activityEvent => { console.log("[activitychange] ", activityEvent); });

BackgroundGeolocation.onProviderChange(providerEvent => { console.log("[providerchange] ", providerEvent); });

const subscription = BackgroundGeolocation.onHeartbeat((event) => { console.log("[onHeartbeat] ", event);

BackgroundGeolocation.getCurrentPosition({ samples: 1, persist: true }).then((location) => { console.log("[getCurrentPosition] ", location); }); }) }); } else { console.log('enabled'); }

});

}

Expected Behavior

I need to get background geo location when app running in foreground or background every 30 mins or 1 km distance movement

Actual Behavior

When i call the method backgroundgeolocationupdate() it works properly and i can able to get the location update properly by onlocation() but after closed the app from background again i opened then i called the backgroundgeolocationupdate() method i got error "Uncaught (in promise): Waiting for previous start action to complete" I used stopOnTerminate as true but still i got error

Steps to Reproduce

1.Called the method backgroundgeolocationupdate() first time after login 2.Closed the app from Background 3.Opened the app and called the method backgroundgeolocationupdate() again. 4.Shows error "Uncaught (in promise): Waiting for previous start action to complete" location update also not working

Context

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
kmanikandan8122 commented 3 weeks ago

When moving from one component to another component onlocation not working