transistorsoft / capacitor-background-geolocation

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
MIT License
92 stars 16 forks source link

Listeners doesn't emit event when app is relaunched with stopOnTerminate to false #231

Closed mrshlle closed 6 months ago

mrshlle commented 6 months ago

Your Environment

Expected Behavior

I should receive location or http event when a location is sent to my server.

Actual Behavior

Even if I listen to onHttp or onLocation, and my server show a new location and send a new response, nothing is returned in the app.

Context

When I start a watcher, and I listen to http event or location, everything works, but when the watcher is already running, with stopOnTerminate to false, when I kill the app and open it again, even if I call onHttp or onLocation, nothing is emitted.

Here is some code to illustrate this :

First I start a watcher (this is not exactly my code, but exactly what I do with your plugin)

const backTrack = this.mainService.user!.back_location // in this example, backTrack is true
await BackgroundGeolocation.setConfig({
  isMoving: true,
  stopOnTerminate: !backTrack,
  startOnBoot: backTrack
})
console.log(DateTime.local().toFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\''),'::: starting')
BackgroundGeolocation.start()
BackgroundGeolocation.onLocation((location) => {
  // use location
})
BackgroundGeolocation.onHttp((httpEvent) => {
  // use httpEvent
})

Then I kill the app.

At this point, everything works, here are some logs corresponding to this step, you can see some http events emitted, and the logs of my app when I receive them ``` 2024-02-09 17:38:02.667 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164518, pluginId: BackgroundGeolocation, methodName: getProviderState 2024-02-09 17:38:02.667 17171-17171 Capacitor com.bobility V callback: 6164518, pluginId: BackgroundGeolocation, methodName: getProviderState, methodData: {} 2024-02-09 17:38:02.669 17171-17244 Settings com.bobility W Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. 2024-02-09 17:38:02.680 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164519, pluginId: Geolocation, methodName: getCurrentPosition 2024-02-09 17:38:02.680 17171-17171 Capacitor com.bobility V callback: 6164519, pluginId: Geolocation, methodName: getCurrentPosition, methodData: {} 2024-02-09 17:38:03.043 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164520, pluginId: BackgroundGeolocation, methodName: setConfig 2024-02-09 17:38:03.043 17171-17171 Capacitor com.bobility V callback: 6164520, pluginId: BackgroundGeolocation, methodName: setConfig, methodData: {"options":{"isMoving":true}} 2024-02-09 17:38:03.045 17171-17244 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.045 17171-17244 TSLocationManager com.bobility D [c.t.l.adapter.TSConfig e] ℹ️ Persist config, dirty: [isMoving] 2024-02-09 17:38:03.065 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:03.058Z ::: listen geoloc 2024-02-09 17:38:03.065 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:03.061Z ::: onHttp 2024-02-09 17:38:03.068 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164521, pluginId: BackgroundGeolocation, methodName: setConfig 2024-02-09 17:38:03.068 17171-17171 Capacitor com.bobility V callback: 6164521, pluginId: BackgroundGeolocation, methodName: setConfig, methodData: {"options":{"stopOnTerminate":true,"startOnBoot":false}} 2024-02-09 17:38:03.069 17171-17244 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.070 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164522, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-09 17:38:03.070 17171-17171 Capacitor com.bobility V callback: 6164522, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"location"} 2024-02-09 17:38:03.072 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164523, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-09 17:38:03.072 17171-17171 Capacitor com.bobility V callback: 6164523, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"http"} 2024-02-09 17:38:03.075 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:03.073Z ::: starting 2024-02-09 17:38:03.077 17171-17171 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 6164524, pluginId: BackgroundGeolocation, methodName: start 2024-02-09 17:38:03.077 17171-17171 Capacitor com.bobility V callback: 6164524, pluginId: BackgroundGeolocation, methodName: start, methodData: {} 2024-02-09 17:38:03.080 17171-17244 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.082 17171-17244 TSLocationManager com.bobility D [c.t.l.u.LocationAuthorization withBackgroundPermission] ℹ️ LocationAuthorization: Permission granted 2024-02-09 17:38:03.088 17171-17602 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.088 17171-17602 TSLocationManager com.bobility I - Enable: false → true, trackingMode: 1 2024-02-09 17:38:03.090 17171-17602 TSLocationManager com.bobility I [c.t.l.g.TSGeofenceManager start] 🎾 Start monitoring geofences 2024-02-09 17:38:03.093 17171-17602 TSLocationManager com.bobility D [c.t.l.http.HttpService startMonitoringConnectivityChanges] 🎾 Start monitoring connectivity changes 2024-02-09 17:38:03.105 17171-17306 Settings com.bobility W Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value. 2024-02-09 17:38:03.106 17171-17602 TSLocationManager com.bobility D [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges] 🎾 Start monitoring powersave changes 2024-02-09 17:38:03.108 17171-17306 TSLocationManager com.bobility D [c.t.l.http.HttpService a] ╔═════════════════════════════════════════════ ║ 📶 Connectivity change: connected? true ╠═════════════════════════════════════════════ 2024-02-09 17:38:03.109 17171-17602 TSLocationManager com.bobility I [c.t.l.s.ActivityRecognitionService start] 🎾 Start motion-activity updates 2024-02-09 17:38:03.112 17171-17602 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.113 17171-17602 TSLocationManager com.bobility I [c.t.l.service.HeartbeatService stop] 🔴 Stop heartbeat 2024-02-09 17:38:03.117 17171-17602 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.124 17171-17602 TSLocationManager com.bobility I [c.t.l.service.TrackingService changePace] 🔵 setPace: true → true 2024-02-09 17:38:03.142 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 motionchange [TrackingService startId: 1, eventCount: 1] 2024-02-09 17:38:03.143 17171-17171 TSLocationManager com.bobility I [c.t.l.service.TrackingService k] ╔═════════════════════════════════════════════ ║ TrackingService motionchange: true ╠═════════════════════════════════════════════ 2024-02-09 17:38:03.144 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [TrackingService startId: 1, eventCount: 0, sticky: true] 2024-02-09 17:38:03.155 17171-17171 TSLocationManager com.bobility I [c.t.l.l.TSLocationManager a] ╔═════════════════════════════════════════════ ║ motionchange LocationResult: 2 (433ms old) ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 43.294121,-0.371131 hAcc=100.0 et=+7d21h12m30s714ms alt=270.1999816894531 vAcc=62.816647 {Bundle[{}]}], time: 1707496682721 2024-02-09 17:38:03.177 17171-17171 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager a] Median accuracy: 18.467 2024-02-09 17:38:03.181 17171-17171 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:03.181 17171-17171 TSLocationManager com.bobility D [c.t.l.u.LocationAuthorization withPermission] ℹ️ LocationAuthorization: Permission granted 2024-02-09 17:38:03.193 17171-17171 Capacitor/...tionPlugin com.bobility V Notifying listeners for event location 2024-02-09 17:38:03.200 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:03.198Z ::: new loc : [object Object] 2024-02-09 17:38:03.217 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:03.212Z ::: new loc : [object Object] 2024-02-09 17:38:03.223 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 start [LocationRequestService startId: 1, eventCount: 1] 2024-02-09 17:38:03.224 17171-17602 TSLocationManager com.bobility I [c.t.l.l.SingleLocationRequest startUpdatingLocation] 🔵 [SingleLocationRequest start, action: 1, requestId: 2] 2024-02-09 17:38:03.227 17171-17602 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 1, eventCount: 0, sticky: true] 2024-02-09 17:38:03.361 17171-17171 Capacitor/AppPlugin com.bobility V Notifying listeners for event pause 2024-02-09 17:38:03.361 17171-17171 Capacitor/AppPlugin com.bobility D No listeners found for event pause 2024-02-09 17:38:03.362 17171-17171 Capacitor com.bobility D App paused 2024-02-09 17:38:03.411 17171-17171 TSLocationManager com.bobility D [c.t.l.a.TSLocationManagerActivity a] locationsettings 2024-02-09 17:38:03.412 17171-17171 TSLocationManager com.bobility D [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1 2024-02-09 17:38:03.415 17171-17171 IS_CTS_MODE com.bobility D false 2024-02-09 17:38:03.415 17171-17171 MULTI_WIND...CH_ENABLED com.bobility D false 2024-02-09 17:38:03.418 17171-17171 DecorView[] com.bobility D getWindowModeFromSystem windowmode is 1 2024-02-09 17:38:03.433 17171-17171 ForceDarkHelperStubImpl com.bobility I setViewRootImplForceDark: true for com.transistorsoft.locationmanager.activity.TSLocationManagerActivity@15eb350, reason: forceDarkAllowed 2024-02-09 17:38:03.433 17171-17171 ForceDarkHelperStubImpl com.bobility I setViewRootImplForceDark: true for com.transistorsoft.locationmanager.activity.TSLocationManagerActivity@15eb350, reason: forceDarkAllowed 2024-02-09 17:38:03.459 17171-17171 TSLocationManager com.bobility D [c.t.l.a.TSLocationManagerActivity c] eventCount: 0 2024-02-09 17:38:03.490 24679-24802 ActivityManagerWrapper pid-24679 E getRecentTasks: taskId=1207 userId=0 baseIntent=Intent { act=locationsettings flag=276824064 cmp=ComponentInfo{com.bobility/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} } 2024-02-09 17:38:03.494 24679-24802 ActivityManagerWrapper pid-24679 E getRecentTasks: taskId=1207 userId=0 baseIntent=Intent { act=locationsettings flag=276824064 cmp=ComponentInfo{com.bobility/com.transistorsoft.locationmanager.activity.TSLocationManagerActivity} } 2024-02-09 17:38:03.512 17171-17171 DecorView[] com.bobility D onWindowFocusChanged hasWindowFocus true 2024-02-09 17:38:03.518 17171-17171 DecorView[] com.bobility D onWindowFocusChanged hasWindowFocus false 2024-02-09 17:38:03.525 17171-17171 Capacitor/AppPlugin com.bobility D Firing change: true 2024-02-09 17:38:03.526 17171-17171 Capacitor/AppPlugin com.bobility V Notifying listeners for event appStateChange 2024-02-09 17:38:03.526 17171-17171 Capacitor/AppPlugin com.bobility D No listeners found for event appStateChange 2024-02-09 17:38:03.526 17171-17171 Capacitor/AppPlugin com.bobility V Notifying listeners for event resume 2024-02-09 17:38:03.526 17171-17171 Capacitor/AppPlugin com.bobility D No listeners found for event resume 2024-02-09 17:38:03.529 17171-17171 Capacitor com.bobility D App resumed 2024-02-09 17:38:03.557 17171-17171 TSLocationManager com.bobility D [c.t.l.a.TSLocationManagerActivity onDestroy] 2024-02-09 17:38:03.610 24679-24802 ActivityManagerWrapper pid-24679 E getRecentTasks: taskId=1205 userId=0 baseIntent=Intent { act=android.intent.action.MAIN flag=270532608 cmp=ComponentInfo{com.bobility/io.ionic.starter.MainActivity} } 2024-02-09 17:38:03.685 17171-17171 MediaPlayer com.bobility V resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false 2024-02-09 17:38:03.685 17171-17171 MediaPlayer com.bobility V cleanDrmObj: mDrmObj=null mDrmSessionId=null 2024-02-09 17:38:04.109 17171-17602 TSLocationManager com.bobility I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 0) ╠═════════════════════════════════════════════ 2024-02-09 17:38:06.169 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 1:2 [LocationRequestService startId: 2, eventCount: 1] 2024-02-09 17:38:06.171 17171-17602 TSLocationManager com.bobility I [c.t.l.l.TSLocationManager a] ╔═════════════════════════════════════════════ ║ motionchange LocationResult: 2 (2778ms old) ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 43.294093,-0.371266 hAcc=14.499 et=+7d21h12m31s386ms alt=268.29998779296875 vAcc=3.6548693 {Bundle[{}]}], time: 1707496683393 2024-02-09 17:38:06.174 17171-17602 TSLocationManager com.bobility I [c.t.l.l.TSLocationManager onSingleLocationResult] 🔵 Acquired motionchange position, isMoving: true 2024-02-09 17:38:06.175 17171-17602 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager a] Median accuracy: 16.483 2024-02-09 17:38:06.196 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService b] 🎾 STOP [LocationRequestService startId: 3, eventCount: 2] 2024-02-09 17:38:06.196 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 3, eventCount: 1, sticky: false] 2024-02-09 17:38:06.200 17171-17171 Capacitor/...tionPlugin com.bobility V Notifying listeners for event location 2024-02-09 17:38:06.209 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.202Z ::: new loc : [object Object] 2024-02-09 17:38:06.211 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.208Z ::: new loc : [object Object] 2024-02-09 17:38:06.224 17171-17602 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 17:38:06.225 17171-17602 TSLocationManager com.bobility I [c.t.l.l.TSLocationManager requestLocationUpdates] 🎾 Location-services: ON 2024-02-09 17:38:06.229 17171-17602 TSLocationManager com.bobility D [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1 2024-02-09 17:38:06.238 17171-17171 TSLocationManager com.bobility I [c.t.l.s.ActivityRecognitionService start] 🎾 Start motion-activity updates 2024-02-09 17:38:06.238 17171-17602 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [LocationRequestService startId: 2, eventCount: 0, sticky: false] 2024-02-09 17:38:06.238 17171-17656 TSLocationManager com.bobility I [c.t.l.d.s.SQLiteLocationDAO persist] ✅ INSERT: f225ebc4-e9c7-4e4d-aa12-ea762cbcfdfe 2024-02-09 17:38:06.242 17171-17656 TSLocationManager com.bobility I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 1) ╠═════════════════════════════════════════════ 2024-02-09 17:38:06.315 17171-17171 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 2 2024-02-09 17:38:06.322 17171-17656 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO first] ✅ Locked 1 records 2024-02-09 17:38:06.323 17171-17656 TSLocationManager com.bobility I [c.t.l.http.HttpService a] 🔵 HTTP POST: f225ebc4-e9c7-4e4d-aa12-ea762cbcfdfe 2024-02-09 17:38:06.442 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService f] ⚙️︎ LocationRequestService.stopSelfResult(3): true 2024-02-09 17:38:06.444 17171-17171 TSLocationManager com.bobility D [c.t.l.service.AbstractService onDestroy] 🔴 LocationRequestService stopped 2024-02-09 17:38:06.582 17171-17665 TSLocationManager com.bobility I [c.t.l.http.HttpService$f onResponse] 🔵 Response: 200 2024-02-09 17:38:06.583 17171-17665 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO destroy] ✅ DESTROY: f225ebc4-e9c7-4e4d-aa12-ea762cbcfdfe 2024-02-09 17:38:06.584 17171-17171 Capacitor/...tionPlugin com.bobility V Notifying listeners for event http 2024-02-09 17:38:06.594 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.589Z ::: http event 2024-02-09 17:38:06.595 17171-17665 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 2 2024-02-09 17:38:06.596 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.595Z ::: httpEvent : [object Object] 2024-02-09 17:38:06.597 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.596Z ::: status 200 2024-02-09 17:38:06.599 17171-17348 WM-WorkerWrapper com.bobility I Worker result SUCCESS for Work [ id=e33a38db-1c31-480c-a3a0-e95a79d7ce76, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ] 2024-02-09 17:38:06.610 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.605Z ::: http event 2024-02-09 17:38:06.610 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.606Z ::: httpEvent : [object Object] 2024-02-09 17:38:06.611 17171-17171 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T17:38:06.606Z ::: status 200 ```

Then I start the app again, it triggers a test to check if a ride is in progress, and if yes, then listen to the http and location events, the same way I did before. Here is the problem of listener that doesn't work.

You can see on the logs that the listener is well received by the plugin (at least something is written to the logs) ``` 2024-02-09 14:11:52.207 20302-20443 WM-WorkerWrapper com.bobility I Worker result SUCCESS for Work [ id=344f0c2a-6ea7-49ec-8d16-39e32f9ae70b, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ] 2024-02-09 14:11:52.810 20302-20302 MediaPlayer com.bobility V resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false 2024-02-09 14:11:52.810 20302-20302 MediaPlayer com.bobility V cleanDrmObj: mDrmObj=null mDrmSessionId=null 2024-02-09 14:11:52.895 20302-20319 AppScoutStateMachine com.bobility D 20302-ScoutStateMachinecreated 2024-02-09 14:11:52.938 20302-20302 IS_CTS_MODE com.bobility D false 2024-02-09 14:11:52.938 20302-20302 MULTI_WIND...CH_ENABLED com.bobility D false 2024-02-09 14:11:52.944 20302-20302 DecorView[] com.bobility D getWindowModeFromSystem windowmode is 1 2024-02-09 14:11:52.986 24679-24802 ActivityManagerWrapper com.miui.home E getRecentTasks: taskId=1142 userId=0 baseIntent=Intent { act=android.intent.action.MAIN flag=270532608 cmp=ComponentInfo{com.bobility/io.ionic.starter.MainActivity} } 2024-02-09 14:11:52.994 20302-20302 Capacitor com.bobility D Starting BridgeActivity 2024-02-09 14:11:53.001 20302-20302 Capacitor com.bobility D Registering plugin instance: CapacitorCookies 2024-02-09 14:11:53.003 20302-20302 Capacitor com.bobility D Registering plugin instance: WebView 2024-02-09 14:11:53.005 20302-20302 Capacitor com.bobility D Registering plugin instance: CapacitorHttp 2024-02-09 14:11:53.010 20302-20302 Capacitor com.bobility D Registering plugin instance: App 2024-02-09 14:11:53.011 20302-20302 Capacitor com.bobility D Registering plugin instance: Clipboard 2024-02-09 14:11:53.013 20302-20302 Capacitor com.bobility D Registering plugin instance: Geolocation 2024-02-09 14:11:53.016 20302-20302 Capacitor com.bobility D Registering plugin instance: Haptics 2024-02-09 14:11:53.023 20302-20302 Capacitor com.bobility D Registering plugin instance: Keyboard 2024-02-09 14:11:53.025 20302-20302 Capacitor com.bobility D Registering plugin instance: StatusBar 2024-02-09 14:11:53.026 20302-20302 Capacitor com.bobility D Registering plugin instance: BackgroundFetch 2024-02-09 14:11:53.026 20302-20302 BackgroundFetchPlugin com.bobility D load 2024-02-09 14:11:53.027 20302-20302 Capacitor com.bobility D Registering plugin instance: BackgroundGeolocation 2024-02-09 14:11:53.029 20302-20302 TSLocationManager com.bobility D [c.t.b.c.BackgroundGeolocationPlugin load] 2024-02-09 14:11:53.029 20302-20302 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 14:11:53.038 20302-20302 Capacitor com.bobility W Unable to read file at path public/plugins 2024-02-09 14:11:53.038 20302-20302 Capacitor com.bobility D Loading app at http://localhost 2024-02-09 14:11:53.052 20302-20302 Capacitor com.bobility D App started 2024-02-09 14:11:53.053 20302-20302 TSLocationManager com.bobility D [c.t.l.l.LifecycleManager onStart] ☯️ onStart 2024-02-09 14:11:53.054 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/ 2024-02-09 14:11:53.054 20302-20302 TSBackgroundFetch com.bobility D ☯️ onStart 2024-02-09 14:11:53.061 20302-20302 Capacitor/AppPlugin com.bobility D No listeners found for event appStateChange 2024-02-09 14:11:53.064 20302-20302 TSLocationManager com.bobility I [c.t.l.s.TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: TERMINATE_EVENT 2024-02-09 14:11:53.072 20302-20302 Capacitor com.bobility D App resumed 2024-02-09 14:11:53.073 20302-20302 TSLocationManager com.bobility D [c.t.l.l.LifecycleManager onResume] ☯️ onResume 2024-02-09 14:11:53.074 20302-20302 TSBackgroundFetch com.bobility D ☯️ onResume 2024-02-09 14:11:53.084 20302-20302 ForceDarkHelperStubImpl com.bobility I setViewRootImplForceDark: true for io.ionic.starter.MainActivity@e36efe4, reason: forceDarkAllowed 2024-02-09 14:11:53.084 20302-20302 ForceDarkHelperStubImpl com.bobility I setViewRootImplForceDark: true for io.ionic.starter.MainActivity@e36efe4, reason: forceDarkAllowed 2024-02-09 14:11:53.144 20302-20370 chromium com.bobility W [WARNING:display_webview.cc(32)] WebView overlays are enabled! 2024-02-09 14:11:53.185 20302-20302 DecorView[] com.bobility D onWindowFocusChanged hasWindowFocus true 2024-02-09 14:11:53.421 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/runtime.c5bc6968c45bd633.js 2024-02-09 14:11:53.422 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/polyfills.b4e8aa928519df4d.js 2024-02-09 14:11:53.424 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/main.0f8926332027e85e.js 2024-02-09 14:11:53.485 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/styles.52a88ebb8fea62ef.css 2024-02-09 14:11:53.745 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/common.d67bee62714a177a.js 2024-02-09 14:11:53.751 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/53.4041b227b28eba5c.js 2024-02-09 14:11:53.759 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/4908.8f66c2a2962b35f1.js 2024-02-09 14:11:53.789 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/5652.5b9ad8f4baf6ebc4.js 2024-02-09 14:11:53.793 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/6556.8fdfd388ae101c69.js 2024-02-09 14:11:53.820 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/6703.a0dc8e3a332af9d1.js 2024-02-09 14:11:53.822 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/9667.4cdfa0446451e643.js 2024-02-09 14:11:53.823 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/3729.9d3ac2b68b255854.js 2024-02-09 14:11:53.825 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/9485.53deb9305471aba0.js 2024-02-09 14:11:53.827 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/7816.1e981bdced54895f.js 2024-02-09 14:11:53.828 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/8465.b32bf795f19c1076.js 2024-02-09 14:11:53.846 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/assets/fonts/Inter/static/Inter-Medium.ttf 2024-02-09 14:11:53.867 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/5483.6139bc08a3ad779c.js 2024-02-09 14:11:53.870 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/126.c0f9c99c4d6565a8.js 2024-02-09 14:11:53.873 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/6535.b398cc4c8878edbf.js 2024-02-09 14:11:53.877 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/3952.c9321286db4ab725.js 2024-02-09 14:11:53.881 20302-20355 Capacitor com.bobility D Handling local request: http://localhost/2783.bd122a2921ab7c84.js 2024-02-09 14:11:53.883 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/993.54560de5eb5992b2.js 2024-02-09 14:11:53.888 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/4318.747b0ebf53eedcd3.js 2024-02-09 14:11:53.916 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/6029.40b63ceb5bf410fd.js 2024-02-09 14:11:53.948 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/2862.97ac448a38ba2997.js 2024-02-09 14:11:53.951 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/2843.5d280dfecf5ff5b6.js 2024-02-09 14:11:53.953 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/5735.a879413f57371b0d.js 2024-02-09 14:11:54.057 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/9840.8cd1ff13ac10b11e.js 2024-02-09 14:11:54.087 20302-20302 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T14:11:54.080Z ::: initiate service 2024-02-09 14:11:54.088 20302-20302 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T14:11:54.084Z ::: preferences 2024-02-09 14:11:54.088 20302-20302 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T14:11:54.086Z ::: listen geoloc 2024-02-09 14:11:54.092 20302-20302 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T14:11:54.087Z ::: onHttp 2024-02-09 14:11:54.105 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363756, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-09 14:11:54.105 20302-20302 Capacitor com.bobility V callback: 12363756, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"location"} 2024-02-09 14:11:54.105 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363757, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-09 14:11:54.105 20302-20302 Capacitor com.bobility V callback: 12363757, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"http"} 2024-02-09 14:11:54.132 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/438.dbc1cf7371fdf498.js 2024-02-09 14:11:54.134 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/8372.26857bc182047c78.js 2024-02-09 14:11:54.136 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/4711.14ad781f18816b36.js 2024-02-09 14:11:54.170 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/2349.6bd1739bf2339945.js 2024-02-09 14:11:54.181 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363758, pluginId: Keyboard, methodName: addListener 2024-02-09 14:11:54.181 20302-20302 Capacitor com.bobility V callback: 12363758, pluginId: Keyboard, methodName: addListener, methodData: {"eventName":"keyboardWillShow"} 2024-02-09 14:11:54.187 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363759, pluginId: Keyboard, methodName: addListener 2024-02-09 14:11:54.187 20302-20302 Capacitor com.bobility V callback: 12363759, pluginId: Keyboard, methodName: addListener, methodData: {"eventName":"keyboardWillHide"} 2024-02-09 14:11:54.227 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363760, pluginId: StatusBar, methodName: setStyle 2024-02-09 14:11:54.228 20302-20302 Capacitor com.bobility V callback: 12363760, pluginId: StatusBar, methodName: setStyle, methodData: {"style":"LIGHT"} 2024-02-09 14:11:54.239 20302-20302 DecorView[] com.bobility D getWindowModeFromSystem windowmode is 1 2024-02-09 14:11:54.239 20302-20302 DecorView[] com.bobility D updateDecorCaptionStatus displayWindowDecor is false 2024-02-09 14:11:54.253 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/svg/storefront.svg 2024-02-09 14:11:54.253 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/svg/bicycle.svg 2024-02-09 14:11:54.256 20302-20339 Capacitor com.bobility D Handling local request: http://localhost/svg/person.svg 2024-02-09 14:11:54.260 20302-20302 Capacitor/Console com.bobility I File: http://localhost/ - Line 325 - Msg: undefined 2024-02-09 14:11:54.260 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/svg/add.svg 2024-02-09 14:11:54.268 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/svg/navigate.svg 2024-02-09 14:11:54.271 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/svg/caret-back.svg 2024-02-09 14:11:54.272 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/svg/caret-forward.svg 2024-02-09 14:11:54.275 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/svg/chevron-down.svg 2024-02-09 14:11:54.277 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/9958.7d37eb84fa29cc15.js 2024-02-09 14:11:54.313 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/8939.f65216c0be30644a.js 2024-02-09 14:11:54.403 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/3838.cfb45e154ac79bad.js 2024-02-09 14:11:54.407 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363761, pluginId: App, methodName: addListener 2024-02-09 14:11:54.407 20302-20302 Capacitor com.bobility V callback: 12363761, pluginId: App, methodName: addListener, methodData: {"eventName":"backButton"} 2024-02-09 14:11:54.408 20302-20337 Capacitor com.bobility D Handling local request: http://localhost/4470.0e398feb03436f5e.js 2024-02-09 14:11:54.410 20302-20336 Capacitor com.bobility D Handling local request: http://localhost/assets/icon/favicon.png 2024-02-09 14:11:54.535 20302-20324 RenderInspector com.bobility W DequeueBuffer time out on com.bobility/io.ionic.starter.MainActivity, count=1, avg=20 ms, max=20 ms. 2024-02-09 14:11:54.555 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363762, pluginId: BackgroundGeolocation, methodName: setConfig 2024-02-09 14:11:54.555 20302-20302 Capacitor com.bobility V callback: 12363762, pluginId: BackgroundGeolocation, methodName: setConfig, methodData: {"options":{"isMoving":true}} 2024-02-09 14:11:54.556 20302-21555 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-09 14:11:54.688 20302-20302 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T14:11:54.686Z ::: listen geoloc 2024-02-09 14:11:54.691 20302-20302 Capacitor/Console com.bobility I File: http://localhost/main.0f8926332027e85e.js - Line 1 - Msg: 2024-02-09T14:11:54.687Z ::: onHttp 2024-02-09 14:11:54.694 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363763, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-09 14:11:54.694 20302-20302 Capacitor com.bobility V callback: 12363763, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"location"} 2024-02-09 14:11:54.694 20302-20302 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 12363764, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-09 14:11:54.694 20302-20302 Capacitor com.bobility V callback: 12363764, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"http"} 2024-02-09 14:11:55.033 20302-20302 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 start [TrackingService startId: 15, eventCount: 1] 2024-02-09 14:11:55.035 20302-20302 TSLocationManager com.bobility D [c.t.l.service.TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 43.294064,-0.371166 hAcc=6.087 et=+7d17h46m22s968ms alt=270.1999816894531 vAcc=3.6374865 vel=0.2978144 sAcc=0.19209373 bear=250.01582 bAcc=45.0 {Bundle[{}]}] ╟─ Age: 59ms, time: 1707484314975 2024-02-09 14:11:55.036 20302-21159 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ 2024-02-09 14:11:55.037 20302-21159 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager a] Median accuracy: 13.647 2024-02-09 14:11:55.038 20302-20302 TSLocationManager com.bobility I [c.t.l.service.TrackingService b] ℹ️ Distance from stoppedAtLocation: -11.258391 2024-02-09 14:11:55.038 20302-20302 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [TrackingService startId: 15, eventCount: 0, sticky: true] 2024-02-09 14:11:55.096 20302-21255 TSLocationManager com.bobility I [c.t.l.d.s.SQLiteLocationDAO persist] ✅ INSERT: d83a8bde-55ad-4a9b-a9d2-e9b1b5482108 2024-02-09 14:11:55.100 20302-21255 TSLocationManager com.bobility I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 1) ╠═════════════════════════════════════════════ 2024-02-09 14:11:55.190 20302-20302 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 18 2024-02-09 14:11:55.200 20302-21255 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO first] ✅ Locked 1 records 2024-02-09 14:11:55.203 20302-21255 TSLocationManager com.bobility I [c.t.l.http.HttpService a] 🔵 HTTP POST: d83a8bde-55ad-4a9b-a9d2-e9b1b5482108 2024-02-09 14:11:55.286 20302-21271 TSLocationManager com.bobility I [c.t.l.http.HttpService$f onResponse] 🔵 Response: 200 2024-02-09 14:11:55.287 20302-21271 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO destroy] ✅ DESTROY: d83a8bde-55ad-4a9b-a9d2-e9b1b5482108 2024-02-09 14:11:55.293 20302-21271 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 18 2024-02-09 14:11:55.295 20302-20327 WM-WorkerWrapper com.bobility I Worker result SUCCESS for Work [ id=307fb36a-542d-4e91-8891-f94850724612, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ] 2024-02-09 14:11:55.848 20302-20302 MediaPlayer com.bobility V resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false 2024-02-09 14:11:55.848 20302-20302 MediaPlayer com.bobility V cleanDrmObj: mDrmObj=null mDrmSessionId=null 2024-02-09 14:12:02.036 20302-20302 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 start [TrackingService startId: 16, eventCount: 1] 2024-02-09 14:12:02.037 20302-20302 TSLocationManager com.bobility D [c.t.l.service.TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 43.294075,-0.371178 hAcc=5.713 et=+7d17h46m29s968ms alt=268.79998779296875 vAcc=3.1014168 vel=1.0220432 sAcc=0.28284273 bear=337.44174 bAcc=45.0 {Bundle[{}]}] ╟─ Age: 62ms, time: 1707484321975 2024-02-09 14:12:02.038 20302-21255 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ 2024-02-09 14:12:02.038 20302-21255 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager a] Median accuracy: 10.23 2024-02-09 14:12:02.038 20302-20302 TSLocationManager com.bobility I [c.t.l.service.TrackingService b] ℹ️ Distance from stoppedAtLocation: -12.390949 2024-02-09 14:12:02.039 20302-20302 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [TrackingService startId: 16, eventCount: 0, sticky: true] 2024-02-09 14:12:02.084 20302-21159 TSLocationManager com.bobility I [c.t.l.d.s.SQLiteLocationDAO persist] ✅ INSERT: 589710d4-dae9-4311-9608-a00883e0b8fd 2024-02-09 14:12:02.092 20302-21159 TSLocationManager com.bobility I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 1) ╠═════════════════════════════════════════════ 2024-02-09 14:12:02.178 20302-20302 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 19 2024-02-09 14:12:02.181 20302-21159 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO first] ✅ Locked 1 records 2024-02-09 14:12:02.183 20302-21159 TSLocationManager com.bobility I [c.t.l.http.HttpService a] 🔵 HTTP POST: 589710d4-dae9-4311-9608-a00883e0b8fd 2024-02-09 14:12:02.265 20302-21271 TSLocationManager com.bobility I [c.t.l.http.HttpService$f onResponse] 🔵 Response: 200 2024-02-09 14:12:02.266 20302-21271 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO destroy] ✅ DESTROY: 589710d4-dae9-4311-9608-a00883e0b8fd 2024-02-09 14:12:02.274 20302-21271 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 19 2024-02-09 14:12:02.276 20302-20323 WM-WorkerWrapper com.bobility I Worker result SUCCESS for Work [ id=0abd4123-c101-4daa-bfab-2a455d326458, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ] 2024-02-09 14:12:02.779 20302-20302 MediaPlayer com.bobility V resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false 2024-02-09 14:12:02.779 20302-20302 MediaPlayer com.bobility V cleanDrmObj: mDrmObj=null mDrmSessionId=null 2024-02-09 14:12:17.041 20302-20302 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 start [TrackingService startId: 17, eventCount: 1] 2024-02-09 14:12:17.042 20302-20302 TSLocationManager com.bobility D [c.t.l.service.TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 43.294083,-0.371187 hAcc=4.279 et=+7d17h46m44s968ms alt=268.79998779296875 vAcc=3.3785925 vel=0.5429307 sAcc=0.3 bear=325.79984 bAcc=45.0 {Bundle[{}]}] ╟─ Age: 66ms, time: 1707484336975 2024-02-09 14:12:17.043 20302-21159 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ 2024-02-09 14:12:17.044 20302-21159 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager a] Median accuracy: 5.713 2024-02-09 14:12:17.044 20302-20302 TSLocationManager com.bobility I [c.t.l.service.TrackingService b] ℹ️ Distance from stoppedAtLocation: -12.065256 2024-02-09 14:12:17.044 20302-20302 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [TrackingService startId: 17, eventCount: 0, sticky: true] 2024-02-09 14:12:17.047 20302-21159 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager c] Odometer: 569680.1 2024-02-09 14:12:17.088 20302-21255 TSLocationManager com.bobility I [c.t.l.d.s.SQLiteLocationDAO persist] ✅ INSERT: a118d42d-2f08-4ca2-bfca-41c46fc67254 2024-02-09 14:12:17.099 20302-21255 TSLocationManager com.bobility I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 1) ╠═════════════════════════════════════════════ 2024-02-09 14:12:17.165 20302-20302 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 20 2024-02-09 14:12:17.170 20302-21255 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO first] ✅ Locked 1 records 2024-02-09 14:12:17.171 20302-21255 TSLocationManager com.bobility I [c.t.l.http.HttpService a] 🔵 HTTP POST: a118d42d-2f08-4ca2-bfca-41c46fc67254 2024-02-09 14:12:17.247 20302-21271 TSLocationManager com.bobility I [c.t.l.http.HttpService$f onResponse] 🔵 Response: 200 2024-02-09 14:12:17.251 20302-21271 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO destroy] ✅ DESTROY: a118d42d-2f08-4ca2-bfca-41c46fc67254 2024-02-09 14:12:17.260 20302-21271 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 20 2024-02-09 14:12:17.262 20302-20323 WM-WorkerWrapper com.bobility I Worker result SUCCESS for Work [ id=9a9d375a-d95a-42a0-af01-ce849d557116, tags={ com.transistorsoft.locationmanager.util.BackgroundTaskWorker } ] 2024-02-09 14:12:17.769 20302-20302 MediaPlayer com.bobility V resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false 2024-02-09 14:12:17.769 20302-20302 MediaPlayer com.bobility V cleanDrmObj: mDrmObj=null mDrmSessionId=null ```

Those are the two lines that make me feel like everything should be good to listen to the events

2024-02-09 14:11:54.105 20302-20302 Capacitor               com.bobility                         V  callback: 12363756, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"location"}
...
2024-02-09 14:11:54.105 20302-20302 Capacitor               com.bobility                         V  callback: 12363757, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"http"}

Ask me if you need more code/logs.

christocracy commented 6 months ago

Your JavaScript / typescript code no longer exists when an Android app is terminated.

See api docs Config.enableHeadless.

mrshlle commented 6 months ago

This is not about killed app, this is about relaunched app, when all my code is recreated, and the user is using the app.

christocracy commented 6 months ago

and if yes, then listen to the http and location events

You likely have an issue in your own app code. You do not need to conditionally listen to plug-in events. There is zero cost and no consequences to just always registering listeners, no matter what (and before calling .ready.).

mrshlle commented 6 months ago

Ok, this might not be the right way to do it, but this is still not my issue. I don't receive events when I relaunch my app, even if I listen to plug-in events unconditionally. Here are some logs of what happens when I open the app, after I have killed it, and as you can see, there are the two lines that say the listeners should emit events.

Logs ``` 2024-02-10 12:31:31.710 7194-7212 AppScoutStateMachine com.bobility D 7194-ScoutStateMachinecreated 2024-02-10 12:31:31.760 7194-7194 IS_CTS_MODE com.bobility D false 2024-02-10 12:31:31.760 7194-7194 MULTI_WIND...CH_ENABLED com.bobility D false 2024-02-10 12:31:31.763 7194-7194 DecorView[] com.bobility D getWindowModeFromSystem windowmode is 1 2024-02-10 12:31:31.793 24679-24802 ActivityManagerWrapper com.miui.home E getRecentTasks: taskId=1315 userId=0 baseIntent=Intent { act=android.intent.action.MAIN flag=270532608 cmp=ComponentInfo{com.bobility/io.ionic.starter.MainActivity} } 2024-02-10 12:31:31.808 7194-7194 Capacitor com.bobility D Starting BridgeActivity 2024-02-10 12:31:31.814 7194-7194 Capacitor com.bobility D Registering plugin instance: CapacitorCookies 2024-02-10 12:31:31.816 7194-7194 Capacitor com.bobility D Registering plugin instance: WebView 2024-02-10 12:31:31.817 7194-7194 Capacitor com.bobility D Registering plugin instance: CapacitorHttp 2024-02-10 12:31:31.818 7194-7194 Capacitor com.bobility D Registering plugin instance: App 2024-02-10 12:31:31.821 7194-7194 Capacitor com.bobility D Registering plugin instance: Clipboard 2024-02-10 12:31:31.824 7194-7194 Capacitor com.bobility D Registering plugin instance: Geolocation 2024-02-10 12:31:31.825 7194-7194 Capacitor com.bobility D Registering plugin instance: Haptics 2024-02-10 12:31:31.827 7194-7194 Capacitor com.bobility D Registering plugin instance: Keyboard 2024-02-10 12:31:31.827 7194-7194 Capacitor com.bobility D Registering plugin instance: StatusBar 2024-02-10 12:31:31.828 7194-7194 Capacitor com.bobility D Registering plugin instance: BackgroundFetch 2024-02-10 12:31:31.829 7194-7194 BackgroundFetchPlugin com.bobility D load 2024-02-10 12:31:31.829 7194-7194 Capacitor com.bobility D Registering plugin instance: BackgroundGeolocation 2024-02-10 12:31:31.830 7194-7194 TSLocationManager com.bobility D [c.t.b.c.BackgroundGeolocationPlugin load] 2024-02-10 12:31:31.831 7194-7194 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-10 12:31:31.841 7194-7194 Capacitor com.bobility W Unable to read file at path public/plugins 2024-02-10 12:31:31.842 7194-7194 Capacitor com.bobility D Loading app at http://localhost 2024-02-10 12:31:31.854 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/ 2024-02-10 12:31:31.862 7194-7194 Capacitor com.bobility D App started 2024-02-10 12:31:31.867 7194-7194 TSLocationManager com.bobility D [c.t.l.l.LifecycleManager onStart] ☯️ onStart 2024-02-10 12:31:31.873 7194-7194 Capacitor/AppPlugin com.bobility D Firing change: true 2024-02-10 12:31:31.874 7194-7194 Capacitor/AppPlugin com.bobility V Notifying listeners for event appStateChange 2024-02-10 12:31:31.874 7194-7194 Capacitor/AppPlugin com.bobility D No listeners found for event appStateChange 2024-02-10 12:31:31.877 7194-7194 Capacitor com.bobility D App resumed 2024-02-10 12:31:31.883 7194-7194 TSLocationManager com.bobility D [c.t.l.l.LifecycleManager onResume] ☯️ onResume 2024-02-10 12:31:31.884 7194-7194 TSBackgroundFetch com.bobility D ☯️ onResume 2024-02-10 12:31:31.894 7194-7194 ForceDarkHelperStubImpl com.bobility I setViewRootImplForceDark: true for io.ionic.starter.MainActivity@dd7f6e1, reason: forceDarkAllowed 2024-02-10 12:31:31.895 7194-7194 ForceDarkHelperStubImpl com.bobility I setViewRootImplForceDark: true for io.ionic.starter.MainActivity@dd7f6e1, reason: forceDarkAllowed 2024-02-10 12:31:31.950 7194-7266 chromium com.bobility W [WARNING:display_webview.cc(32)] WebView overlays are enabled! 2024-02-10 12:31:31.977 7194-7194 DecorView[] com.bobility D onWindowFocusChanged hasWindowFocus true 2024-02-10 12:31:32.117 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/runtime.c5bc6968c45bd633.js 2024-02-10 12:31:32.124 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/polyfills.b4e8aa928519df4d.js 2024-02-10 12:31:32.125 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/main.e0a97f27d26e1a0d.js 2024-02-10 12:31:32.171 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/styles.52a88ebb8fea62ef.css 2024-02-10 12:31:32.435 7194-7194 Capacitor/Console com.bobility I File: http://localhost/main.e0a97f27d26e1a0d.js - Line 1 - Msg: 2024-02-10T12:31:32.431Z ::: listen geoloc 2024-02-10 12:31:32.436 7194-7194 Capacitor/Console com.bobility I File: http://localhost/main.e0a97f27d26e1a0d.js - Line 1 - Msg: 2024-02-10T12:31:32.435Z ::: onHttp 2024-02-10 12:31:32.444 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/common.d67bee62714a177a.js 2024-02-10 12:31:32.447 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/53.4041b227b28eba5c.js 2024-02-10 12:31:32.457 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/4908.8f66c2a2962b35f1.js 2024-02-10 12:31:32.464 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394274, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-10 12:31:32.464 7194-7194 Capacitor com.bobility V callback: 90394274, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"location"} 2024-02-10 12:31:32.466 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394275, pluginId: BackgroundGeolocation, methodName: addListener 2024-02-10 12:31:32.466 7194-7194 Capacitor com.bobility V callback: 90394275, pluginId: BackgroundGeolocation, methodName: addListener, methodData: {"eventName":"http"} 2024-02-10 12:31:32.486 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/5652.5b9ad8f4baf6ebc4.js 2024-02-10 12:31:32.490 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/6556.8fdfd388ae101c69.js 2024-02-10 12:31:32.524 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/assets/fonts/Inter/static/Inter-Medium.ttf 2024-02-10 12:31:32.530 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/6703.a0dc8e3a332af9d1.js 2024-02-10 12:31:32.532 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/9667.4cdfa0446451e643.js 2024-02-10 12:31:32.533 7194-7233 Capacitor com.bobility D Handling local request: http://localhost/3729.9d3ac2b68b255854.js 2024-02-10 12:31:32.536 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/9485.53deb9305471aba0.js 2024-02-10 12:31:32.537 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/7816.1e981bdced54895f.js 2024-02-10 12:31:32.542 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/8465.b32bf795f19c1076.js 2024-02-10 12:31:32.580 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/5483.6139bc08a3ad779c.js 2024-02-10 12:31:32.583 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/126.c0f9c99c4d6565a8.js 2024-02-10 12:31:32.584 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/6535.b398cc4c8878edbf.js 2024-02-10 12:31:32.590 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/3952.c9321286db4ab725.js 2024-02-10 12:31:32.591 7194-7249 Capacitor com.bobility D Handling local request: http://localhost/2783.bd122a2921ab7c84.js 2024-02-10 12:31:32.592 7194-7233 Capacitor com.bobility D Handling local request: http://localhost/993.54560de5eb5992b2.js 2024-02-10 12:31:32.597 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/4318.747b0ebf53eedcd3.js 2024-02-10 12:31:32.609 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/6029.40b63ceb5bf410fd.js 2024-02-10 12:31:32.649 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/2862.97ac448a38ba2997.js 2024-02-10 12:31:32.652 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/2843.5d280dfecf5ff5b6.js 2024-02-10 12:31:32.657 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/5735.a879413f57371b0d.js 2024-02-10 12:31:32.770 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/9840.8cd1ff13ac10b11e.js 2024-02-10 12:31:32.795 7194-7194 Capacitor/Console com.bobility I File: http://localhost/main.e0a97f27d26e1a0d.js - Line 1 - Msg: 2024-02-10T12:31:32.793Z ::: initiate service 2024-02-10 12:31:32.796 7194-7194 Capacitor/Console com.bobility I File: http://localhost/main.e0a97f27d26e1a0d.js - Line 1 - Msg: 2024-02-10T12:31:32.794Z ::: preferences 2024-02-10 12:31:32.831 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/438.dbc1cf7371fdf498.js 2024-02-10 12:31:32.832 7194-7233 Capacitor com.bobility D Handling local request: http://localhost/8372.26857bc182047c78.js 2024-02-10 12:31:32.835 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/4711.14ad781f18816b36.js 2024-02-10 12:31:32.856 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/2349.6bd1739bf2339945.js 2024-02-10 12:31:32.868 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394276, pluginId: Keyboard, methodName: addListener 2024-02-10 12:31:32.868 7194-7194 Capacitor com.bobility V callback: 90394276, pluginId: Keyboard, methodName: addListener, methodData: {"eventName":"keyboardWillShow"} 2024-02-10 12:31:32.870 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394277, pluginId: Keyboard, methodName: addListener 2024-02-10 12:31:32.871 7194-7194 Capacitor com.bobility V callback: 90394277, pluginId: Keyboard, methodName: addListener, methodData: {"eventName":"keyboardWillHide"} 2024-02-10 12:31:32.914 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394278, pluginId: StatusBar, methodName: setStyle 2024-02-10 12:31:32.914 7194-7194 Capacitor com.bobility V callback: 90394278, pluginId: StatusBar, methodName: setStyle, methodData: {"style":"LIGHT"} 2024-02-10 12:31:32.934 7194-7194 DecorView[] com.bobility D getWindowModeFromSystem windowmode is 1 2024-02-10 12:31:32.934 7194-7194 DecorView[] com.bobility D updateDecorCaptionStatus displayWindowDecor is false 2024-02-10 12:31:32.949 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/svg/storefront.svg 2024-02-10 12:31:32.952 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/svg/bicycle.svg 2024-02-10 12:31:32.953 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/svg/person.svg 2024-02-10 12:31:32.953 7194-7233 Capacitor com.bobility D Handling local request: http://localhost/svg/add.svg 2024-02-10 12:31:32.955 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/svg/navigate.svg 2024-02-10 12:31:32.956 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/svg/caret-back.svg 2024-02-10 12:31:32.958 7194-7234 Capacitor com.bobility D Handling local request: http://localhost/svg/caret-forward.svg 2024-02-10 12:31:32.960 7194-7233 Capacitor com.bobility D Handling local request: http://localhost/svg/chevron-down.svg 2024-02-10 12:31:32.961 7194-7194 Capacitor/Console com.bobility I File: http://localhost/ - Line 325 - Msg: undefined 2024-02-10 12:31:32.975 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/9958.7d37eb84fa29cc15.js 2024-02-10 12:31:32.981 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/8939.f65216c0be30644a.js 2024-02-10 12:31:33.112 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/assets/icon/favicon.png 2024-02-10 12:31:33.121 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394279, pluginId: App, methodName: addListener 2024-02-10 12:31:33.121 7194-7194 Capacitor com.bobility V callback: 90394279, pluginId: App, methodName: addListener, methodData: {"eventName":"backButton"} 2024-02-10 12:31:33.126 7194-7230 Capacitor com.bobility D Handling local request: http://localhost/3838.cfb45e154ac79bad.js 2024-02-10 12:31:33.126 7194-7231 Capacitor com.bobility D Handling local request: http://localhost/4470.0e398feb03436f5e.js 2024-02-10 12:31:33.262 7194-7194 Capacitor/Plugin com.bobility V To native (Capacitor plugin): callbackId: 90394280, pluginId: BackgroundGeolocation, methodName: setConfig 2024-02-10 12:31:33.262 7194-7194 Capacitor com.bobility V callback: 90394280, pluginId: BackgroundGeolocation, methodName: setConfig, methodData: {"options":{"isMoving":true}} 2024-02-10 12:31:33.263 7194-7872 TSLocationManager com.bobility V *** IS DEBUG? 1 2024-02-10 12:31:39.042 7194-7194 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] 🎾 start [TrackingService startId: 27, eventCount: 1] 2024-02-10 12:31:39.043 7194-7194 TSLocationManager com.bobility D [c.t.l.service.TrackingService c] ╔═════════════════════════════════════════════ ║ TrackingService: LocationResult ╠═════════════════════════════════════════════ ╟─ 📍 Location[fused 43.294096,-0.371163 hAcc=8.908 et=+8d16h6m7s26ms alt=268.79998779296875 vAcc=4.2704644 vel=1.2794079 sAcc=0.5140039 bear=331.24332 bAcc=45.0 {Bundle[{}]}] ╟─ Age: 65ms, time: 1707564698976 2024-02-10 12:31:39.044 7194-7194 TSLocationManager com.bobility I [c.t.l.service.TrackingService b] ℹ️ Distance from stoppedAtLocation: -64.19515 2024-02-10 12:31:39.044 7194-7194 TSLocationManager com.bobility D [c.t.l.service.AbstractService a] ⚙️︎ FINISH [TrackingService startId: 27, eventCount: 0, sticky: true] 2024-02-10 12:31:39.044 7194-7281 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager onLocationResult] ╔═════════════════════════════════════════════ ║ Process LocationResult ╠═════════════════════════════════════════════ 2024-02-10 12:31:39.045 7194-7281 TSLocationManager com.bobility D [c.t.l.l.TSLocationManager a] Median accuracy: 10.696 2024-02-10 12:31:39.087 7194-7277 TSLocationManager com.bobility I [c.t.l.d.s.SQLiteLocationDAO persist] ✅ INSERT: 5a1d4ba1-50b7-43c4-813b-ec84552ada40 2024-02-10 12:31:39.096 7194-7277 TSLocationManager com.bobility I [c.t.l.http.HttpService flush] ╔═════════════════════════════════════════════ ║ HTTP Service (count: 1) ╠═════════════════════════════════════════════ 2024-02-10 12:31:39.160 7194-7194 TSLocationManager com.bobility I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 24 2024-02-10 12:31:39.167 7194-7277 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO first] ✅ Locked 1 records 2024-02-10 12:31:39.168 7194-7277 TSLocationManager com.bobility I [c.t.l.http.HttpService a] 🔵 HTTP POST: 5a1d4ba1-50b7-43c4-813b-ec84552ada40 2024-02-10 12:31:39.251 7194-7407 TSLocationManager com.bobility I [c.t.l.http.HttpService$f onResponse] 🔵 Response: 200 2024-02-10 12:31:39.253 7194-7407 TSLocationManager com.bobility D [c.t.l.d.s.SQLiteLocationDAO destroy] ✅ DESTROY: 5a1d4ba1-50b7-43c4-813b-ec84552ada40 ```

But there isn't the V Notifying listeners for event location line that tell something is sent to the listener.

christocracy commented 6 months ago

Create for me a simple "hello world" app which reproduces this. Share it with me in a public GitHub repo,

mrshlle commented 6 months ago

Link of the repo : https://github.com/mrshlle/background_geolocation

You just need to press start button, you will see events logged on the page, then you kill the app without stopping the watcher. When you will go back to the app, you will not see any log on the page.

christocracy commented 6 months ago

You must ensure your app always calls .ready when your app launches, no matter what. The plug-in is not "ready" to use until .ready is called.

You must always call it, not just when the user clicks a button.

Calling .ready does not imply you have to call .start() immediately after. The two calls can be separated.

mrshlle commented 6 months ago

Perfect, thank you it works now