react-native-background-geolocation
react-native-background-geolocation copied to clipboard
IOS kill mode: service stop after starting it in still state
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
- Plugin version: 4.16.3
- Platform: iOS
- OS version: 17.6.1
- Device manufacturer / model: iPhone 15
- React Native version (
react-native -v): 0.74.1 - Plugin config
BackgroundGeolocation.ready({
stationaryRadius: 0,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 0,
stopTimeout: 5,
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
startOnBoot: true, // <-- Auto start tracking when device is powered-up.
// useSignificantChangesOnly: true,
batchSync: false,
stopOnStationary: false,
allowIdenticalLocations: true,
locationUpdateInterval: 1000,
fastestLocationUpdateInterval: 60 * 1000,
showsBackgroundLocationIndicator: true,
heartbeatInterval: 60, // 1 min Interval
preventSuspend: true, // iOS need to work heartbeatInterval
autoSync: false, // Disable automatic syncing (this doesn't directly prevent permission requests but is a common recommendation)
// Android & iOS location-services will never turn off
disableStopDetection: true,
pausesLocationUpdatesAutomatically: false, // Need for iOS to set location-services will never turn off along with disableStopDetection
})
Steps to Reproduce
- First, kill your iOS application.
- Send a silent push notification
- Start the location service upon receiving the notification.
My .emailLog
2024-09-09 17:53:16.775 đĩ-[LocationManager locationManager:didUpdateLocations:] bgTime remaining: 20
2024-09-09 17:53:19.813
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â -[TSLocationManager start]
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
2024-09-09 17:53:19.813 âšī¸-[TSLocationManager doStart:] trackingMode: 1
2024-09-09 17:53:19.813 âšī¸-[TSConfig persist]
2024-09-09 17:53:19.819 đž-[TSGeofenceManager start]
2024-09-09 17:53:19.820 đž-[SOMotionDetector startDetection]
2024-09-09 17:53:19.822 đĩ-[TSLocationManager setPace:] 0
2024-09-09 17:53:19.833 đž-[TSLocationManager startUpdatingLocation] Location-services: ON
2024-09-09 17:53:19.867 âšī¸+[LocationAuthorization run:onCancel:] status: 3
2024-09-09 17:53:19.906 â
-[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates
2024-09-09 17:53:19.908 đž-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON
2024-09-09 17:53:19.912
đ<+23.01923319,+72.51924045> +/- 35.00m (speed -1.00 mps / course -1.00) @ 09/09/24, 17:53:18 India Standard Time
2024-09-09 17:53:19.912
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 1156 ms
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
2024-09-09 17:53:19.912 â
-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+23.01923319,+72.51924045> +/- 35.00m (speed -1.00 mps / course -1.00) @ 09/09/24, 17:53:18 India Standard Time
2024-09-09 17:53:19.919 đĩ-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 200
2024-09-09 17:53:19.922 đĩ-[TSLocationManager beginHeartbeat] 60
2024-09-09 17:53:19.922 đ´-[TSLocationManager stopUpdatingLocation]
2024-09-09 17:53:19.922 đĩ-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0
2024-09-09 17:53:19.922 âšī¸-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>
2024-09-09 17:53:19.923 đž-[TSLocationManager startMonitoringSignificantLocationChanges]
2024-09-09 17:53:19.923 â
-[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS
2024-09-09 17:53:19.972
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
2024-09-09 17:53:19.974 â
-[TSLocationManager persistLocation:]_block_invoke INSERT: E610EB2F-0002-4E83-A281-1BD79A8F5B14
2024-09-09 17:53:19.993 âšī¸-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch
2024-09-09 17:53:19.998 â
-[BackgroundTaskManager createBackgroundTask] 7
2024-09-09 17:53:19.999 â ī¸-[TSLocationManager start] Already started (ignored)
2024-09-09 17:53:23.100 đĩ-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 13.938937)
2024-09-09 17:53:23.127 âšī¸+[LocationAuthorization run:onCancel:] status: 3
2024-09-09 17:53:26.134 đĩ-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 10.904675)
2024-09-09 17:53:26.172 âšī¸+[LocationAuthorization run:onCancel:] status: 3
2024-09-09 17:53:29.179 đĩ-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 7.859773)
2024-09-09 17:53:29.219 âšī¸+[LocationAuthorization run:onCancel:] status: 3
2024-09-09 17:53:32.225 đĩ-[BackgroundTaskManager onPreventSuspendTimer:] Prevent-suspend timer fired! (bg time remaining: 4.813578)
2024-09-09 17:53:32.264 âšī¸+[LocationAuthorization run:onCancel:] status: 3
2024-09-09 17:53:33.449 â ī¸-[BackgroundTaskManager createBackgroundTask]_block_invoke FORCE KILL BACKGROUND TASK: 7, remaining time: 3.590480
2024-09-09 17:53:33.452 â
-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 7 OF (
7
)
2024-09-09 17:55:07.962 đĩ-[TSLocationManager onHeartbeat] Heartbeat
2024-09-09 17:55:07.965 đĩ-[TSLocationManager onResume:] enabled? 1
2024-09-09 17:55:07.965 âšī¸-[TSDBLogger db_save] Log committed
2024-09-09 17:55:07.967 âšī¸-[LocationDAO purge:] 1
2024-09-09 17:55:07.968 âšī¸-[TSDBLogger db_save] Log committed
2024-09-09 17:55:07.977
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â -[TSLocationManager createMotionTypeChangedHandler]_block_invoke | still/100 | isMoving: 0
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
2024-09-09 17:55:08.035 đĩ-[TSLocationManager getCurrentPosition:]
2024-09-09 17:55:08.035 đž-[LocationManager startUpdatingLocation] ON
2024-09-09 17:55:08.035 đĩ-[TSLocationManager getCurrentPosition:]
2024-09-09 17:55:08.041
đ<+23.01929688,+72.51925753> +/- 35.00m (speed -1.00 mps / course -1.00) @ 09/09/24, 17:54:13 India Standard Time
2024-09-09 17:55:08.041 đ´-[LocationManager stopUpdatingLocation] OFF
2024-09-09 17:55:08.041
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â -[LocationManager locationManager:didUpdateLocations:] Sample 1 of 1 (54687 ms old)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
2024-09-09 17:55:08.042 âšī¸-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>
2024-09-09 17:55:08.042 đĩ-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 35.0
2024-09-09 17:55:08.042 âšī¸-[PolygonGeofencingService setLocation:] Already updating location <IGNORED>
2024-09-09 17:55:08.043 â
-[TSLocationManager persistLocation:]_block_invoke INSERT: D0072D1F-7539-4224-953E-C619FFAE7DA1
2024-09-09 17:55:08.044 â
-[TSLocationManager persistLocation:]_block_invoke INSERT: EDBC95D9-3571-4911-9489-7504E3EF6092
2024-09-09 17:55:08.049 âšī¸+[LocationAuthorization run:onCancel:] status: 3
2024-09-09 17:55:09.696
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â -[TSLocationManager stop]
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
2024-09-09 17:55:09.696 âšī¸-[TSConfig persist]
2024-09-09 17:55:09.699 â ī¸-[BackgroundTaskManager stopBackgroundTask:]_block_invoke Failed to find backgroundTask: 7. Ignoring.
2024-09-09 17:55:09.699 âšī¸-[TSLocationManager clearLastOdometerLocation]
2024-09-09 17:55:09.699 đ´-[TSGeofenceManager stop]
2024-09-09 17:55:09.699 đ´-[TSGeofenceManager stopMonitoringSignificantLocationChanges]
2024-09-09 17:55:09.699 đ´-[TSGeofenceManager stopUpdatingLocation]
2024-09-09 17:55:09.699 đ´-[TSGeofenceManager stopMonitoringGeofences]
2024-09-09 17:55:09.703 đ´-[PolygonGeofencingService stop]
2024-09-09 17:55:09.703 âšī¸-[PolygonGeofencingService persistMonitoredPolygons] {
}
2024-09-09 17:55:09.703 đ´-[SOMotionDetector stopDetection] OFF
2024-09-09 17:55:09.703 đ´-[TSLocationManager stopUpdatingLocation]
2024-09-09 17:55:09.703 đ´-[TSLocationManager stopHeartbeat]
2024-09-09 17:55:09.703 đ´-[TSLocationManager stop] Stop monitoring stationary region
2024-09-09 17:55:09.703 đ´-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF
2024-09-09 17:55:09.704 đ´-[TSLocationManager stopMonitoringSignificantLocationChanges]
2024-09-09 17:55:09.709 đ´-[TSGeofenceManager stopUpdatingLocation]