transistorsoft / background-geolocation-lt

Advanced Background Geolocation & Geofencing SDK for iOS & Android
Other
48 stars 19 forks source link

Initial launch Android URL location #97

Closed dbrody2004 closed 3 years ago

dbrody2004 commented 4 years ago

Your Environment

Plugin version: 1.4.0 Platform: Android OS version: Android 9 (Simulator) or Android 8 (S7) Device manufacturer / model: Pixel XL Simulator or S7 Plugin config config.updateWithBuilder() .setDebug(true) // Sound Fx / notifications during development .setLogLevel(5) // Verbose logging during development .setDesiredAccuracy(LocationRequest.PRIORITY_HIGH_ACCURACY) .setDistanceFilter(10F) .setStopTimeout(1L) .setHeartbeatInterval(60) .setStopOnTerminate(false) .setForegroundService(true) .setStartOnBoot(true) .setUrl("https://xyxy.xyxy.com/updategps.php") .setAutoSync(true) .setParams(params) .commit();

Expected Behavior

On app startup expect that the current location is sent to the URL

Actual Behavior

On app startup the initial/current location is not sent to the URL. This only happens on Android, it functions properly in iOS

Steps to Reproduce

Create a updategps.php file consisting of the below (uses codeignitor framework) and put that on a website that is publicly available

$handle = fopen("/tmp/1", "a"); $str=$this->security->xss_clean($this->input->raw_input_stream); fwrite($handle, $str); fwrite($handle,"\n"); fclose($handle);

Run the app in either a simulator or real device. For iOS after the app starts, there is a file at /tmp/1. For Android that file doesn't show up until the device travels.

Context

Debug logs

2020-10-06 17:47:04.725 489-489/com.xyxy.xyxyxy E/TSLocationManager: ╔═════════════════════════════════════════════ ║ LICENSE VALIDATION FAILURE: com.xyxy.xyxyxy ╠═════════════════════════════════════════════ ╟─ Invalid license key: YOUR_LICENCE_KEY_HERE ╟─ BackgroundGeolocation is fully functional in DEBUG builds without a license. ╚═════════════════════════════════════════════ 2020-10-06 17:47:04.781 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.adapter.TSConfig print] ╔═════════════════════════════════════════════ ║ TSLocationManager version: 3.1.7 (363) ╠═════════════════════════════════════════════ ╟─ samsung SM-G930F @ 8.0.0 (native) { "activityRecognitionInterval": 10000, "allowIdenticalLocations": false, "authorization": {}, "autoSync": true, "autoSyncThreshold": 0, "batchSync": false, "configUrl": "", "debug": true, "deferTime": 0, "desiredAccuracy": 100, "desiredOdometerAccuracy": 100, "disableAutoSyncOnCellular": false, "disableElasticity": false, "disableLocationAuthorizationAlert": false, "disableMotionActivityUpdates": false, "disableStopDetection": false, "distanceFilter": 10, "elasticityMultiplier": 1, "enableHeadless": false, "enableTimestampMeta": false, "encrypt": false, "extras": {}, "fastestLocationUpdateInterval": -1, "forceReloadOnBoot": false, "forceReloadOnGeofence": false, "forceReloadOnHeartbeat": false, "forceReloadOnLocationChange": false, "forceReloadOnMotionChange": false, "forceReloadOnSchedule": false, "foregroundService": true, "geofenceInitialTriggerEntry": true, "geofenceModeHighAccuracy": false, "geofenceProximityRadius": 1000, "geofenceTemplate": "", "headers": {}, "headlessJobService": "", "heartbeatInterval": 60, "httpRootProperty": "location", "httpTimeout": 60000, "isMoving": false, "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", "smallIcon": "", "largeIcon": "", "priority": 0, "strings": {}, "actions": [] }, "params": { "uuid": "eeb2c030e928862d", "secondsFromGMT": -25200 }, "persist": true, "persistMode": 2, "schedule": [], "scheduleUseAlarmManager": false, "speedJumpFilter": 300, "startOnBoot": true, "stationaryRadius": 25, "stopAfterElapsedMinutes": 0, "stopOnStationary": false, "stopOnTerminate": false, "stopTimeout": 1, "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking", "url": "https://xyxy.xyxyxyz.com/updategps/", "useSignificantChangesOnly": false, "enabled": true, "schedulerEnabled": false, "trackingMode": 1, "odometer": 76434.515625, "isFirstBoot": false, "didLaunchInBackground": false } 2020-10-06 17:47:04.793 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.adapter.TSConfig print] ╔═════════════════════════════════════════════ ║ DEVICE SENSORS ╠═════════════════════════════════════════════ ╟─ ✅ ACCELEROMETER: {Sensor name="K6DS3TR Acceleration Sensor", vendor="STM", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.25, minDelay=2000} ╟─ ✅ GYROSCOPE: {Sensor name="K6DS3TR Gyroscope Sensor", vendor="STM", version=2, type=4, maxRange=17.453293, resolution=6.1086525E-4, power=6.1, minDelay=2000} ╟─ ✅ MAGNETOMETER: {Sensor name="YAS537 Magnetic Sensor", vendor="Yamaha Corporation", version=1, type=2, maxRange=1200.0, resolution=0.1, power=6.0, minDelay=10000} ╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="SAMSUNG Significant Motion Sensor", vendor="Samsung Inc.", version=2, type=17, maxRange=1.0, resolution=1.0, power=0.3, minDelay=-1} ╚═════════════════════════════════════════════ 2020-10-06 17:47:04.801 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.a.BackgroundGeolocation ] ✅ Google Play Services: connected (version code:12451000) 2020-10-06 17:47:04.815 489-680/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.data.sqlite.b prune] ℹ️ PRUNE -1 days 2020-10-06 17:47:04.815 489-679/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.l.TSLocationManager$d run] ℹ️ Load last odometer location: Location[TSLocationManager 37.241471,-121.834456 hAcc=18 t=?!? et=?!? vAcc=??? sAcc=??? bAcc=??? {Bundle[{odometer=76434.516}]}] 2020-10-06 17:47:04.825 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 2020-10-06 17:47:04.835 489-684/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.http.HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? true ╠═════════════════════════════════════════════ 2020-10-06 17:47:04.839 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.a.BackgroundGeolocation f] 🎾 Start monitoring location-provider changes 2020-10-06 17:47:04.855 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.adapter.TSConfig d] ℹ️ Persist config, dirty: [params] 2020-10-06 17:47:04.869 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2020-10-06 17:47:04.873 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.locationmanager.util.b a] ℹ️ LocationAuthorization: Permission granted 2020-10-06 17:47:04.878 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.a.BackgroundGeolocation ready] LocationPermission :true 2020-10-06 17:47:04.880 489-680/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2020-10-06 17:47:05.138 489-683/com.xyxy.xyxyxy I/TSLocationManager: - Enable: true → true, trackingMode: 1 2020-10-06 17:47:05.149 489-683/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 🎾 Start motion-activity updates 2020-10-06 17:47:05.163 489-683/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.g.TSGeofenceManager start] 🎾 Start monitoring geofences 2020-10-06 17:47:05.169 489-683/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 2020-10-06 17:47:05.171 489-683/com.xyxy.xyxyxy D/TSLocationManager: [c.t.locationmanager.device.a c] 🎾 Start monitoring powersave changes 2020-10-06 17:47:05.176 489-683/com.xyxy.xyxyxy D/TSLocationManager: [c.t.locationmanager.util.b b] ℹ️ LocationAuthorization: Permission granted 2020-10-06 17:47:05.177 489-683/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.service.HeartbeatService b] 🎾 Start heartbeat (60s) 2020-10-06 17:47:05.608 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (false): 100 2020-10-06 17:47:05.668 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: setView = DecorView@25c659c[TSLocationManagerActivity] TM=true MM=false 2020-10-06 17:47:05.816 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: dispatchAttachedToWindow 2020-10-06 17:47:05.827 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: Relayout returned: old=[0,0][0,0] new=[540,996][540,996] result=0x7 surface={valid=true 511554588672} changed=true 2020-10-06 17:47:05.849 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 🚘 ️DetectedActivity [type=STILL, confidence=100] 2020-10-06 17:47:05.886 489-697/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.LocationRequestService a] ℹ️ Location availability: true 2020-10-06 17:47:05.896 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 🚘 ️DetectedActivity [type=STILL, confidence=100] 2020-10-06 17:47:05.986 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: MSG_RESIZED_REPORT: frame=Rect(540, 996 - 540, 996) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1 2020-10-06 17:47:05.986 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: MSG_WINDOW_FOCUS_CHANGED 1 2020-10-06 17:47:05.991 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2020-10-06 17:47:06.062 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: MSG_WINDOW_FOCUS_CHANGED 0 2020-10-06 17:47:06.097 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: Relayout returned: old=[540,996][540,996] new=[540,996][540,996] result=0x5 surface={valid=false 0} changed=true 2020-10-06 17:47:06.119 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: dispatchDetachedFromWindow 2020-10-06 17:47:06.119 489-489/com.xyxy.xyxyxy D/InputEventReceiver: channel 'a817e60 com.xyxy.xyxyxy/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity (client)' ~ Disposing input event receiver. 2020-10-06 17:47:06.119 489-489/com.xyxy.xyxyxy D/InputEventReceiver: channel 'a817e60 com.xyxy.xyxyxy/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity (client)' ~NativeInputEventReceiver. 2020-10-06 17:47:06.921 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService onDestroy] 🔴 ActivityRecognitionService destroyed 2020-10-06 17:47:10.368 489-697/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.LocationRequestService b] ╔═════════════════════════════════════════════ ║ getCurrentPosition LocationResult: 1 ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 37.241485,-121.834442 hAcc=18 et=+3h25m9s586ms alt=17.700000762939453 vAcc=2 sAcc=??? bAcc=??? {Bundle[mParcelledData.dataSize=52]}], age: 336ms, time: 1602031630015 2020-10-06 17:47:10.430 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.LocationRequestService onDestroy] 2020-10-06 17:47:10.516 489-697/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 🔵 Acquired current position 2020-10-06 17:47:10.519 489-697/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 18.465 2020-10-06 17:47:10.617 489-697/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 1 isFinished? true 2020-10-06 17:47:10.627 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 🎾 Start motion-activity updates 2020-10-06 17:47:10.643 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion] 🎾 Start monitoring stationary region (radius: 150.0m 37.2414847,-121.8344416 hAcc=18.465) 2020-10-06 17:47:10.705 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.service.TrackingService i] ╔═════════════════════════════════════════════ ║ TrackingService motionchange: false ╠═════════════════════════════════════════════ 2020-10-06 17:47:10.984 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.service.TrackingService onDestroy] 🔴 TrackingService destroyed 2020-10-06 17:47:11.135 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 🚘 ️DetectedActivity [type=STILL, confidence=100] 2020-10-06 17:47:12.162 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService onDestroy] 🔴 ActivityRecognitionService destroyed 2020-10-06 17:48:05.281 489-697/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.HeartbeatService$a run] ❤️ 2020-10-06 17:48:05.644 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.service.HeartbeatService onDestroy] onDestroy

christocracy commented 4 years ago

First of all, see the wiki Debugging and turn on verbose logging.

christocracy commented 4 years ago

Oh, i missed you did.

What do the logs show?

dbrody2004 commented 4 years ago

Setup an API that logs call to it, results are below. If I tail a similar app in iOS I'll see the URL being hit.

root@d4d8edf695e3:/tmp# tail -f /tmp/1

Logs from TSLocation (Android). Running in debug mode.

2020-10-06 17:47:04.725 489-489/com.xyxy.xyxyxy E/TSLocationManager: ╔═════════════════════════════════════════════ ║ LICENSE VALIDATION FAILURE: com.xyxy.xyxyxy ╠═════════════════════════════════════════════ ╟─ Invalid license key: YOUR_LICENCE_KEY_HERE ╟─ BackgroundGeolocation is fully functional in DEBUG builds without a license. ╚═════════════════════════════════════════════ 2020-10-06 17:47:04.781 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.adapter.TSConfig print] ╔═════════════════════════════════════════════ ║ TSLocationManager version: 3.1.7 (363) ╠═════════════════════════════════════════════ ╟─ samsung SM-G930F @ 8.0.0 (native) { "activityRecognitionInterval": 10000, "allowIdenticalLocations": false, "authorization": {}, "autoSync": true, "autoSyncThreshold": 0, "batchSync": false, "configUrl": "", "debug": true, "deferTime": 0, "desiredAccuracy": 100, "desiredOdometerAccuracy": 100, "disableAutoSyncOnCellular": false, "disableElasticity": false, "disableLocationAuthorizationAlert": false, "disableMotionActivityUpdates": false, "disableStopDetection": false, "distanceFilter": 10, "elasticityMultiplier": 1, "enableHeadless": false, "enableTimestampMeta": false, "encrypt": false, "extras": {}, "fastestLocationUpdateInterval": -1, "forceReloadOnBoot": false, "forceReloadOnGeofence": false, "forceReloadOnHeartbeat": false, "forceReloadOnLocationChange": false, "forceReloadOnMotionChange": false, "forceReloadOnSchedule": false, "foregroundService": true, "geofenceInitialTriggerEntry": true, "geofenceModeHighAccuracy": false, "geofenceProximityRadius": 1000, "geofenceTemplate": "", "headers": {}, "headlessJobService": "", "heartbeatInterval": 60, "httpRootProperty": "location", "httpTimeout": 60000, "isMoving": false, "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", "smallIcon": "", "largeIcon": "", "priority": 0, "strings": {}, "actions": [] }, "params": { "uuid": "eeb2c030e928862d", "secondsFromGMT": -25200 }, "persist": true, "persistMode": 2, "schedule": [], "scheduleUseAlarmManager": false, "speedJumpFilter": 300, "startOnBoot": true, "stationaryRadius": 25, "stopAfterElapsedMinutes": 0, "stopOnStationary": false, "stopOnTerminate": false, "stopTimeout": 1, "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking", "url": "https:\/\/xyxy.xyxyxyz.com\/updategps\/", "useSignificantChangesOnly": false, "enabled": true, "schedulerEnabled": false, "trackingMode": 1, "odometer": 76434.515625, "isFirstBoot": false, "didLaunchInBackground": false } 2020-10-06 17:47:04.793 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.adapter.TSConfig print] ╔═════════════════════════════════════════════ ║ DEVICE SENSORS ╠═════════════════════════════════════════════ ╟─ ✅ ACCELEROMETER: {Sensor name="K6DS3TR Acceleration Sensor", vendor="STM", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.25, minDelay=2000} ╟─ ✅ GYROSCOPE: {Sensor name="K6DS3TR Gyroscope Sensor", vendor="STM", version=2, type=4, maxRange=17.453293, resolution=6.1086525E-4, power=6.1, minDelay=2000} ╟─ ✅ MAGNETOMETER: {Sensor name="YAS537 Magnetic Sensor", vendor="Yamaha Corporation", version=1, type=2, maxRange=1200.0, resolution=0.1, power=6.0, minDelay=10000} ╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="SAMSUNG Significant Motion Sensor", vendor="Samsung Inc.", version=2, type=17, maxRange=1.0, resolution=1.0, power=0.3, minDelay=-1} ╚═════════════════════════════════════════════ 2020-10-06 17:47:04.801 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.a.BackgroundGeolocation ] ✅ Google Play Services: connected (version code:12451000) 2020-10-06 17:47:04.815 489-680/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.data.sqlite.b prune] ℹ️ PRUNE -1 days 2020-10-06 17:47:04.815 489-679/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.l.TSLocationManager$d run] ℹ️ Load last odometer location: Location[TSLocationManager 37.241471,-121.834456 hAcc=18 t=?!? et=?!? vAcc=??? sAcc=??? bAcc=??? {Bundle[{odometer=76434.516}]}] 2020-10-06 17:47:04.825 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 2020-10-06 17:47:04.835 489-684/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.http.HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? true ╠═════════════════════════════════════════════ 2020-10-06 17:47:04.839 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.a.BackgroundGeolocation f] 🎾 Start monitoring location-provider changes 2020-10-06 17:47:04.855 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.adapter.TSConfig d] ℹ️ Persist config, dirty: [params] 2020-10-06 17:47:04.869 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2020-10-06 17:47:04.873 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.locationmanager.util.b a] ℹ️ LocationAuthorization: Permission granted 2020-10-06 17:47:04.878 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.a.BackgroundGeolocation ready] LocationPermission :true 2020-10-06 17:47:04.880 489-680/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2020-10-06 17:47:05.138 489-683/com.xyxy.xyxyxy I/TSLocationManager: - Enable: true → true, trackingMode: 1 2020-10-06 17:47:05.149 489-683/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 🎾 Start motion-activity updates 2020-10-06 17:47:05.163 489-683/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.g.TSGeofenceManager start] 🎾 Start monitoring geofences 2020-10-06 17:47:05.169 489-683/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 2020-10-06 17:47:05.171 489-683/com.xyxy.xyxyxy D/TSLocationManager: [c.t.locationmanager.device.a c] 🎾 Start monitoring powersave changes 2020-10-06 17:47:05.176 489-683/com.xyxy.xyxyxy D/TSLocationManager: [c.t.locationmanager.util.b b] ℹ️ LocationAuthorization: Permission granted 2020-10-06 17:47:05.177 489-683/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.service.HeartbeatService b] 🎾 Start heartbeat (60s) 2020-10-06 17:47:05.608 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (false): 100 2020-10-06 17:47:05.668 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: setView = DecorView@25c659c[TSLocationManagerActivity] TM=true MM=false 2020-10-06 17:47:05.816 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: dispatchAttachedToWindow 2020-10-06 17:47:05.827 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: Relayout returned: old=[0,0][0,0] new=[540,996][540,996] result=0x7 surface={valid=true 511554588672} changed=true 2020-10-06 17:47:05.849 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 🚘 ️DetectedActivity [type=STILL, confidence=100] 2020-10-06 17:47:05.886 489-697/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.LocationRequestService a] ℹ️ Location availability: true 2020-10-06 17:47:05.896 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 🚘 ️DetectedActivity [type=STILL, confidence=100] 2020-10-06 17:47:05.986 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: MSG_RESIZED_REPORT: frame=Rect(540, 996 - 540, 996) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1 2020-10-06 17:47:05.986 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: MSG_WINDOW_FOCUS_CHANGED 1 2020-10-06 17:47:05.991 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2020-10-06 17:47:06.062 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: MSG_WINDOW_FOCUS_CHANGED 0 2020-10-06 17:47:06.097 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: Relayout returned: old=[540,996][540,996] new=[540,996][540,996] result=0x5 surface={valid=false 0} changed=true 2020-10-06 17:47:06.119 489-489/com.xyxy.xyxyxy D/ViewRootImpl@1edf10f[TSLocationManagerActivity]: dispatchDetachedFromWindow 2020-10-06 17:47:06.119 489-489/com.xyxy.xyxyxy D/InputEventReceiver: channel 'a817e60 com.xyxy.xyxyxy/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity (client)' ~ Disposing input event receiver. 2020-10-06 17:47:06.119 489-489/com.xyxy.xyxyxy D/InputEventReceiver: channel 'a817e60 com.xyxy.xyxyxy/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity (client)' ~NativeInputEventReceiver. 2020-10-06 17:47:06.921 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService onDestroy] 🔴 ActivityRecognitionService destroyed 2020-10-06 17:47:10.368 489-697/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.LocationRequestService b] ╔═════════════════════════════════════════════ ║ getCurrentPosition LocationResult: 1 ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 37.241485,-121.834442 hAcc=18 et=+3h25m9s586ms alt=17.700000762939453 vAcc=2 sAcc=??? bAcc=??? {Bundle[mParcelledData.dataSize=52]}], age: 336ms, time: 1602031630015 2020-10-06 17:47:10.430 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.LocationRequestService onDestroy] 2020-10-06 17:47:10.516 489-697/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 🔵 Acquired current position 2020-10-06 17:47:10.519 489-697/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 18.465 2020-10-06 17:47:10.617 489-697/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.LocationRequestService b] SingleLocationRequest 1 isFinished? true 2020-10-06 17:47:10.627 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.s.ActivityRecognitionService b] 🎾 Start motion-activity updates 2020-10-06 17:47:10.643 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion] 🎾 Start monitoring stationary region (radius: 150.0m 37.2414847,-121.8344416 hAcc=18.465) 2020-10-06 17:47:10.705 489-489/com.xyxy.xyxyxy I/TSLocationManager: [c.t.l.service.TrackingService i] ╔═════════════════════════════════════════════ ║ TrackingService motionchange: false ╠═════════════════════════════════════════════ 2020-10-06 17:47:10.984 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.service.TrackingService onDestroy] 🔴 TrackingService destroyed 2020-10-06 17:47:11.135 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService a] 🚘 ️DetectedActivity [type=STILL, confidence=100] 2020-10-06 17:47:12.162 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.ActivityRecognitionService onDestroy] 🔴 ActivityRecognitionService destroyed 2020-10-06 17:48:05.281 489-697/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.s.HeartbeatService$a run] ❤️ 2020-10-06 17:48:05.644 489-489/com.xyxy.xyxyxy D/TSLocationManager: [c.t.l.service.HeartbeatService onDestroy] onDestroy

christocracy commented 4 years ago

You’ve ignored the issue template. Edit your issue and provide the following information (do not post it to a new comment):

Your Environment

Expected Behavior

Actual Behavior

Steps to Reproduce

1. 2. 3. 4.

Context

Debug logs

dbrody2004 commented 3 years ago

Revised the initial post. If this is intended behaviour would you recommend getCurrentPosition (https://github.com/transistorsoft/background-geolocation-lt/blob/master/docs/README-Android.md#getcurrentpositiontscurrentpositionrequest) after calling BackgroundGeolocation.getInstance(getApplicationContext(), getIntent()).ready ? Would that method upload to the url and if not I'm assuming that the code would have to take the json response and add in the extra params (set by setParams) ?

BTW this is excellent library and working great in iOS, just trying to fix this small issue for Android before we can incorporate it into Android production.

christocracy commented 3 years ago

Have you tried going outside for a walk with that device?

dbrody2004 commented 3 years ago

Yes it works great and starts reporting as soon as motion starts but does not report the initial location to the URL when the app starts.

christocracy commented 3 years ago

but does not report the initial location to the URL when the app starts.

If your app is launched while the plugin is already state.enabled == true, it's unnecessary to record a location whenever the app boots. You're free to call #getCurrentPosition whenever you wish.

christocracy commented 3 years ago

For example, if the user boots then immediately terminates the app 10 times in-a-row, what would be the point of posting 10 time the same location?

If you want to do that, as I said, you're free to call #getCurrentPosition as you wish.