-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS kill mode: service stop after starting it in still state #2140
Comments
All those 🔴 messages at the end show you are calling |
@christocracy After starting the service, I do not stop it with (BackgroundGeolocation.start()) |
No. It’s right there: you’re telling the plug-in to .stop(). Check your code. Either that or the Config you’re actually using is not the same as that posted to this issue.
|
@christocracy, we have the same configuration that we shared. In our application, I removed the code for stopping the location service and then took logs. after starting service I am not stopping it. but still, the library stop giving updated locations, in the log we can see that 2024-09-10 16:11:48.447 ⚠️-[BackgroundTaskManager createBackgroundTask]_block_invoke FORCE KILL BACKGROUND TASK: 7, remaining time: 4.000219
2024-09-10 16:11:48.447 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 7 OF (
7
) After this line, the library stops providing updates. After I manually open the application, it starts. See full logs ╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager start]
╚═══════════════════════════════════════════════════════════
2024-09-10 16:11:36.305 ℹ️-[TSLocationManager doStart:] trackingMode: 1
2024-09-10 16:11:36.305 ℹ️-[TSConfig persist]
2024-09-10 16:11:36.311 🎾-[TSGeofenceManager start]
2024-09-10 16:11:36.313 🎾-[SOMotionDetector startDetection]
2024-09-10 16:11:36.314 🔵-[TSLocationManager setPace:] 0
2024-09-10 16:11:36.328 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON
2024-09-10 16:11:36.356 ✅-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates
2024-09-10 16:11:36.366
📍<+23.01933246,+72.51922460> +/- 35.00m (speed -1.00 mps / course -1.00) @ 10/09/24, 16:11:16 India Standard Time
2024-09-10 16:11:36.366
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 19958 ms
╚═══════════════════════════════════════════════════════════
2024-09-10 16:11:36.366 ℹ️-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying...
2024-09-10 16:11:36.366
📍<+23.01933246,+72.51922460> +/- 35.00m (speed -1.00 mps / course -1.00) @ 10/09/24, 16:11:36 India Standard Time
2024-09-10 16:11:36.366
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 26 ms
╚═══════════════════════════════════════════════════════════
2024-09-10 16:11:36.366 ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+23.01933246,+72.51922460> +/- 35.00m (speed -1.00 mps / course -1.00) @ 10/09/24, 16:11:36 India Standard Time
2024-09-10 16:11:36.368 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 200
2024-09-10 16:11:36.368 🔵-[TSLocationManager beginHeartbeat] 60
2024-09-10 16:11:36.368 🔴-[TSLocationManager stopUpdatingLocation]
2024-09-10 16:11:36.368 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0
2024-09-10 16:11:36.368 ℹ️-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>
2024-09-10 16:11:36.388 🎾-[TSLocationManager startMonitoringSignificantLocationChanges]
2024-09-10 16:11:36.390 ✅-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS
2024-09-10 16:11:36.394 ℹ️+[LocationAuthorization run:onCancel:] status: 3
2024-09-10 16:11:36.394 🎾-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON
2024-09-10 16:11:36.403 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: A8509C08-6213-4B0A-832D-9FC6DF6C14D1
2024-09-10 16:11:36.417 ✅-[BackgroundTaskManager createBackgroundTask] 7
2024-09-10 16:11:36.432 ℹ️-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch
2024-09-10 16:11:36.432
╔═══════════════════════════════════════════════════════════
║ -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
╚═══════════════════════════════════════════════════════════
2024-09-10 16:11:39.522 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 12.924749)
2024-09-10 16:11:39.558 ℹ️+[LocationAuthorization run:onCancel:] status: 3
2024-09-10 16:11:42.565 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 9.882543)
2024-09-10 16:11:42.602 ℹ️+[LocationAuthorization run:onCancel:] status: 3
2024-09-10 16:11:45.607 🔵-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 6.840572)
2024-09-10 16:11:45.648 ℹ️+[LocationAuthorization run:onCancel:] status: 3
2024-09-10 16:11:48.447 ⚠️-[BackgroundTaskManager createBackgroundTask]_block_invoke FORCE KILL BACKGROUND TASK: 7, remaining time: 4.000219
2024-09-10 16:11:48.447 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 7 OF (
7
)
2024-09-10 16:15:06.001 🔵-[TSLocationManager onHeartbeat] Heartbeat
2024-09-10 16:15:06.004 🔵-[TSLocationManager onResume:] enabled? 1
2024-09-10 16:15:06.007 ℹ️-[LocationDAO purge:] 1
2024-09-10 16:15:06.020 ℹ️-[TSDBLogger db_save] Log committed
2024-09-10 16:15:06.022 ℹ️-[TSDBLogger db_save] Log committed
2024-09-10 16:15:06.039
╔═══════════════════════════════════════════════════════════
|
How are you testing this? Sitting at your desk? go outside and move for >= 1km. The plug-in tracks when you move and stops tracking when you’re stationary. |
@christocracy Yes, Sitting at my desk, it will start if I go for a walk but in stationary mode, It only provides 2-3 locations and then stops. |
I’d you want periodic locations while stationary, implement background-fetch (already included as a dependency). Call .getCurrentPosition in your fetch callback. disable preventSuspend: true. It doesn’t work anymore.
no. You must move at least 200 meters before iOS will relaunch a terminated app. |
I want to get a location in kill mode (iOS)
My application is already in a kill state, I activate location services (BackgroundGeolocation.start()) using silent notifications. The location service activates successfully and provides 2-3 locations, but then it stops giving updates after that, my mobile is in still mode (on my desk) how can I start it in still mode for some time
If I walk, then it starts successfully.
Your Environment
react-native -v
): 0.74.1Steps to Reproduce
My .emailLog
The text was updated successfully, but these errors were encountered: