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