0
我毫不懷疑,想知道是否有必要重新分配所有地區的位置經理,如果它收到appEnterInBackGround
的通知?地區監測和背景
這是一些代碼片段。
# pragma mark - BackGround Notification
-(void)applicationEnterBackground
{
monitorLocationManager = [selectRouteController sharedLocationMonitor];
monitorLocationManager.delegate = self;
for (Geofencing *gObjects in plotingArrays) {
CLCircularRegion *getRegion = [self dictToRegion:gObjects];
[monitorLocationManager startMonitoringForRegion:getRegion];
}
}
那麼,是否需要再次重新分配區域位置馬槽當應用程序在後臺輸入:
- (IBAction)startAction:(id)sender
{
for (Geofencing *gObjects in plotingArrays) {
CLCircularRegion *getRegion = [self dictToRegion:gObjects];
[monitorLocationManager startMonitoringForRegion:getRegion];
}
}
所以,當應用程序在回地面,我沒有這樣的進入?
+ (CLLocationManager *)sharedLocationMonitor {
static CLLocationManager *locationMonitor;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
locationMonitor = [[CLLocationManager alloc] init];
locationMonitor.desiredAccuracy =
kCLLocationAccuracyBestForNavigation;
locationMonitor.activityType =
CLActivityTypeAutomotiveNavigation;
[locationMonitor requestAlwaysAuthorization];
if(IS_OS_9_OR_LATER){
locationMonitor.allowsBackgroundLocationUpdates = YES;
}
if(SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(@"8.4")){
locationMonitor.pausesLocationUpdatesAutomatically = NO;
}
});
return locationMonitor;
}
PLIST:
hy。你能幫我交叉檢查代碼嗎?請參閱UPDATE1 – Ketan
附加的PLIST屏幕截圖。 – Ketan