react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

IOS kill mode: service stop after starting it in still state

Open Rutvik-tbz opened this issue 1 year ago â€ĸ 8 comments

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

  1. First, kill your iOS application.
  2. Send a silent push notification
  3. 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] 

Rutvik-tbz avatar Sep 09 '24 13:09 Rutvik-tbz