flutter_background_geolocation icon indicating copy to clipboard operation
flutter_background_geolocation copied to clipboard

Plugin through error 401 till app restart after restart it works

Open adn9990 opened this issue 2 years ago • 16 comments

Your Environment

  • Plugin version:
  • Platform: Android
  • OS version:
  • Device manufacturer / model:
  • Flutter info (flutter doctor):
  • Plugin config: "activityRecognitionInterval": 10000, "allowIdenticalLocations": false, "authorization": {}, "autoSync": true, "autoSyncThreshold": 0, "backgroundPermissionRationale": { "title": "Allow {applicationName} to access this device's location even when the app is closed or not in use.", "message": "This app collects location data to enable recording your trips to work and calculate distance-travelled.", "positiveAction": "Change to "{backgroundPermissionOptionLabel}"", "negativeAction": "Cancel" }, "batchSync": false, "configUrl": "", "debug": false, "deferTime": 0, "desiredAccuracy": -1, "desiredOdometerAccuracy": 100, "disableAutoSyncOnCellular": false, "disableElasticity": false, "disableLocationAuthorizationAlert": false, "disableMotionActivityUpdates": false, "disableProviderChangeRecord": false, "disableStopDetection": false, "distanceFilter": 150, "elasticityMultiplier": 1, "enableHeadless": true, "enableTimestampMeta": false, "extras": {}, "fastestLocationUpdateInterval": -1, "foregroundService": true, "geofenceInitialTriggerEntry": true, "geofenceModeHighAccuracy": false, "geofenceProximityRadius": 1000, "geofenceTemplate": "", "headers": { "Authorization": "Bearer null" }, "headlessJobService": "com.transistorsoft.flutter.backgroundgeolocation.HeadlessTask", "heartbeatInterval": 60, "httpRootProperty": "location", "httpTimeout": 60000, "isMoving": true, "locationAuthorizationRequest": "Always", "locationTemplate": "", "locationTimeout": 60, "locationUpdateInterval": 1000, "locationsOrderDirection": "ASC", "logLevel": 5, "logMaxDays": 3, "maxBatchSize": -1, "maxDaysToPersist": 1, "maxRecordsToPersist": -1, "method": "POST", "minimumActivityRecognitionConfidence": 75, "motionTriggerDelay": 0, "notification": { "layout": "", "title": "", "text": "Location Service activated", "color": "", "channelName": "TSLocationManager", "channelId": "", "smallIcon": "", "largeIcon": "", "priority": 1, "sticky": false, "strings": {}, "actions": [] }, "params": {}, "persist": true, "persistMode": 1, "schedule": [], "scheduleUseAlarmManager": false, "speedJumpFilter": 300, "startOnBoot": true, "stationaryRadius": 25, "stopAfterElapsedMinutes": 0, "stopOnStationary": false, "stopOnTerminate": false, "stopTimeout": 5, "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking", "url": "https://..../.....", "useSignificantChangesOnly": false, "enabled": true, "schedulerEnabled": false, "trackingMode": 1, "odometer": 1604.0958251953125, "isFirstBoot": false, "didLaunchInBackground": false, "didDeviceReboot": false }
PASTE_YOUR_CODE_HERE

Expected Behavior

Plugin should start sending location as it start first time, and keep sending until it get stopped

Actual Behavior

Plugin fetch location and saved them when app restart it send all the location and then it stopped fetching location till device is not in moving state

Steps to Reproduce

Context

Just fetch location

Debug logs

Logs

More logs are in attached file

05-04 14:19:46.932 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/location
05-04 14:19:46.933 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/motionchange
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/activitychange
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/geofenceschange
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/geofence
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/heartbeat
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/http
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/schedule
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/connectivitychange
05-04 14:19:46.934 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/enabledchange
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/providerchange
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/notificationaction
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/powersavechange
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/authorization
05-04 14:19:46.935 INFO [LoggerFacade$a a] 
  ✅  Google Play Services: connected (version code:12451000)
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] PID: 3
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] ℹ️   Persist config, dirty: []
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] ☯️  onCreate
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] ☯️  onStart
05-04 14:19:46.935 DEBUG [LoggerFacade$a a] ☯️  onResume
05-04 14:19:46.936 INFO [LoggerFacade$a a] 
  🎾  Start monitoring location-provider changes
05-04 14:20:00.295 DEBUG [TSConfig d] ℹ️   Persist config, dirty: [backgroundPermissionRationale, backgroundPermissionRationale.title, backgroundPermissionRationale.message, backgroundPermissionRationale.negativeAction, desiredAccuracy, distanceFilter, enableHeadless, headers, heartbeatInterval, logLevel, notification, notification.priority, persistMode, startOnBoot, stopOnTerminate, url]
05-04 14:20:00.299 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════

05-04 14:21:45.973 DEBUG [LifecycleManager onPause] ☯️  onPause
05-04 14:21:46.391 DEBUG [LifecycleManager onResume] ☯️  onResume
05-04 14:21:50.276 DEBUG [LifecycleManager onPause] ☯️  onPause
05-04 14:21:50.277 DEBUG [LifecycleManager onStop] ☯️  onStop
05-04 14:21:55.481 DEBUG [LifecycleManager onStart] ☯️  onStart
05-04 14:21:55.595 DEBUG [LifecycleManager onResume] ☯️  onResume
05-04 14:21:55.681 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:21:55.698 DEBUG [ForegroundNotification createNotificationChannel] NotificationChannel{mId='app.XYZ.comTSLocationManager', mName=TSLocationManager, mDescription=, mImportance=1, mBypassDnd=false, mLockscreenVisibility=-1, mSound=null, mLights=false, mLightColor=0, mVibration=null, mUserLockedFields=0, mFgServiceShown=false, mVibrationEnabled=false, mShowBadge=false, mDeleted=false, mDeletedTimeMs=-1, mGroup='null', mAudioAttributes=null, mBlockableSystem=false, mAllowBubbles=-1, mImportanceLockedDefaultApp=false, mOriginalImp=-1000, mParent=null, mConversationId=null, mDemoted=false, mImportantConvo=false}
05-04 14:21:55.713 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:21:55.716 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 2, requestId: 1]
05-04 14:21:55.729 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:21:58.785 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:21:58.787 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ getCurrentPosition LocationResult: 1
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639478,77.178281 hAcc=13.159 et=+26d15h28m49s193ms alt=213.0 vAcc=1.0], age: 2336ms, time: 1683190316450

05-04 14:21:58.792 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired current position
05-04 14:21:58.793 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 13.159
05-04 14:21:58.798 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:21:58.801 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:21:58.828 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 1 isFinished? true
05-04 14:21:58.829 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:24:56.870 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:24:56.886 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:24:56.889 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 2, requestId: 2]
05-04 14:24:56.891 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:24:59.820 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:24:59.824 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ getCurrentPosition LocationResult: 2
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639539,77.178241 hAcc=16.709 et=+26d15h31m49s688ms alt=213.0 vAcc=1.0], age: 2878ms, time: 1683190496945

05-04 14:24:59.830 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired current position
05-04 14:24:59.833 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 14.934
05-04 14:24:59.834 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:24:59.837 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:24:59.846 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 2 isFinished? true
05-04 14:24:59.846 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:08.331 DEBUG [LifecycleManager onPause] ☯️  onPause
05-04 14:25:08.333 DEBUG [LifecycleManager onStop] ☯️  onStop
05-04 14:25:11.274 DEBUG [LifecycleManager onStart] ☯️  onStart
05-04 14:25:11.279 DEBUG [LifecycleManager onResume] ☯️  onResume
05-04 14:25:14.905 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:25:14.915 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:14.916 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 2, requestId: 3]
05-04 14:25:14.917 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:25:16.044 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:16.047 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ getCurrentPosition LocationResult: 3
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639683,77.178327 hAcc=4.776 et=+26d15h32m8s248ms alt=213.0 vAcc=1.040359 vel=0.41186088 sAcc=0.29 bear=328.51633], age: 540ms, time: 1683190515505

05-04 14:25:16.051 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired current position
05-04 14:25:16.051 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 13.159
05-04 14:25:16.055 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:16.057 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 3 isFinished? true
05-04 14:25:16.057 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:16.059 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:25:19.985 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:25:19.997 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:19.999 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 2, requestId: 4]
05-04 14:25:20.002 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:25:21.123 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:21.125 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ getCurrentPosition LocationResult: 4
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639689,77.178324 hAcc=4.907 et=+26d15h32m13s306ms alt=213.0 vAcc=1.0556452 vel=0.14820954 sAcc=0.47423622 bear=338.31967], age: 561ms, time: 1683190520563

05-04 14:25:21.128 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired current position
05-04 14:25:21.129 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 9.033
05-04 14:25:21.132 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:21.135 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:25:21.135 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 4 isFinished? true
05-04 14:25:21.135 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:22.023 INFO [c g] 
  🔵  LocationAuthorization: Requesting Background permission
05-04 14:25:22.822 DEBUG [LifecycleManager onPause] ☯️  onPause
05-04 14:25:23.204 INFO [c$j onPermissionGranted] 
  ✅  LocationAuthorization: Permission granted
05-04 14:25:23.226 DEBUG [LifecycleManager onResume] ☯️  onResume
05-04 14:25:23.234 DEBUG [HttpService startMonitoringConnectivityChanges] 
  🎾  Start monitoring connectivity changes
05-04 14:25:23.236 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════

05-04 14:25:23.242 DEBUG [DeviceSettings startMonitoringPowerSaveChanges] 
  🎾  Start monitoring powersave changes
05-04 14:25:23.257 INFO [TSScheduleManager oneShot] 
  ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
05-04 14:25:23.268 INFO [HeartbeatService start] 
  🎾  Start heartbeat (60s)
05-04 14:25:23.279 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:25:23.283 INFO [HeartbeatService start] 
  🎾  Start heartbeat (60s)
05-04 14:25:23.285 INFO [TrackingService changePace] 
  🔵  setPace: false → false
05-04 14:25:23.295 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:25:23.296 INFO [TrackingService changePace] 
  🔵  setPace: false → false
05-04 14:25:23.298 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:25:23.301 INFO [TSProviderManager handleProviderChangeEvent] 
╔═════════════════════════════════════════════
║ Location-provider change: true
╠═════════════════════════════════════════════
╟─ GPS: true
╟─ Network: true
╟─ AP Mode: false

05-04 14:25:23.303 DEBUG [HttpService a] 
╔═════════════════════════════════════════════
║ 📶  Connectivity change: connected? true
╠═════════════════════════════════════════════

05-04 14:25:23.303 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:23.305 ERROR [LocationRequestService handleStartAction] 
  ‼️  Failed to find SingleLocationRequest in START action; requestId: 5; Intent: Intent { act=start cmp=app.XYZ.com/com.transistorsoft.locationmanager.service.LocationRequestService (has extras) }
05-04 14:25:23.306 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:23.307 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:23.315 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 0]
05-04 14:25:23.316 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 1, requestId: 6]
05-04 14:25:23.319 INFO [ActivityRecognitionService start] 
  🎾  Start motion-activity updates
05-04 14:25:23.321 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:23.322 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 3, requestId: 7]
05-04 14:25:23.324 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:25:23.336 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:25:23.446 DEBUG [TSLocationManagerActivity execute] locationsettings
05-04 14:25:23.446 DEBUG [TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
05-04 14:25:23.467 INFO [TSScheduleManager cancelOneShot] 
  ⏰ Cancel OneShot: TERMINATE_EVENT
05-04 14:25:23.495 DEBUG [AbstractService start] 
  🎾  ActivityRecognitionService [eventCount: 1]
05-04 14:25:23.497 DEBUG [TSLocationManagerActivity stop] eventCount: 0
05-04 14:25:23.508 DEBUG [ActivityRecognitionService handleActivityRecognitionResult] 
  🚘 ️DetectedActivity [type=STILL, confidence=100]
05-04 14:25:23.517 DEBUG [AbstractService finish] ⚙️︎  finish ActivityRecognitionService [eventCount: 0, sticky: false]
05-04 14:25:23.572 DEBUG [TSLocationManagerActivity execute] locationsettings
05-04 14:25:23.573 DEBUG [TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
05-04 14:25:23.604 INFO [TSScheduleManager oneShot] 
  ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
05-04 14:25:23.610 DEBUG [TSLocationManagerActivity onDestroy] 
05-04 14:25:23.646 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:25:23.648 DEBUG [TSLocationManagerActivity stop] eventCount: 0
05-04 14:25:23.694 INFO [TSScheduleManager cancelOneShot] 
  ⏰ Cancel OneShot: TERMINATE_EVENT
05-04 14:25:23.704 DEBUG [AbstractService start] 
  🎾  ActivityRecognitionService [eventCount: 1]
05-04 14:25:23.705 DEBUG [ActivityRecognitionService handleActivityTransitionResult] *** wasMoving: false, nowMoving: false, startedMoving: false, justStopped; false
05-04 14:25:23.706 INFO [ActivityRecognitionService handleActivityTransitionResult] 
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🎾  ENTER: still
╚═════════════════════════════════════════════
05-04 14:25:23.707 DEBUG [AbstractService finish] ⚙️︎  finish ActivityRecognitionService [eventCount: 0, sticky: false]
05-04 14:25:23.725 INFO [TSScheduleManager oneShot] 
  ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
05-04 14:25:23.731 DEBUG [TSLocationManagerActivity onDestroy] 
05-04 14:25:23.960 DEBUG [AbstractService onDestroy] 
  🔴  ActivityRecognitionService stopped
05-04 14:25:24.305 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════

05-04 14:25:24.460 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:24.462 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ motionchange LocationResult: 6
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639682,77.178323 hAcc=4.846 et=+26d15h32m16s657ms alt=213.0 vAcc=1.0389705 vel=0.20168586 sAcc=0.41773197 bear=192.89777], age: 547ms, time: 1683190523914

05-04 14:25:24.465 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 2]
05-04 14:25:24.466 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ providerchange LocationResult: 7
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639682,77.178323 hAcc=4.846 et=+26d15h32m16s657ms alt=213.0 vAcc=1.0389705 vel=0.20168586 sAcc=0.41773197 bear=192.89777], age: 551ms, time: 1683190523914

05-04 14:25:24.467 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired motionchange position, isMoving: false
05-04 14:25:24.469 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 4.846
05-04 14:25:24.471 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:24.475 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:25:24.478 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 6 isFinished? true
05-04 14:25:24.479 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:24.479 DEBUG [TSGeofenceManager startMonitoringStationaryRegion] 
  🎾  Start monitoring stationary region (radius: 150.0m 28.6396815,77.1783226 hAcc=4.846)
05-04 14:25:24.480 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired providerchange position
05-04 14:25:24.481 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 4.846
05-04 14:25:24.487 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 7 isFinished? true
05-04 14:25:24.487 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:24.487 INFO [b persist] 
  ✅  INSERT: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:25:24.491 INFO [b persist] 
  ✅  INSERT: ff5d1530-1a47-43c3-b82d-211fdde80f44
05-04 14:25:24.495 DEBUG [AbstractService start] 
  🎾  TrackingService [eventCount: 1]
05-04 14:25:24.496 INFO [TrackingService handleMotionChangeResult] 
╔═════════════════════════════════════════════
║ TrackingService motionchange: false
╠═════════════════════════════════════════════

05-04 14:25:24.497 INFO [HttpService flush] 
  ℹ️  HttpService is busy
05-04 14:25:24.499 DEBUG [AbstractService finish] ⚙️︎  finish TrackingService [eventCount: 0, sticky: false]
05-04 14:25:24.500 DEBUG [TSLocationManager$b onLocation] 
  ℹ️  Distance from last location: 10.580978
05-04 14:25:24.501 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 2)
╠═════════════════════════════════════════════

05-04 14:25:24.523 DEBUG [AbstractService start] 
  🎾  BackgroundTaskService [eventCount: 1]
05-04 14:25:24.524 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 1
05-04 14:25:24.534 DEBUG [b first] 
  ✅  Locked 1 records
05-04 14:25:24.537 INFO [HttpService a] 
  🔵  HTTP POST: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:25:24.755 DEBUG [AbstractService onDestroy] 
  🔴  TrackingService stopped
05-04 14:25:24.985 WARN [HttpService$h onResponse] 
  ⚠️  Response: 401, 
05-04 14:25:24.987 DEBUG [b unlock] 
  ✅  UNLOCKED: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:25:24.988 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 1
05-04 14:25:24.988 DEBUG [AbstractService finish] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
05-04 14:25:24.990 DEBUG [AbstractService onDestroy] 
  🔴  BackgroundTaskService stopped
05-04 14:25:27.764 DEBUG [c h] 
  ℹ️  LocationAuthorization: Permission granted
05-04 14:25:27.776 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:27.777 INFO [SingleLocationRequest startUpdatingLocation] 
  🔵  [SingleLocationRequest start, action: 2, requestId: 8]
05-04 14:25:27.778 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: true]
05-04 14:25:28.901 DEBUG [AbstractService start] 
  🎾  LocationRequestService [eventCount: 1]
05-04 14:25:28.904 INFO [LocationRequestService handleLocationResult] 
╔═════════════════════════════════════════════
║ getCurrentPosition LocationResult: 8
╠═════════════════════════════════════════════
╟─ 📍  Location[fused 28.639673,77.178324 hAcc=5.253 et=+26d15h32m21s100ms alt=213.0 vAcc=1.0474904 vel=0.19190247 sAcc=0.33970577 bear=173.68077], age: 546ms, time: 1683190528357

05-04 14:25:28.912 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:28.914 DEBUG [AbstractService onDestroy] 
  🔴  LocationRequestService stopped
05-04 14:25:28.914 INFO [TSLocationManager onSingleLocationResult] 
  🔵  Acquired current position
05-04 14:25:28.915 DEBUG [TSLocationManager calculateMedianAccuracy] Median accuracy: 4.846
05-04 14:25:28.923 DEBUG [LocationRequestService handleLocationResult] SingleLocationRequest 8 isFinished? true
05-04 14:25:28.923 DEBUG [AbstractService finish] ⚙️︎  finish LocationRequestService [eventCount: 0, sticky: false]
05-04 14:25:28.925 INFO [b persist] 
  ✅  INSERT: 41eac5ec-2fa7-4313-a687-047dbdad5b20
05-04 14:25:28.929 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 3)
╠═════════════════════════════════════════════

05-04 14:25:28.941 DEBUG [AbstractService start] 
  🎾  BackgroundTaskService [eventCount: 1]
05-04 14:25:28.941 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 2
05-04 14:25:28.944 DEBUG [b first] 
  ✅  Locked 1 records
05-04 14:25:28.944 INFO [HttpService a] 
  🔵  HTTP POST: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:25:28.976 WARN [HttpService$h onResponse] 
  ⚠️  Response: 401, 
05-04 14:25:28.979 DEBUG [b unlock] 
  ✅  UNLOCKED: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:25:28.979 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 2
05-04 14:25:28.980 DEBUG [AbstractService finish] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
05-04 14:25:28.982 DEBUG [AbstractService onDestroy] 
  🔴  BackgroundTaskService stopped
05-04 14:25:33.743 INFO [ScheduleEvent onOneShot] 
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════

05-04 14:25:33.744 DEBUG [TerminateEvent$a a] 
  ℹ️  TERMINATE_EVENT ignored (MainActivity is still active).
05-04 14:27:08.340 DEBUG [AbstractService start] 
  🎾  HeartbeatService [eventCount: 1]
05-04 14:27:08.342 DEBUG [HeartbeatService$a run] ❤️
05-04 14:27:08.354 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 3)
╠═════════════════════════════════════════════

05-04 14:27:08.358 DEBUG [AbstractService finish] ⚙️︎  finish HeartbeatService [eventCount: 0, sticky: false]
05-04 14:27:08.372 DEBUG [AbstractService start] 
  🎾  BackgroundTaskService [eventCount: 1]
05-04 14:27:08.373 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 3
05-04 14:27:08.384 DEBUG [b first] 
  ✅  Locked 1 records
05-04 14:27:08.385 INFO [HttpService a] 
  🔵  HTTP POST: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:27:08.400 WARN [HttpService$h onResponse] 
  ⚠️  Response: 401, 
05-04 14:27:08.402 DEBUG [b unlock] 
  ✅  UNLOCKED: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:27:08.404 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 3
05-04 14:27:08.406 DEBUG [AbstractService finish] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
05-04 14:27:08.410 DEBUG [AbstractService onDestroy] 
  🔴  BackgroundTaskService stopped
05-04 14:27:08.615 DEBUG [AbstractService onDestroy] 
  🔴  HeartbeatService stopped
05-04 14:28:08.324 DEBUG [AbstractService start] 
  🎾  HeartbeatService [eventCount: 1]
05-04 14:28:08.326 DEBUG [HeartbeatService$a run] ❤️
05-04 14:28:08.338 INFO [HttpService flush] 
╔═════════════════════════════════════════════
║ HTTP Service (count: 3)
╠═════════════════════════════════════════════

05-04 14:28:08.343 DEBUG [AbstractService finish] ⚙️︎  finish HeartbeatService [eventCount: 0, sticky: false]
05-04 14:28:08.361 DEBUG [AbstractService start] 
  🎾  BackgroundTaskService [eventCount: 1]
05-04 14:28:08.362 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 4
05-04 14:28:08.366 DEBUG [b first] 
  ✅  Locked 1 records
05-04 14:28:08.367 INFO [HttpService a] 
  🔵  HTTP POST: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:28:08.421 WARN [HttpService$h onResponse] 
  ⚠️  Response: 401, 
05-04 14:28:08.425 DEBUG [b unlock] 
  ✅  UNLOCKED: 03ee80c4-3513-43d8-b2b3-19a4e915a678
05-04 14:28:08.425 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 4
05-04 14:28:08.426 DEBUG [AbstractService finish] ⚙️︎  finish BackgroundTaskService [eventCount: 0, sticky: false]
05-04 14:28:08.429 DEBUG [AbstractService onDestroy] 
  🔴  BackgroundTaskService stopped
05-04 14:28:08.604 DEBUG [AbstractService onDestroy] 
  🔴  HeartbeatService stopped
05-04 14:29:08.324 DEBUG [AbstractService start] 
  🎾  HeartbeatService [eventCount: 1]
05-04 14:29:08.326 DEBUG [HeartbeatService$a run] ❤️
05-04 14:29:08.340 INFO [HttpService flush] 

[Logs.txt](https://github.com/transistorsoft/flutter_background_geolocation/files/11401397/Logs.txt)

adn9990 avatar May 04 '23 20:05 adn9990

[HttpService$h onResponse] ⚠️ Response: 401,

this is your own server saying “401”.

"Authorization": "Bearer null" },

Perhaps you should analyze your authentication credentials?

christocracy avatar May 04 '23 20:05 christocracy

but its works as i restart app as you can check and logs and config, and please can you tell me why i am not getting location in background, please check logs, i had tried but unable to understand

adn9990 avatar May 04 '23 21:05 adn9990

but its works as i restart app

Likely related to your Authentication token.

It’s YOUR server returning 401 (Unauthorized).

it’s up to you to provide the plug-in a valid Auth token to satisfy your server’s authentication.

christocracy avatar May 04 '23 21:05 christocracy

Please check logs and config, is there any issue in it

On Fri, 5 May, 2023, 02:51 Chris Scott, @.***> wrote:

but its works as i restart app

Likely related to your Authentication token.

It’s YOUR server returning 401 (Unauthorized).

it’s up to you to provide the plug-in a valid Auth token to satisfy your server’s authentication.

— Reply to this email directly, view it on GitHub https://github.com/transistorsoft/flutter_background_geolocation/issues/1032#issuecomment-1535430896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVN7FE3IMXQCHSDIUFO6OT3XEQMWDANCNFSM6AAAAAAXWJAX3Q . You are receiving this because you authored the thread.Message ID: <transistorsoft/flutter_background_geolocation/issues/1032/1535430896@ github.com>

adn9990 avatar May 04 '23 21:05 adn9990

Also not getting location in background

adn9990 avatar May 04 '23 21:05 adn9990

"Authorization": "Bearer null" },

Does that look valid to you? I cannot imagine my server would be impressed with that.

christocracy avatar May 04 '23 21:05 christocracy

Please check logs and config, is there any issue in it

What particular range of timestamp are you interested in? Have you looked at your own logs?

christocracy avatar May 04 '23 21:05 christocracy

Yes, we are starting service whenever user login and stop service when user logout, we are getting location while device is moving only. We have installed and activate service on 10 device s but not getting regular updates

adn9990 avatar May 04 '23 21:05 adn9990

"Authorization": "Bearer null" },

Explain this to me.

christocracy avatar May 04 '23 21:05 christocracy

I agree with this, but as you check log, suddenly after restarting app it start giving 200 response code. I am not also getting it why it is happening

adn9990 avatar May 04 '23 21:05 adn9990

I don’t think you understand that it’s your server responsible for returning 200 vs 401. Your server returns 401 when you have not sufficiently provided the plug-in your server’s required Authentication token.

check your code. Carefully analyze the plug-in’s State returned from the .ready method.

christocracy avatar May 04 '23 21:05 christocracy

Don’t you think it’s remotely plausible that you’re making a mistake in your code and not properly configuring the Authentication token?

christocracy avatar May 04 '23 21:05 christocracy

Ohk, can you please tell me is the config correct to get background location in every 10-15 min from a device?

adn9990 avatar May 04 '23 21:05 adn9990

can you please tell me is the config correct to get background location in every 10-15 min from a device?

That’s not what this issue is about. This issue is about “Plugin through error 401 till app restart after restart it works

issues are not an open “free for all” personal support thread.

christocracy avatar May 04 '23 21:05 christocracy

I am just asking about plugin configuration...

Thanks

adn9990 avatar May 04 '23 21:05 adn9990

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

github-actions[bot] avatar May 05 '24 01:05 github-actions[bot]

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

github-actions[bot] avatar May 19 '24 01:05 github-actions[bot]