Closed GuptaAman08 closed 11 months ago
Device manufacturer / model: Android Emulator
Geofences donβt work in the Emulator. The plug-in cannot automatically trigger location-tracking in the Emulator, only in a real device with real movement.
Geofences donβt work in the Emulator. The plug-in cannot automatically trigger location-tracking in the Emulator, only in a real device with real movement.
FYI, am using the built-in Android emulator journey spoofer. So, as per what you are saying if your sdk detects a device in motion when I use startTracking(), then traveling a sufficient amount of distance post being in the stationary state should also trigger right ??
Also, can you please answer the below question? Since it can be a use case where users don't allow this permission. In the case of iOS its clear, but Android its being unclear
Suppose, if I don't want to give physical activity permission, then how does the SDK detect that the device is in motion after being in a stationary state irrespective of the time?
where users don't allow this permission. In the case of iOS its clear, but Android its being unclear
Android uses a βstationary geofenceβ (just like iOS) as a backup. The Android plug-in operates under the assumption that the User will reject Motion permission.
Your Environment
react-native -v
): 0.71.4Expected Behavior
Should start sending continuous location updates, when moved a sufficient distance from last stationary point.
Actual Behavior
The react-native application does not automatically start tracking when previously it was in a stationary state for more then 40 minutes. I tried with different distances, ranging from 200 to 2000 meters when trying to resume the tracking from the stationary state. But still, only the first location update is received in the case of Android. Instead, it should start tracking and sending location updates thereafter.
Also, would like to ask one question. Since tried to find all docs but couldn't find them. 1. Suppose, if I don't want to give physical activity permission, then how does the SDK detects that the device is in motion after being in a stationary state irrespective of the time?
Steps to Reproduce
Context
Testing when app is in stationary position for 30-40 mins and resuming the tracking
Debug logs
Logs
``` 07-27 19:38:59.124 11285 11285 I TSLocationManager: [c.t.l.service.TrackingService performStopDetection] 07-27 19:38:59.124 11285 11285 I TSLocationManager: βΉοΈ Distance from stoppedAtLocation: -10.0 07-27 19:38:59.124 11285 14766 I TSLocationManager: [c.t.l.l.TSLocationManager onLocationResult] 07-27 19:38:59.124 11285 14766 I TSLocationManager: π΅ Re-scaled distanceFilter: 20.0->60.0) 07-27 19:38:59.130 11285 14965 I TSLocationManager: [c.t.l.http.HttpService a] 07-27 19:38:59.130 11285 14965 I TSLocationManager: π΅ HTTP POST: 70d8e0cb-da3d-429f-943a-50b0fd654d98 07-27 19:38:59.143 11285 11285 I TSLocationManager: [c.t.l.service.TrackingService performStopDetection] 07-27 19:38:59.143 11285 11285 I TSLocationManager: βΉοΈ Distance from stoppedAtLocation: -10.0 07-27 19:38:59.471 11285 15034 I TSLocationManager: [c.t.l.http.HttpService$h onResponse] 07-27 19:38:59.471 11285 15034 I TSLocationManager: π΅ Response: 200 07-27 19:38:59.476 11285 11375 I ReactNativeJS: 2023-07-27T14:08:59.474Z: onHttp Event {"responseText":"{\"success\":true,\"arrived\":false,\"stop\":false,\"geofences\":[{\"name\":\"NearBy\",\"type\":\"nearby\",\"lastUpdatedAt\":\"2023-07-27T13:33:44.215Z\"},{\"name\":\"proximity_sdk_test-AtLocation\",\"type\":\"at-location\",\"lastUpdatedAt\":\"2023-07-27T14:08:27.251Z\"}],\"orderExternalId\":\"26Jul_04\"}","status":200,"success":true} 07-27 19:38:59.476 11285 11375 I ReactNativeJS: 2023-07-27T14:08:59.476Z: New Geofence Events [] 07-27 19:38:59.482 11285 15034 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] β³ stopBackgroundTask: 104 07-27 19:39:04.046 11285 11285 I TSLocationManager: [c.t.l.service.TrackingService performStopDetection] 07-27 19:39:04.046 11285 11285 I TSLocationManager: βΉοΈ Distance from stoppedAtLocation: 52.356495 07-27 19:39:04.049 11285 11285 I TSLocationManager: [c.t.l.s.TSScheduleManager cancelOneShot] 07-27 19:39:04.049 11285 11285 I TSLocationManager: β° Cancel OneShot: STOP_TIMEOUT 07-27 19:39:04.050 11285 14766 I TSLocationManager: [c.t.l.data.sqlite.b persist] 07-27 19:39:04.050 11285 14766 I TSLocationManager: β INSERT: 2d35e920-da0f-424c-b4c2-e1d58cd056e4 07-27 19:39:04.054 11285 11285 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 07-27 19:39:04.054 11285 11285 I TSLocationManager: β° Scheduled OneShot: MOTION_ACTIVITY_CHECK in 64941ms (jobID: -18513055) 07-27 19:39:04.057 11285 14766 I TSLocationManager: [c.t.l.http.HttpService flush] 07-27 19:39:04.057 11285 14766 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 19:39:04.057 11285 14766 I TSLocationManager: β HTTP Service (count: 1) 07-27 19:39:04.057 11285 14766 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 19:39:04.069 11285 11285 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] β³ startBackgroundTask: 105 07-27 19:39:04.074 11285 14766 I TSLocationManager: [c.t.l.http.HttpService a] 07-27 19:39:04.074 11285 14766 I TSLocationManager: π΅ HTTP POST: 2d35e920-da0f-424c-b4c2-e1d58cd056e4 07-27 19:39:04.406 11285 15034 I TSLocationManager: [c.t.l.http.HttpService$h onResponse] 07-27 19:39:04.406 11285 15034 I TSLocationManager: π΅ Response: 200 07-27 19:39:04.411 11285 11375 I ReactNativeJS: 2023-07-27T14:09:04.409Z: onHttp Event {"responseText":"{\"success\":true,\"arrived\":false,\"stop\":false,\"geofences\":[{\"name\":\"NearBy\",\"type\":\"nearby\",\"lastUpdatedAt\":\"2023-07-27T13:33:44.215Z\"},{\"name\":\"proximity_sdk_test-AtLocation\",\"type\":\"at-location\",\"lastUpdatedAt\":\"2023-07-27T14:08:27.251Z\"}],\"orderExternalId\":\"26Jul_04\"}","status":200,"success":true} 07-27 19:39:04.414 11285 11375 I ReactNativeJS: 2023-07-27T14:09:04.413Z: New Geofence Events [] 07-27 19:39:04.418 11285 15034 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] β³ stopBackgroundTask: 105 07-27 19:40:12.249 11285 15126 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent onOneShot] 07-27 19:40:12.249 11285 15126 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 19:40:12.249 11285 15126 I TSLocationManager: β β° OneShot event fired: MOTION_ACTIVITY_CHECK 07-27 19:40:12.249 11285 15126 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 19:40:12.251 11285 11285 I TSLocationManager: [c.t.l.s.ActivityRecognitionService start] 07-27 19:40:12.251 11285 11285 I TSLocationManager: πΎ Start motion-activity updates 07-27 19:40:12.796 11285 11285 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 07-27 19:40:12.796 11285 11285 I TSLocationManager: β° Scheduled OneShot: STOP_TIMEOUT in 1200000ms (jobID: 2059034116) 07-27 19:40:12.799 11285 11285 I TSLocationManager: [c.t.l.l.TSLocationManager removeLocationUpdates] 07-27 19:40:12.799 11285 11285 I TSLocationManager: π΄ Location-services: OFF 07-27 19:40:12.800 11285 11285 I TSLocationManager: [c.t.l.l.TSLocationManager requestLocationUpdates] 07-27 19:40:12.800 11285 11285 I TSLocationManager: πΎ Location-services: ON 07-27 19:40:17.353 11285 15126 I TSLocationManager: [c.t.l.l.TSLocationManager onLocationResult] 07-27 19:40:17.353 11285 15126 I TSLocationManager: π΅ Re-scaled distanceFilter: 20.0->60.0) 07-27 19:40:17.353 11285 11285 I TSLocationManager: [c.t.l.service.TrackingService performStopDetection] 07-27 19:40:17.353 11285 11285 I TSLocationManager: βΉοΈ Distance from stoppedAtLocation: -10.0 07-27 19:40:17.396 11285 15251 I TSLocationManager: [c.t.l.data.sqlite.b persist] 07-27 19:40:17.396 11285 15251 I TSLocationManager: β INSERT: 850a437c-486c-4fb8-bfcd-fcac0439072b 07-27 19:40:17.408 11285 15251 I TSLocationManager: [c.t.l.http.HttpService flush] 07-27 19:40:17.408 11285 15251 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 19:40:17.408 11285 15251 I TSLocationManager: β HTTP Service (count: 1) 07-27 19:40:17.408 11285 15251 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 19:40:17.414 11285 11285 I TSLocationManager: [c.t.l.service.TrackingService performStopDetection] 07-27 19:40:17.414 11285 11285 I TSLocationManager: βΉοΈ Distance from stoppedAtLocation: -10.0 07-27 19:40:17.425 11285 11285 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] β³ startBackgroundTask: 106 07-27 19:40:17.443 11285 15251 I TSLocationManager: [c.t.l.http.HttpService a] 07-27 19:40:17.443 11285 15251 I TSLocationManager: π΅ HTTP POST: 850a437c-486c-4fb8-bfcd-fcac0439072b 07-27 19:40:17.763 11285 15252 I TSLocationManager: [c.t.l.http.HttpService$h onResponse] 07-27 19:40:17.763 11285 15252 I TSLocationManager: π΅ Response: 200 07-27 19:40:17.768 11285 11375 I ReactNativeJS: 2023-07-27T14:10:17.766Z: onHttp Event {"responseText":"{\"success\":true,\"arrived\":false,\"stop\":false,\"geofences\":[{\"name\":\"NearBy\",\"type\":\"nearby\",\"lastUpdatedAt\":\"2023-07-27T13:33:44.215Z\"},{\"name\":\"proximity_sdk_test-AtLocation\",\"type\":\"at-location\",\"lastUpdatedAt\":\"2023-07-27T14:08:27.251Z\"}],\"orderExternalId\":\"26Jul_04\"}","status":200,"success":true} 07-27 19:40:17.769 11285 11375 I ReactNativeJS: 2023-07-27T14:10:17.769Z: New Geofence Events [] 07-27 19:40:17.774 11285 15252 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] β³ stopBackgroundTask: 106 07-27 20:00:12.840 11285 16266 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent onOneShot] 07-27 20:00:12.840 11285 16266 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:12.840 11285 16266 I TSLocationManager: β β° OneShot event fired: STOP_TIMEOUT 07-27 20:00:12.840 11285 16266 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:12.876 11285 16266 I TSLocationManager: [c.t.l.service.HeartbeatService start] 07-27 20:00:12.876 11285 16266 I TSLocationManager: πΎ Start heartbeat (60s) 07-27 20:00:12.886 11285 16266 I TSLocationManager: [c.t.l.l.TSLocationManager removeLocationUpdates] 07-27 20:00:12.886 11285 16266 I TSLocationManager: π΄ Location-services: OFF 07-27 20:00:12.896 11285 16266 I TSLocationManager: [c.t.l.service.TrackingService changePace] 07-27 20:00:12.896 11285 16266 I TSLocationManager: π΅ setPace: true β false 07-27 20:00:12.911 11285 16266 I TSLocationManager: [c.t.l.l.SingleLocationRequest startUpdatingLocation] 07-27 20:00:12.911 11285 16266 I TSLocationManager: π΅ [SingleLocationRequest start, action: 1, requestId: 11] 07-27 20:00:12.912 11285 16266 I TSLocationManager: [c.t.l.s.ActivityRecognitionService start] 07-27 20:00:12.912 11285 16266 I TSLocationManager: πΎ Start motion-activity updates 07-27 20:00:13.009 11285 16266 I TSLocationManager: [c.t.l.s.LocationRequestService handleLocationAvailability] 07-27 20:00:13.009 11285 16266 I TSLocationManager: βΉοΈ Location availability: true 07-27 20:00:16.545 11285 16266 I TSLocationManager: [c.t.l.s.LocationRequestService handleLocationResult] 07-27 20:00:16.545 11285 16266 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:16.545 11285 16266 I TSLocationManager: β motionchange LocationResult: 11 07-27 20:00:16.545 11285 16266 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:16.545 11285 16266 I TSLocationManager: ββ π Location[fused 18.972117,72.809457 hAcc=5 et=+2h21m49s816ms alt=0.0 vel=27.131777 bear=173.0 vAcc=1 sAcc=1 bAcc=30 {Bundle[mParcelledData.dataSize=52]}], age: 14ms, time: 1690468216526 07-27 20:00:16.546 11285 16266 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult] 07-27 20:00:16.546 11285 16266 I TSLocationManager: π΅ Acquired motionchange position, isMoving: false 07-27 20:00:16.558 11285 16277 I TSLocationManager: [c.t.l.data.sqlite.b persist] 07-27 20:00:16.558 11285 16277 I TSLocationManager: β INSERT: 7063fbb6-5511-4d85-bf4b-e23522180e5f 07-27 20:00:16.573 11285 11285 I TSLocationManager: [c.t.l.service.TrackingService handleMotionChangeResult] 07-27 20:00:16.573 11285 11285 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:16.573 11285 11285 I TSLocationManager: β TrackingService motionchange: false 07-27 20:00:16.573 11285 11285 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:16.574 11285 16277 I TSLocationManager: [c.t.l.http.HttpService flush] 07-27 20:00:16.574 11285 16277 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:16.574 11285 16277 I TSLocationManager: β HTTP Service (count: 1) 07-27 20:00:16.574 11285 16277 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:00:16.585 11285 11285 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] β³ startBackgroundTask: 107 07-27 20:00:16.592 11285 16277 I TSLocationManager: [c.t.l.http.HttpService a] 07-27 20:00:16.592 11285 16277 I TSLocationManager: π΅ HTTP POST: 7063fbb6-5511-4d85-bf4b-e23522180e5f 07-27 20:00:17.729 11285 16278 I TSLocationManager: [c.t.l.http.HttpService$h onResponse] 07-27 20:00:17.729 11285 16278 I TSLocationManager: π΅ Response: 200 07-27 20:00:17.740 11285 16278 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] β³ stopBackgroundTask: 107 07-27 20:00:17.744 11285 11375 I ReactNativeJS: 2023-07-27T14:30:17.737Z: onHttp Event {"responseText":"{\"success\":true,\"arrived\":false,\"stop\":false,\"geofences\":[{\"name\":\"NearBy\",\"type\":\"nearby\",\"lastUpdatedAt\":\"2023-07-27T13:33:44.215Z\"},{\"name\":\"proximity_sdk_test-AtLocation\",\"type\":\"at-location\",\"lastUpdatedAt\":\"2023-07-27T14:08:27.251Z\"}],\"orderExternalId\":\"26Jul_04\"}","status":200,"success":true} 07-27 20:00:17.747 11285 11375 I ReactNativeJS: 2023-07-27T14:30:17.746Z: New Geofence Events [] 07-27 20:05:40.298 11285 11285 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 07-27 20:05:40.298 11285 11285 I TSLocationManager: β° Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588) 07-27 20:05:50.327 11285 16550 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent onOneShot] 07-27 20:05:50.327 11285 16550 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:05:50.327 11285 16550 I TSLocationManager: β β° OneShot event fired: TERMINATE_EVENT 07-27 20:05:50.327 11285 16550 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:06:03.395 11285 16550 I TSLocationManager: [c.t.l.http.HttpService flush] 07-27 20:06:03.395 11285 16550 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:06:03.395 11285 16550 I TSLocationManager: β HTTP Service (count: 0) 07-27 20:06:03.395 11285 16550 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:06:24.140 11285 11285 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot] 07-27 20:06:24.140 11285 11285 I TSLocationManager: β° Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588) 07-27 20:06:34.171 11285 16550 I TSLocationManager: [c.t.l.scheduler.ScheduleEvent onOneShot] 07-27 20:06:34.171 11285 16550 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:06:34.171 11285 16550 I TSLocationManager: β β° OneShot event fired: TERMINATE_EVENT 07-27 20:06:34.171 11285 16550 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:07:44.107 11285 16550 I TSLocationManager: [c.t.l.http.HttpService flush] 07-27 20:07:44.107 11285 16550 I TSLocationManager: ββββββββββββββββββββββββββββββββββββββββββββββ 07-27 20:07:44.107 11285 16550 I TSLocationManager: β HTTP Service (count: 0) 07-27 20:07:44.107 11285 16550 I TSLocationManager: β βββββββββββββββββββββββββββββββββββββββββββββ ```