-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App ceases to fire onLocation event about 8 minutes after entering background #192
Comments
Just like to add that all battery optimization etc is off, and TSLocationManager has notification permissions. |
See wiki "Debugging". Learn to fetch and observe logs from the plugin. Also see Wiki "Philosophy of Operation" |
The dubug sounds indicate that the plugin is firing the LOCATION_RECORDED sound every couple of seconds when walking, as expected. No 'sad' sounds such as ERROR or WARNING, and at no point does it enter the non-moving state. It does however stop executing the onLocation callbacks after five minutes or so, only to fire them all at once when the app comes in to the foreground. The callback code works exactly as expected, just all at once. Are able to tell me whether this is intentional or unintentional behaviour your end? |
The plugin has no control over what happens to events once provided to Capacitor. Sounds like Your problem sounds like this. I'm sure the plugin's native HTTP requests do not get queued (you are not configuring an |
Thanks that's really useful - I presumed Capacitor had its own JS instance rather than relying on the Webview for execution. It might be time to migrate to Flutter... I've solved the incorrect timestamps issue by using those provided by the location object, but I guess we can't do background events in Capacitor any more. |
It's my preferred framework. I do all my SDK development primarily in flutter. React Native doesn't use a WebView, either. |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Your Environment
@transistorsoft/capacitor-background-geolocation 5.1.2
Android 13
Pixel 6a
Capacitor dependencies 5.3.0
const config = {
reset: true,
debug: false,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 3,
stationaryRadius: 25, // Enforced minimum 25, less would be good for our use case
stopTimeout: 120
stopOnStationary: false,
isMoving: true,
motionTriggerDelay: 1000,
fastestLocationUpdateInterval: 1000,
};
Expected Behavior
App is a walking/jogging tracker and should be able to enter background with screen off and use the onLocation callback to check if user is within set distance of pre-defined lng-lat checkpoints, to trigger a sound and vibration confirmation. It needs to continue doing so for up to 12 hours. Device is used for competitive events so users need immediate confirmation of their presence at a checkpoint to avoid backtracking.
Actual Behavior
App ceases to sound/vibrate within approx 8 minutes of screen being off, and instead processes all the callbacks at once when the app gets focus again. The plugin clearly is continuing to store locations/events, but seems to cache the actual execution of the callbacks while the app is in the background. The locations are correct but the time recording is off as it uses the device time at the moment the callback executes.
##Context
This seems to be a situation similar to those described in other open issues, but I wanted to provide an exact description. This is new behavior that also affects our Capacitor 4 build, it worked well until about 6 months ago?
The text was updated successfully, but these errors were encountered: