Skip to content
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

Location Switching between two different point (current and unknown) #1392

Open
asaddigital2809 opened this issue Dec 14, 2024 · 4 comments
Open

Comments

@asaddigital2809
Copy link

asaddigital2809 commented Dec 14, 2024

Your Environment

Plugin version: flutter_background_geolocation: ^4.16.3

Platform: iOS or Android : IOS

OS version: 18

Device manufacturer / model: Apple

Flutter info (flutter doctor):
[!] Flutter (Channel [user-branch], 3.22.0, on macOS 13.6.9 22G830 darwin-x64, locale en-GB)
! Flutter version 3.22.0 on channel [user-branch] at /Users/naeemtariq/Desktop/Developer/flutter
Currently on an unknown channel. Run flutter channel to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.64.2)
[✓] VS Code (version 1.94.0)
[✓] Connected device (1 available)
[✓] Network resources

Plugin config:

    bg.BackgroundGeolocation.ready(bg.Config(
            url:  'Url', 
            desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
            // enableHeadless: true,
            // disableStopDetection: true,
            stopOnTerminate: false,
            startOnBoot: true,
            stopOnStationary: false,
            debug: false,
            foregroundService: true,
            heartbeatInterval: 20,
            stationaryRadius: Platform.isAndroid ? 0 : 25,
            distanceFilter: Platform.isAndroid ? 0 : 25,
            locationUpdateInterval: 11000,
            fastestLocationUpdateInterval: 11000,
            maxRecordsToPersist: 800,
            allowIdenticalLocations: true,
            enableHeadless: true,
            maxDaysToPersist: 1,
            pausesLocationUpdatesAutomatically: false,
            preventSuspend: true,
            activityType: bg.Config.ACTIVITY_TYPE_AUTOMOTIVE_NAVIGATION,
            locationTemplate:
                '{"driver_lat":<%= latitude %>,"driver_lan":<%= longitude %>,"event":"<%= event %>","driver_id":$driverId,"loc_time":"<%= timestamp %>","orders":${[]}}',
            headers: {
              "Content-Type": "application/json; charset=UTF-8",
              "Authorization": 'Bearer $token'
            },
            notificationPriority: Platform.isAndroid ? 0 : -2,
            logLevel: Platform.isAndroid
                ? bg.Config.LOG_LEVEL_VERBOSE
                : bg.Config.LOG_LEVEL_OFF))
        .then((bg.State state) {
      if (!state.enabled) {
        bg.BackgroundGeolocation.start();
      }
    });

Expected Behavior

Plugin should always post my current accurate location on server.

Actual Behavior

Sometimes, it sends the correct location. However, within the next minute, it updates a location that is several kilometers away from the actual position. This behavior is causing inconsistencies in the location data we store. Forexample I am in Bury some locations are correct after sometimes the location I receive on server log is of Bolton

We need this to be fixed ASAP as we are having issues while delivering our orders

@christocracy
Copy link
Member

christocracy commented Dec 14, 2024

The plug-in does not manufacture locations — it is a mailman delivering what the native location api provides to it.

how is the plug-in supposed to know whether Bolton or Bury is reality?

You’re expected to perform your own filtering (see location.coords.accuracy).

@asaddigital2809
Copy link
Author

The plug-in does not manufacture locations — it is a mailman delivering what the native location api provides to it.

how is the plug-in supposed to know whether Bolton or Bury is reality?

You’re expected to perform your own filtering (see location.coords.accuracy).

If I am in Bury and moving in some park why do I get the locations from Bolton my question is tha

@christocracy
Copy link
Member

See wiki “Debugging”. Learn to fetch logs from the plug-in using “.emailLog”.

@christocracy
Copy link
Member

christocracy commented Dec 14, 2024

Also, provide a map of your location tracking. Or use the demo server (see api docs “Config.transistorAuthorizationToken” to learn how to configure the plug-in to post data to my demo server where I can visualize it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants