I was testing this library while commuting home from the office via metro. It was working fine throughout the journey; however, during the ~30 minutes when the metro was underground, I noticed that the library stopped recognizing location updates and eventually crashed.
In low-signal or no-signal areas (such as underground), does the library rely on device movement detection?
Does it cache location data locally and sync/send it once network connectivity is restored?
Our business use case requires tracking the exact path covered by riders during an order and calculating the total distance based on that path. Since rider incentives are calculated using this distance, we require high precision in latitude/longitude data and want to avoid noisy or inaccurate pings.
I am attaching logs for the duration during which no location updates were received, along with my current configuration. Could you please confirm whether my configuration is appropriate for a high-precision tracking use case?
geolocation: {
desiredAccuracy: BackgroundGeolocation.DesiredAccuracy.Navigation,
distanceFilter: 0,
locationUpdateInterval: 5000,
locationAuthorizationRequest:
BackgroundGeolocation.LocationRequest.Always,
},
persistence: {
locationTemplate:
'{"lat":<%= latitude %>,"lng":<%= longitude %>,"timestamp": "<%= timestamp %>"}',
extras: {
hub_id: hubId,
},
},
app: {
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
notification: {
title: "Background Geolocation",
text: "Tracking location",
smallIcon: "mipmap/ic_launcher",
sticky: true,
},
},
logger: {
logLevel: BackgroundGeolocation.LogLevel.Verbose,
debug: false
},
http: {
url: `${API_CONFIG.BASE_URL}${API_CONFIG.ENDPOINTS.RIDER.UPDATE_LOCATION}`,
method: "POST",
autoSync: true,
batchSync: true,
rootProperty: "data",
headers: {
"Content-Type": "application/json",
"platform-type": "app",
"app-secret-key": "Test",
},
},
authorization: {
strategy: "JWT",
accessToken: token,
refreshToken: refreshToken,
refreshUrl: `${API_CONFIG.BASE_URL}${API_CONFIG.ENDPOINTS.AUTH.REFRESH_GEO_LOCATION}`,
refreshPayload: {
"refresh_token": "{refreshToken}",
},
refreshHeaders: {
"platform-type": "app",
"app-secret-key": "Test",
},
},
import AsyncStorage from "@react-native-async-storage/async-storage";
import "expo-router/entry";
import BackgroundGeolocation from "react-native-background-geolocation";
const BgHeadlessTask = async (event) => {
const { name, params } = event;
if (name === "authorization") {
try {
const { access_token, refresh_token } = params?.response?.data || {};
if (access_token && refresh_token) {
await AsyncStorage.multiSet([
["access_token", access_token],
["refresh_token", refresh_token]
]);
}
} catch (error) {
console.error("[HeadlessTask] Storage Error:", error);
}
}
return Promise.resolve();
};
BackgroundGeolocation.registerHeadlessTask(BgHeadlessTask);
13 21:00:06.199 DEBUG [b0 a]
✅ Locked 1 records
02-13 21:00:06.199 INFO [HttpService a]
🔵 HTTP POST batch (1)
02-13 21:00:06.490 INFO [HttpService$e onResponse]
🔵 Response: 204
02-13 21:00:06.491 DEBUG [b0 a]
✅ DELETED: (1)
02-13 21:00:06.496 DEBUG [b0 a]
✅ Locked 0 records
02-13 21:00:06.496 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 1505
02-13 21:00:11.060 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2564, eventCount: 1]
02-13 21:00:11.061 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:11.062 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2564, eventCount: 0, sticky: true]
02-13 21:00:11.856 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2565, eventCount: 1]
02-13 21:00:11.857 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:11.857 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2565, eventCount: 0, sticky: true]
02-13 21:00:11.866 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2566, eventCount: 1]
02-13 21:00:11.867 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.516638,77.196130 hAcc=156.318 et=+5d12h6m20s555ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 684ms, time: 1770996611183
02-13 21:00:11.867 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2566, eventCount: 0, sticky: true]
02-13 21:00:11.868 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:11.868 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.516638,77.196130 hAcc=156.318 et=+5d12h6m20s555ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@d9ff620, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=0.0, effective=0.0, anomaly=false, acc(cur)=156.318, acc(prev)=53.2}
02-13 21:00:16.189 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2567, eventCount: 1]
02-13 21:00:16.192 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:16.193 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2567, eventCount: 0, sticky: true]
02-13 21:00:18.091 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2568, eventCount: 1]
02-13 21:00:18.093 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:18.098 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2568, eventCount: 0, sticky: true]
02-13 21:00:18.105 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2569, eventCount: 1]
02-13 21:00:18.105 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.516638,77.196130 hAcc=268.738 et=+5d12h6m26s176ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 1301ms, time: 1770996616804
02-13 21:00:18.106 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:18.106 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2569, eventCount: 0, sticky: true]
02-13 21:00:18.106 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.516638,77.196130 hAcc=268.738 et=+5d12h6m26s176ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@6d9bbd9, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=0.0, effective=0.0, anomaly=false, acc(cur)=268.738, acc(prev)=156.318}
02-13 21:00:21.818 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2570, eventCount: 1]
02-13 21:00:21.820 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:21.821 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2570, eventCount: 0, sticky: true]
02-13 21:00:24.326 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2571, eventCount: 1]
02-13 21:00:24.327 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:24.327 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2571, eventCount: 0, sticky: true]
02-13 21:00:24.340 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2572, eventCount: 1]
02-13 21:00:24.340 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.516638,77.196130 hAcc=733.957 et=+5d12h6m32s428ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 1284ms, time: 1770996623056
02-13 21:00:24.341 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:24.341 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.516638,77.196130 hAcc=733.957 et=+5d12h6m32s428ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@4c7499e, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=0.0, effective=0.0, anomaly=false, acc(cur)=733.957, acc(prev)=268.738}
02-13 21:00:24.344 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2572, eventCount: 0, sticky: true]
02-13 21:00:28.065 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2573, eventCount: 1]
02-13 21:00:28.067 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:28.068 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2573, eventCount: 0, sticky: true]
02-13 21:00:30.559 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2574, eventCount: 1]
02-13 21:00:30.559 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:30.559 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2574, eventCount: 0, sticky: true]
02-13 21:00:30.571 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2575, eventCount: 1]
02-13 21:00:30.571 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.513929,77.188236 hAcc=200.0 et=+5d12h6m38s672ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 1271ms, time: 1770996629300
02-13 21:00:30.571 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:30.572 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.513929,77.188236 hAcc=200.0 et=+5d12h6m38s672ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@f7cac7f, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=829.0926513671875, effective=68.37402130285614, anomaly=true, acc(cur)=200.0, acc(prev)=733.957}
02-13 21:00:30.572 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2575, eventCount: 0, sticky: true]
02-13 21:00:34.307 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2576, eventCount: 1]
02-13 21:00:34.307 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:34.307 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2576, eventCount: 0, sticky: true]
02-13 21:00:36.782 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2577, eventCount: 1]
02-13 21:00:36.783 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:36.783 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2577, eventCount: 0, sticky: true]
02-13 21:00:36.797 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2578, eventCount: 1]
02-13 21:00:36.798 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.513929,77.188236 hAcc=200.0 et=+5d12h6m44s895ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 1275ms, time: 1770996635523
02-13 21:00:36.798 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2578, eventCount: 0, sticky: true]
02-13 21:00:36.798 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:36.799 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.513929,77.188236 hAcc=200.0 et=+5d12h6m44s895ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@dde544c, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=0.0, effective=0.0, anomaly=false, acc(cur)=200.0, acc(prev)=200.0}
02-13 21:00:40.531 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2579, eventCount: 1]
02-13 21:00:40.532 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:40.532 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2579, eventCount: 0, sticky: true]
02-13 21:00:43.044 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2580, eventCount: 1]
02-13 21:00:43.044 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:43.044 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2580, eventCount: 0, sticky: true]
02-13 21:00:43.058 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2581, eventCount: 1]
02-13 21:00:43.059 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.513929,77.188236 hAcc=200.0 et=+5d12h6m51s123ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 1308ms, time: 1770996641751
02-13 21:00:43.059 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2581, eventCount: 0, sticky: true]
02-13 21:00:43.060 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:43.060 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.513929,77.188236 hAcc=200.0 et=+5d12h6m51s123ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@4213c95, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=0.0, effective=0.0, anomaly=false, acc(cur)=200.0, acc(prev)=200.0}
02-13 21:00:46.765 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2582, eventCount: 1]
02-13 21:00:46.767 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:46.767 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2582, eventCount: 0, sticky: true]
02-13 21:00:49.779 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2583, eventCount: 1]
02-13 21:00:49.780 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:00:49.780 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2583, eventCount: 0, sticky: true]
02-13 21:00:49.792 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2584, eventCount: 1]
02-13 21:00:49.792 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.517673,77.201173 hAcc=1100.0 et=+5d12h6m57s397ms alt=238.8000030517578 vAcc=19.270575]
╟─ Age: 1767ms, time: 1770996648025
02-13 21:00:49.792 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2584, eventCount: 0, sticky: true]
02-13 21:00:49.792 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:00:49.792 WARN [TSLocationManager onLocationResult]
⚠️ Rejected location: Location[fused 28.517673,77.201173 hAcc=1100.0 et=+5d12h6m57s397ms alt=238.8000030517578 vAcc=19.270575], metrics: com.transistorsoft.locationmanager.a.s@2da61aa, decision: LocationFilterResult{decision=REJECTED, reason='low-accuracy', selected=0.0, raw=1332.676025390625, effective=214.6420366407301, anomaly=true, acc(cur)=1100.0, acc(prev)=200.0}
02-13 21:00:50.996 INFO [g0 a]
╔═════════════════════════════════════════════
║ Location-provider change: true
╠═════════════════════════════════════════════
╟─ GPS: true
╟─ Network: true
╟─ AP Mode: false
02-13 21:00:51.005 DEBUG [TSGeofenceManager$d run]
╔═════════════════════════════════════════════
║ TSGeofenceManager monitoring 0/0
╠═════════════════════════════════════════════
╚═════════════════════════════════════════════
02-13 21:00:51.005 DEBUG [HttpService a]
╔═════════════════════════════════════════════
║ 📶 Connectivity change: connected? false
╠═════════════════════════════════════════════
02-13 21:00:51.038 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ providerchange LocationResult: 3 (3013ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.517673,77.201173 hAcc=1100.0 et=+5d12h6m57s397ms alt=238.8000030517578 vAcc=19.270575], time: 1770996648025
02-13 21:00:51.053 DEBUG [LocationAuthorization withPermission]
ℹ️ LocationAuthorization: Permission granted
02-13 21:00:51.078 DEBUG [AbstractService a]
🎾 start [LocationRequestService startId: 1, eventCount: 1]
02-13 21:00:51.080 INFO [SingleLocationRequest startUpdatingLocation]
🔵 [SingleLocationRequest start, action: 3, requestId: 3]
02-13 21:00:51.082 DEBUG [AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true]
02-13 21:00:53.042 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2585, eventCount: 1]
02-13 21:00:53.043 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:00:53.044 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2585, eventCount: 0, sticky: true]
02-13 21:00:53.057 DEBUG [AbstractService a]
🎾 3:3 [LocationRequestService startId: 2, eventCount: 1]
02-13 21:00:53.058 INFO [LocationRequestService b]
ℹ️ Location availability: false
02-13 21:00:53.059 DEBUG [AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 2, eventCount: 0, sticky: true]
02-13 21:00:53.123 DEBUG [HttpService a]
╔═════════════════════════════════════════════
║ 📶 Connectivity change: connected? true
╠═════════════════════════════════════════════
02-13 21:00:54.128 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 0)
╠═════════════════════════════════════════════
02-13 21:01:50.989 WARN [SingleLocationRequest finish]
⚠️ 📍 SingleLocationRequest TIMEOUT: 3
02-13 21:01:50.991 WARN [TSLocationManager onLocationError]
⚠️ TSLocationManager received location error: 408
02-13 21:01:50.993 WARN [BackgroundGeolocation _onLocationError]
⚠️ Location error: 408
02-13 21:01:51.007 ERROR [TSLog e]
‼️ EventManager: listener threw exception
java.lang.ClassCastException: com.transistorsoft.locationmanager.event.LocationErrorEvent cannot be cast to java.lang.Integer
at com.transistorsoft.locationmanager.adapter.o.onEvent(SourceFile:1)
at com.transistorsoft.locationmanager.event.EventManager.b(SourceFile:21)
at com.transistorsoft.locationmanager.event.EventManager.a(SourceFile:7)
at com.transistorsoft.locationmanager.event.EventManager.emit(SourceFile:76)
at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation._onLocationError(SourceFile:85)
at java.lang.reflect.Method.invoke(Native Method)
at ug.c.i(SourceFile:11)
at ug.c.p(SourceFile:87)
at ug.c.o(SourceFile:43)
at ug.c.n(SourceFile:27)
at ug.c.m(SourceFile:42)
at com.transistorsoft.locationmanager.location.TSLocationManager.onLocationError(SourceFile:54)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.finish(SourceFile:200)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.h(SourceFile:14)
at com.transistorsoft.locationmanager.location.SingleLocationRequest.b(SourceFile:1)
at com.transistorsoft.locationmanager.location.f.run(SourceFile:1)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:258)
at android.os.Looper.loop(Looper.java:356)
at android.app.ActivityThread.main(ActivityThread.java:8836)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:966)
02-13 21:01:51.018 DEBUG [AbstractService b]
🎾 STOP [LocationRequestService startId: 3, eventCount: 1]
02-13 21:01:51.019 DEBUG [AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 3, eventCount: 0, sticky: false]
02-13 21:01:51.019 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ providerchange LocationResult: 3 (0ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.517673,77.201173 hAcc=1100.0 et=+5d12h8m0s391ms alt=238.8000030517578 vAcc=19.270575], time: 1770996711019
02-13 21:01:51.020 INFO [TSLocationManager onSingleLocationResult]
🔵 Acquired providerchange position
02-13 21:01:51.039 INFO [b0 a]
✅ 💾 INSERT: 4321c081-ad39-49e8-be3f-c4e3d51aa537
02-13 21:01:51.053 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
02-13 21:01:51.108 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 1506
02-13 21:01:51.113 DEBUG [b0 a]
✅ Locked 1 records
02-13 21:01:51.113 INFO [HttpService a]
🔵 HTTP POST batch (1)
02-13 21:01:51.222 DEBUG [AbstractService f]
⚙️︎ LocationRequestService.stopSelfResult(3): true
02-13 21:01:51.223 DEBUG [AbstractService onDestroy]
🔴 LocationRequestService stopped
02-13 21:01:57.003 INFO [HttpService$e onResponse]
🔵 Response: 204
02-13 21:01:57.004 DEBUG [b0 a]
✅ DELETED: (1)
02-13 21:01:57.007 DEBUG [b0 a]
✅ Locked 0 records
02-13 21:01:57.008 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 1506
02-13 21:02:06.880 DEBUG [LifecycleManager setHeadless]
╔═════════════════════════════════════════════
║ ☯️ HeadlessMode? true
╠═════════════════════════════════════════════
02-13 21:02:06.887 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 1ms (jobID: -1708771588)
02-13 21:02:06.890 DEBUG [BackgroundGeolocation a]
🔴 Cleared callbacks
02-13 21:02:06.892 INFO [BackgroundGeolocation e]
╔═════════════════════════════════════════════
║ MainActivity was destroyed
╠═════════════════════════════════════════════
╟─ stopOnTerminate: false
╟─ enabled: true
02-13 21:02:11.909 INFO [ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
02-13 21:02:11.912 DEBUG [TSLog d] 💀 event: terminate
02-13 21:02:12.168 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 2
02-13 21:03:27.908 DEBUG [LifecycleManager onStart] ☯️ onStart
02-13 21:03:27.912 DEBUG [LifecycleManager onResume] ☯️ onResume
02-13 21:03:28.011 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: true
02-13 21:03:28.209 DEBUG [LocationAuthorization withBackgroundPermission]
ℹ️ LocationAuthorization: Permission granted
02-13 21:03:28.211 DEBUG [TSGeofenceManager$d run]
╔═════════════════════════════════════════════
║ TSGeofenceManager monitoring 0/0
╠═════════════════════════════════════════════
╚═════════════════════════════════════════════
02-13 21:03:28.363 DEBUG [HttpService startMonitoringConnectivityChanges]
🎾 Start monitoring connectivity changes
02-13 21:03:28.363 DEBUG [DeviceSettings startMonitoringPowerSaveChanges]
🎾 Start monitoring powersave changes
02-13 21:03:28.363 INFO [ActivityRecognitionService d]
🎾 Start motion-activity updates
02-13 21:03:28.384 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 4 (160359ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.517673,77.201173 hAcc=1100.0 et=+5d12h6m57s397ms alt=238.8000030517578 vAcc=19.270575], time: 1770996648025
02-13 21:03:28.396 DEBUG [LocationAuthorization withPermission]
ℹ️ LocationAuthorization: Permission granted
02-13 21:03:28.414 DEBUG [AbstractService a]
🎾 start [LocationRequestService startId: 1, eventCount: 1]
02-13 21:03:28.416 INFO [SingleLocationRequest startUpdatingLocation]
🔵 [SingleLocationRequest start, action: 1, requestId: 4]
02-13 21:03:28.417 DEBUG [AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true]
02-13 21:03:28.435 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: false
02-13 21:03:28.437 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
02-13 21:03:28.609 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: true
02-13 21:03:28.610 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: TERMINATE_EVENT
02-13 21:03:28.616 DEBUG [TSLocationManagerActivity a] locationsettings
02-13 21:03:28.648 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: false
02-13 21:03:28.649 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
02-13 21:03:28.719 DEBUG [TSLocationManagerActivity onDestroy] locationsettings
02-13 21:03:28.799 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: true
02-13 21:03:28.800 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: TERMINATE_EVENT
02-13 21:03:28.827 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: false
02-13 21:03:28.829 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
02-13 21:03:28.928 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: true
02-13 21:03:28.930 INFO [TSScheduleManager cancelOneShot]
⏰ Cancel OneShot: TERMINATE_EVENT
02-13 21:03:35.142 INFO [ServiceLaunchReceiver onReceive] ⚙️︎ ServiceLaunchReceiver -> ActivityRecognitionService
02-13 21:03:35.147 DEBUG [AbstractService a]
🎾 start [ActivityRecognitionService startId: 1, eventCount: 1]
02-13 21:03:35.148 DEBUG [ActivityRecognitionService a]
🚘 ️DetectedActivity [type=STILL, confidence=96]
02-13 21:03:35.150 DEBUG [AbstractService a]
⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false]
02-13 21:03:35.180 INFO [ServiceLaunchReceiver onReceive] ⚙️︎ ServiceLaunchReceiver -> ActivityRecognitionService
02-13 21:03:35.182 DEBUG [AbstractService a]
🎾 start [ActivityRecognitionService startId: 2, eventCount: 1]
02-13 21:03:35.183 INFO [ActivityRecognitionService a]
╔═════════════════════════════════════════════
║ Motion Transition Result
╠═════════════════════════════════════════════
╟─ 🎾 ENTER: in_vehicle
╚═════════════════════════════════════════════
02-13 21:03:35.184 DEBUG [AbstractService a]
⚙️︎ FINISH [ActivityRecognitionService startId: 2, eventCount: 0, sticky: false]
02-13 21:03:35.388 DEBUG [AbstractService f]
⚙️︎ ActivityRecognitionService.stopSelfResult(2): true
02-13 21:03:35.392 DEBUG [AbstractService onDestroy]
🔴 ActivityRecognitionService stopped
02-13 21:03:37.609 DEBUG [LifecycleManager c] ☯️ onWindowFocusChanged: false
02-13 21:03:37.613 INFO [TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
02-13 21:03:38.909 DEBUG [LifecycleManager setHeadless]
╔═════════════════════════════════════════════
║ ☯️ HeadlessMode? true
╠═════════════════════════════════════════════
02-13 21:03:38.911 INFO [TSScheduleManager oneShot]
⏰ Oneshot TERMINATE_EVENT is already pending
02-13 21:03:38.911 DEBUG [BackgroundGeolocation a]
🔴 Cleared callbacks
02-13 21:03:38.917 INFO [BackgroundGeolocation e]
╔═════════════════════════════════════════════
║ MainActivity was destroyed
╠═════════════════════════════════════════════
╟─ stopOnTerminate: false
╟─ enabled: true
02-13 21:03:39.566 DEBUG [LifecycleManager onPause] ☯️ onPause
02-13 21:03:39.567 DEBUG [LifecycleManager onStop] ☯️ onStop
02-13 21:03:47.634 INFO [ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
02-13 21:03:47.636 DEBUG [TSLog d] 💀 event: terminate
02-13 21:03:47.638 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 3
02-13 21:12:24.298 INFO [ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: http_flush
╠═════════════════════════════════════════════
02-13 21:31:43.218 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2586, eventCount: 1]
02-13 21:31:43.237 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:31:43.238 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2586, eventCount: 0, sticky: true]
02-13 21:31:43.239 DEBUG [AbstractService a]
🎾 1:4 [LocationRequestService startId: 2, eventCount: 1]
02-13 21:31:43.240 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2587, eventCount: 1]
02-13 21:31:43.243 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.667865,77.228165 hAcc=26.247 et=+5d12h37m50s165ms alt=172.90000915527344 vAcc=2.7226367]
╟─ Age: 2449ms, time: 1770998500793
02-13 21:31:43.243 INFO [TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 4 (2450ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.667865,77.228165 hAcc=26.247 et=+5d12h37m50s165ms alt=172.90000915527344 vAcc=2.7226367], time: 1770998500793
02-13 21:31:43.244 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2587, eventCount: 0, sticky: true]
02-13 21:31:43.249 INFO [Odometer b]
ℹ️ Update odometer: 39295.47 (± 684.61m)
02-13 21:31:43.250 INFO [TSLocationManager onSingleLocationResult]
🔵 MOTIONCHANGE isMoving=true df=0.0 — resetting short-term filter state
02-13 21:31:43.250 INFO [TSLocationManager onSingleLocationResult]
🔵 Acquired motionchange position, isMoving: true
02-13 21:31:43.262 INFO [TSLocationManager a]
🔴 Location-services: OFF
02-13 21:31:43.264 DEBUG [TSLog d] 💀 event: location
02-13 21:31:43.269 INFO [TSLocationManager requestLocationUpdates]
🎾 Location-services: ON
02-13 21:31:43.271 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:31:43.271 DEBUG [TSLocationManager onLocationResult] *** LocationFilterResult: LocationFilterResult{decision=ACCEPTED, reason='ok', selected=849.0852540950128, raw=16853.80859375, effective=15753.49549967387, anomaly=false, acc(cur)=26.247, acc(prev)=1100.0}
02-13 21:31:43.271 DEBUG [AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 2, eventCount: 0, sticky: false]
02-13 21:31:43.274 INFO [b0 a]
✅ 💾 INSERT: e5a3741c-53ff-44b9-952a-7a51933bd9e1
02-13 21:31:43.277 INFO [b0 a]
✅ 💾 INSERT: ed501e9f-cf74-4480-9a5a-ae493c89218d
02-13 21:31:43.279 INFO [HttpService flush]
ℹ️ HttpService is busy
02-13 21:31:43.280 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 2)
╠═════════════════════════════════════════════
02-13 21:31:43.287 DEBUG [AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 3, eventCount: 0, sticky: false]
02-13 21:31:43.287 DEBUG [AbstractService b]
🎾 STOP [LocationRequestService startId: 3, eventCount: 1]
02-13 21:31:43.290 INFO [ActivityRecognitionService d]
🎾 Start motion-activity updates
02-13 21:31:43.291 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2588, eventCount: 1]
02-13 21:31:43.291 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:31:43.291 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.667865,77.228165 hAcc=26.247 et=+5d12h37m50s165ms alt=172.90000915527344 vAcc=2.7226367]
╟─ Age: 2498ms, time: 1770998500793
02-13 21:31:43.291 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2588, eventCount: 0, sticky: true]
02-13 21:31:43.291 DEBUG [TSLocationManager onLocationResult] *** LocationFilterResult: LocationFilterResult{decision=ADJUSTED, reason='kinematic-cap', selected=0.0, raw=0.0, effective=0.0, anomaly=false, acc(cur)=26.247, acc(prev)=26.247}
02-13 21:31:43.291 DEBUG [TSLog d] 💀 event: motionchange
02-13 21:31:43.292 INFO [b0 a]
✅ 💾 INSERT: 073a9d18-1dcd-4055-9c5a-e0a32e9ee00e
02-13 21:31:43.293 DEBUG [TSLog d] 💀 event: location
02-13 21:31:43.293 DEBUG [TSLog d] 💀 event: location
02-13 21:31:43.294 INFO [HttpService flush]
ℹ️ HttpService is busy
02-13 21:31:43.312 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 4
02-13 21:31:43.313 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 5
02-13 21:31:43.313 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 6
02-13 21:31:43.313 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 7
02-13 21:31:43.322 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 1507
02-13 21:31:43.326 DEBUG [b0 a]
✅ Locked 3 records
02-13 21:31:43.326 INFO [HttpService a]
🔵 HTTP POST batch (3)
02-13 21:31:43.491 DEBUG [AbstractService f]
⚙️︎ LocationRequestService.stopSelfResult(3): true
02-13 21:31:43.491 DEBUG [AbstractService onDestroy]
🔴 LocationRequestService stopped
02-13 21:31:45.798 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2589, eventCount: 1]
02-13 21:31:45.801 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:31:45.801 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2589, eventCount: 0, sticky: true]
02-13 21:31:48.180 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2590, eventCount: 1]
02-13 21:31:48.180 INFO [TrackingService b]
ℹ️ Location availability: true
02-13 21:31:48.181 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2590, eventCount: 0, sticky: true]
02-13 21:31:48.186 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2591, eventCount: 1]
02-13 21:31:48.187 DEBUG [TrackingService c]
╔═════════════════════════════════════════════
║ TrackingService: LocationResult
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 28.668122,77.228127 hAcc=55.014 et=+5d12h37m57s499ms alt=159.00001525878906 vAcc=18.990982]
╟─ Age: 60ms, time: 1770998508127
02-13 21:31:48.187 DEBUG [TSLocationManager onLocationResult]
╔═════════════════════════════════════════════
║ Process LocationResult
╠═════════════════════════════════════════════
02-13 21:31:48.187 DEBUG [TSLocationManager onLocationResult] *** LocationFilterResult: LocationFilterResult{decision=ADJUSTED, reason='implied-speed', selected=440.03999999999996, raw=28.68781280517578, effective=0.0, anomaly=false, acc(cur)=55.014, acc(prev)=26.247}
02-13 21:31:48.187 INFO [Odometer b]
ℹ️ Update odometer: 39324.16 (± 689.01m)
02-13 21:31:48.187 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2591, eventCount: 0, sticky: true]
02-13 21:31:48.188 INFO [b0 a]
✅ 💾 INSERT: 4c30684e-b90a-4706-8c6f-f5d12c35d1b3
02-13 21:31:48.191 INFO [HttpService flush]
ℹ️ HttpService is busy
02-13 21:31:48.191 DEBUG [TSLog d] 💀 event: location
02-13 21:31:48.192 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 8
02-13 21:31:53.137 DEBUG [AbstractService a]
🎾 start [TrackingService startId: 2592, eventCount: 1]
02-13 21:31:53.139 INFO [TrackingService b]
ℹ️ Location availability: false
02-13 21:31:53.140 DEBUG [AbstractService a]
⚙️︎ FINISH [TrackingService startId: 2592, eventCount: 0, sticky: true]
02-13 21:31:53.377 WARN [HttpService$e onResponse]
⚠️ Response: 401,
02-13 21:31:53.380 DEBUG [TSLog d] 💀 event: http
02-13 21:31:53.381 DEBUG [b0 b]
✅ UNLOCKED (3)
02-13 21:31:53.382 DEBUG [TSLog d] [onHeadlessJsTaskFinish] taskId: 9
02-13 21:31:53.382 INFO [BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 1507
02-13 21:31:53.409 INFO [BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 1508
02-13 21:31:54.277 DEBUG [TSAuthorization a] 🔑 Received refreshToken
02-13 21:31:54.278 DEBUG [TSAuthorization a] 🔑 Received accessToken candidate via key=access_token (priority=3)
02-13 21:31:54.285 DEBUG [TSAuthorization a] 🔑 Refresh token success
02-13 21:31:54.286 DEBUG [TSLog d] 💀 event: authorization
02-13 21:31:54.287 INFO [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 4)
Required Reading
Plugin Version
5.0.3
Mobile operating-system(s)
Device Manufacturer(s) and Model(s)
Nothing Phone 2A
Device operating-systems(s)
Android 15
React Native / Expo version
expo
What do you require assistance about?
I was testing this library while commuting home from the office via metro. It was working fine throughout the journey; however, during the ~30 minutes when the metro was underground, I noticed that the library stopped recognizing location updates and eventually crashed.
I would like to clarify a few points:
In low-signal or no-signal areas (such as underground), does the library rely on device movement detection?
Does it cache location data locally and sync/send it once network connectivity is restored?
Our business use case requires tracking the exact path covered by riders during an order and calculating the total distance based on that path. Since rider incentives are calculated using this distance, we require high precision in latitude/longitude data and want to avoid noisy or inaccurate pings.
I am attaching logs for the duration during which no location updates were received, along with my current configuration. Could you please confirm whether my configuration is appropriate for a high-precision tracking use case?
[Optional] Plugin Code and/or Config
[Optional] Relevant log output