Why locationManager did disconnect in this circumstance?
Always after START -> STOP -> START service.
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = 5; // meters
locationManager.allowsBackgroundLocationUpdates = YES;
locationManager.pausesLocationUpdatesAutomatically = NO;
if (@available(iOS 14.0, *)) {
if (locationManager.authorizationStatus == kCLAuthorizationStatusAuthorizedWhenInUse){
[locationManager startUpdatingLocation];
} else {
shouldStart = false;
[locationManager requestWhenInUseAuthorization];
}
} else {
// Fallback on earlier versions
}
--- resume log ---
{"msg":"#sbim client arrow state changed", "clientKey":"it.trainingcamp.app", "entityClass":"Application", "oldArrowState":"ReceivingLocationInformation", "newArrowState":"RequestingLocationInformation", "dueToDeauthorization":0}
client 'it.trainingcamp.app' authorized for location; starting shortly
client 'it.trainingcamp.app' authorized for location; starting now, desiredAccuracy, -1.0, distanceFilter, 5.0, operatingMode 0, dynamicAccuracyReductionEnabled 0, allowsAlteredAccessoryLocations 0, activityType 0
[application<it.trainingcamp.app>:9023] Suspending task.
Calculated state for application<it.trainingcamp.app>: running-suspended (role: None)
Process runningboardd.34 Released SystemIsActive "application<it.trainingcamp.app>34-77-203313:Location subscription" age:00:00:31 id:51539648441 [System: SysAct]
-CMSessionMgr- CMSessionMgrHandleApplicationStateChange: Client it.trainingcamp.app with pid '9023' is now Background Suspended. Background entitlement: YES ActiveLongFormVideoSession: NO WhitelistedLongFormVideoApp NO
-CMSessionMgr- CMSessionMgrHandleApplicationStateChange: Sending stop command to it.trainingcamp.app with pid '9023' because client is background suspended and there is no AirPlay video session for it
[application<it.trainingcamp.app>:9023] Setting process task state to: Suspended