transistorsoft / flutter_background_geolocation

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

Misunderstanding with plugin queue process #1351

Closed Mastersam07 closed 2 months ago

Mastersam07 commented 2 months ago

This plugin seems to queue locationTemplate in an sqlite db. For clarifications,

  1. At what point is the locationTemplate added to the queue?
  2. For http update that fails, say a 50x error, are the locationTemplate queued and retried again at a later time?

    Your Environment

    • Plugin version: 4.10.3
    • Platform: Android
    • Flutter info (flutter doctor):
      
      Doctor summary (to see all details, run flutter doctor -v):
      [✓] Flutter (Channel stable, 3.24.1, on macOS 14.5 23F79 darwin-arm64, locale en-NG)
      [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
      [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
      [✓] Chrome - develop for the web
      [✓] Android Studio (version 2024.1)
      [✓] VS Code (version 1.92.2)
      [✓] Connected device (3 available)            
      ! Error: Browsing on the local area network for BatCell. Ensure the device is unlocked and attached with a cable or associated
      with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
      [✓] Network resources

• No issues found!

* Plugin config:
```dart <-- Syntax highlighting: DO NOT REMOVE -->
Config(
        desiredAccuracy: Config.DESIRED_ACCURACY_HIGH,
        persistMode: Config.PERSIST_MODE_LOCATION,
        stopAfterElapsedMinutes: null,
        showsBackgroundLocationIndicator: false,
        stopOnStationary: false,
        distanceFilter: 1.0,
        stopOnTerminate: false,
        disableStopDetection: true,
        pausesLocationUpdatesAutomatically: false,
        preventSuspend: false,
        startOnBoot: true,
        debug: false,
        logLevel: Config.LOG_LEVEL_VERBOSE,
        reset: true,
        method: 'POST',
        autoSync: true,
        httpRootProperty: ".",
        locationsOrderDirection: "DESC",
        backgroundPermissionRationale: PermissionRationale(
          title: 'Allow Shuttlers Driver to access to '
              "this device's location in the background",
          message: 'This app needs permission to access your location '
              'in the background during active trips to update passengers',
          positiveAction: 'Change to allow all the time',
          negativeAction: '',
        ),
        url: '${AppConfig.data.baseUrl}/'
            '${AppConfig.data.apiVersion}/tracking',
        headers: sessionManager.sessionHeaders(true),
        locationTemplate: '{"location": "<%= latitude %>,<%= longitude %>",'
            '"recorded_at": "<%= timestamp %>", "heading": <%= heading %> }',
      )
christocracy commented 2 months ago
  1. Only once when the location is received.
  2. Yes. The plug-in will keep retrying until your server returns 200/201/203

you can manually clear the queue via .destroyLocations