Skip to content

[Help Wanted]: I don't know if this is a duplicate event or if the event I received is too fast for my setup. #1520

@Phan-AnhDuc

Description

@Phan-AnhDuc

Required Reading

  • Confirmed

Plugin Version

4.16.9

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Samsung A53, Xiaomi 14T

Device operating-systems(s)

android 14

What do you require assistance about?

I don't know if this is a duplicate event or if the event I received is too fast compared to my setup, but through monitoring the log sent to the server when there is a change in the event, the result I received is duplicate, which greatly affects my flight saving. Can you help me solve this problem?

Image

[Optional] Plugin Code and/or Config

Future<void> initialize() async {
    try {
      // Đăng ký các sự kiện
      bg.BackgroundGeolocation.onLocation(_onLocation);
      bg.BackgroundGeolocation.onMotionChange(_onMotionChange);
      bg.BackgroundGeolocation.onActivityChange(_onActivityChange);
      bg.BackgroundGeolocation.onProviderChange(_onProviderChange);
      bg.BackgroundGeolocation.onPowerSaveChange(_onPowerSaveChange);

      // Cấu hình tối thiểu cho Background Geolocation
      bg.BackgroundGeolocation.ready(bg.Config(
              //schedule: ['1-7 08:00-18:00'],
              debug: false,
              reset: false,
              logLevel: bg.Config.LOG_LEVEL_VERBOSE,
              desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
              stopTimeout: 2,
              distanceFilter: 5,
              activityRecognitionInterval: 1000,
              disableElasticity: false,
              locationUpdateInterval: 4000,
              fastestLocationUpdateInterval: 3000,
              autoSync: false,
              activityType: bg.Config.ACTIVITY_TYPE_OTHER_NAVIGATION,
              minimumActivityRecognitionConfidence: 60,
              // activityType: bg.Config.ACTIVITY_TYPE_OTHER_NAVIGATION, IOS ONLY
              stopOnTerminate: false,
              notification: bg.Notification(
                title: "GreenMove",
                text: 'Service de localisation activé',
                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 (!state.enabled) {
          await bg.BackgroundGeolocation.start();
        }
      }).catchError((error) {});
    } catch (e) {
      rethrow;
    }
  }

[Optional] Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions