transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
652 stars 240 forks source link

stopTimeout not working in example app #1328

Closed Alvish0407 closed 4 months ago

Alvish0407 commented 4 months ago

Your Environment

• No issues found!

* Plugin config:
```dart <-- Syntax highlighting: DO NOT REMOVE -->
Example App

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. run advance version of example app in simulator
  2. toggle location service switch on
  3. Simulate location to Freeway Drive and keep it more 1 minute
  4. Simulate location to None and wait for 5+ minutes

Context

Change mode to stationary if stopTimeout elapsed

Debug logs

Logs ``` flutter: [location] - [Location {uuid: E8C7E55C-EE3B-4C6B-857C-AFE0D6029817, odometer: 1166.8, extras: {}, mock: true, age: 7, timestamp: 2024-07-20T13:28:28.451Z, battery: {level: -1.0, is_charging: false}, coords: {speed_accuracy: 0.0, speed: 32.3, longitude: -122.04149924, ellipsoidal_altitude: 0.0, floor: 0, heading_accuracy: 0.0, latitude: 37.3344499, accuracy: 5.0, altitude_accuracy: -1.0, altitude: 0.0, heading: 269.3}, is_moving: true, activity: {type: unknown, confidence: 100}}] flutter: [http] - [HttpEvent {success: true, status: 200, responseText: {"success":true}}] flutter: [location] - [Location {uuid: 636B7054-E7D4-4C19-9FD4-C9100BE49B9E, odometer: 1268.9, extras: {}, mock: true, age: 8, timestamp: 2024-07-20T13:28:31.468Z, battery: {level: -1.0, is_charging: false}, coords: {speed_accuracy: 0.0, speed: 33.87, longitude: -122.04265083, ellipsoidal_altitude: 0.0, floor: 0, heading_accuracy: 0.0, latitude: 37.33444952, accuracy: 5.0, altitude_accuracy: -1.0, altitude: 0.0, heading: 270.0}, is_moving: true, activity: {type: unknown, confidence: 100}}] flutter: [http] - [HttpEvent {success: true, status: 200, responseText: {"success":true}}] ⚠️-[TSLocationManager locationManager:didFailWithError:] Error Domain=kCLErrorDomain Code=0 "(null)" flutter: [BackgroundGeolocation onLocation] ‼️ Unhandled location error: [LocationError code: 0, message: LOCATION_ERROR]. You should provide a failure callback as 2nd argument to BackgroundGeolocation.onLocation. Eg: BackgroundGeolocation.onLocation(_onLocation, (LocationError error) { // Handle LocationError here. print("[onLocation] ERROR: $error"); }); flutter: [location] ERROR - [LocationError code: 0, message: LOCATION_ERROR] ``` image image
christocracy commented 4 months ago

stopTimeout doesn’t work in the iOS simulator since the simulator doesn’t have an accelerometer or gyroscope. You can only test stopTimeout on a real device.