flutter_background_geolocation icon indicating copy to clipboard operation
flutter_background_geolocation copied to clipboard

[Help Wanted]: After finishing a trip and standing still, I received many locations with jump speed and their activity is in_vehicle.

Open Phan-AnhDuc opened this issue 8 months ago • 2 comments

Required Reading

  • [x] Confirmed

Plugin Version

4.16.9

Mobile operating-system(s)

  • [ ] iOS
  • [x] Android

Device Manufacturer(s) and Model(s)

Samsung A53

Device operating-systems(s)

android 14

What do you require assistance about?

After completing an in_vehicle movement, instead of switching to still when standing still, the library returns to me an activity that is in_vehicle with locations jumping randomly around the position where I'm standing still. I think it might be due to multiple GPS issues, but I've encountered this frequently in recent trips. Please help me solve this problem.

Image

[Optional] Plugin Code and/or Config

bg.BackgroundGeolocation.ready(bg.Config(
              schedule: ['1-7 08:00-18:00'],
              reset: false,
              debug: false,
              logLevel: bg.Config.LOG_LEVEL_VERBOSE,
              desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
              stopTimeout: 2,
              distanceFilter: 5,
              disableElasticity: false,
              locationUpdateInterval: 4000,
              fastestLocationUpdateInterval: 3000,
              autoSync: true,
              activityType: bg.Config.ACTIVITY_TYPE_OTHER_NAVIGATION,
              activityRecognitionInterval: 1000,
              stopOnTerminate: false,
              notification: bg.Notification(
                title: "Suivi de localisation",
                text: "Détection d'activité en cours...",
                channelName: "Détection d'Activité",
              ),
              startOnBoot: true,
              enableHeadless: true,
              persistMode: bg.Config.PERSIST_MODE_NONE,
              heartbeatInterval: 60,
              pausesLocationUpdatesAutomatically: false,
              backgroundPermissionRationale: bg.PermissionRationale(
                  title:
                      "Autoriser {applicationName} à accéder à la localisation de cet appareil.",
                  message:
                      "L'application vous aide à gérer et à enregistrer vos trajets de manière pratique.",
                  positiveAction: 'Toujours autoriser',
                  negativeAction: 'Annuler')))
          .then((bg.State state) async {
        if (user.mode == 'normal') {
          await updateSchedule(['1-7 00:00-23:59'], user.status ?? true);
        } else {
          final listSchedule =
              await convertWorkingHoursToSchedule(user.workingHours ?? []);
          await updateSchedule(listSchedule, user.status ?? true);
        }
      }).catchError((error) {
        print('=========error===========$error');
      });

      _isInitialized = true;
    } catch (e) {
      print('====================$e');
      rethrow;
    }
  }

[Optional] Relevant log output


Phan-AnhDuc avatar May 12 '25 02:05 Phan-AnhDuc

@christocracy

Phan-AnhDuc avatar May 12 '25 02:05 Phan-AnhDuc

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 12 '25 02:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 26 '25 02:06 github-actions[bot]