transistorsoft / flutter_background_geolocation

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

Location tracking while roaming is inefficient - Tracks only a few location points while driving for 45 minutes [iOS update issue] #1028

Closed suhairhassan closed 1 year ago

suhairhassan commented 1 year ago

Your Environment

Expected Behavior

Should track frequent locations when driving or travelling. It works fine in my home country. Now i am in another country with roaming and even it tracks only a few location points when connected with a wifi dongle in car.

Actual Behavior

Should track locations frequently on moving

Steps to Reproduce

1. 2. 3. 4.

Context

Not getting locations data when roaming, I created a separate flutter page and in it i forced tracking/movement then it works with tracking all the location points frequently. As soon as i switch from that page tracking stops.

Debug logs

Logs ``` { activityRecognitionInterval = 10000; activityType = 1; authorization = { }; autoSync = 1; autoSyncThreshold = 0; batchSync = 0; debug = 0; desiredAccuracy = "-1"; desiredOdometerAccuracy = 100; didDeviceReboot = 0; didLaunchInBackground = 1; didRequestUpgradeLocationAuthorization = 1; disableAutoSyncOnCellular = 0; disableElasticity = 0; disableLocationAuthorizationAlert = 0; disableMotionActivityUpdates = 0; disableStopDetection = 0; distanceFilter = 10; elasticityMultiplier = 1; enableTimestampMeta = 0; enabled = 1; extras = { }; geofenceInitialTriggerEntry = 1; geofenceProximityRadius = 2000; geofenceTemplate = ""; headers = { }; heartbeatInterval = 60; httpRootProperty = location; httpTimeout = 60000; iOSHasWarnedLocationServicesOff = 1; isFirstBoot = 0; isMoving = 0; lastLocationAuthorizationStatus = 3; locationAuthorizationAlert = { cancelButton = Cancel; instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings"; settingsButton = Settings; titleWhenNotEnabled = "Background location is not enabled"; titleWhenOff = "Location services are off"; }; locationAuthorizationRequest = Always; locationTemplate = ""; locationTimeout = 60; locationsOrderDirection = ASC; logLevel = 5; logMaxDays = 3; maxBatchSize = "-1"; maxDaysToPersist = 1; maxRecordsToPersist = "-1"; method = POST; minimumActivityRecognitionConfidence = 70; odometer = "332732.72193397"; params = { }; pausesLocationUpdatesAutomatically = 1; persistMode = 2; preventSuspend = 0; schedule = ( ); schedulerEnabled = 0; showsBackgroundLocationIndicator = 0; startOnBoot = 1; stationaryRadius = 25; stopAfterElapsedMinutes = "-1"; stopDetectionDelay = 0; stopOnStationary = 0; stopOnTerminate = 0; stopTimeout = 5; trackingMode = 1; url = ""; useSignificantChangesOnly = 0; } ```

IMG_3078

background-geolocation.log

suhairhassan commented 1 year ago

IMG_3078 This is how it looks like when i taken a 30 mins drive in UAE. The points tracked are only a few.

christocracy commented 1 year ago

iOS 16.4 made a major change. Update to latest version. See CHANGELOG.

suhairhassan commented 1 year ago

@christocracy we are pointing to the github url of the plugin in pubspec so it will use the latest version right?

    git:
      url: https://github.com/transistorsoft/flutter_background_geolocation.git

Do i need to do anything further?

christocracy commented 1 year ago

Plugin version: 4.8.5 pointing straight to the github repo

I have no idea what version you are using. Why don’t you check your pubspec.lock to see which version is being installed?

suhairhassan commented 1 year ago

@christocracy checked pubspec

flutter_background_geolocation:
    dependency: "direct main"
    description:
      path: "."
      ref: HEAD
      resolved-ref: "44dae253da01334918911bdad4af1d156428bb47"
      url: "https://github.com/transistorsoft/flutter_background_geolocation.git"
    source: git
    version: "4.9.0"
christocracy commented 1 year ago

version: "4.9.0"

That is not the latest version. Change your version in pubspec to point to latest version in the standard manner (not from git url).

suhairhassan commented 1 year ago

Thanks @christocracy. It was not related to roaming but was due to the iOS update as you have pointed. We upgraded our version and it started working perfectly. Thanks for your time in analyzing this issue and for maintaining this library at high standards. Appreciate your time.