OrientationChanged, Shake, LocationChanged 등의 이벤트를 처리 할 수 있는지 알려 줄 수있는 사람이 있습니까? 내 앱이 백그라운드에서 실행될 때 알려주세요.iPhone : 백그라운드에서 실행중인 앱을 실행할 때 이벤트 잡기
다음 코드를 시도했지만 포 그라운드에서 실행중인 내 응용 프로그램에서만 호출됩니다!
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
//if the time interval returned from core location is more than two minutes we ignore it because it might be from an old session
if (abs([newLocation.timestamp timeIntervalSinceDate: [NSDate date]]) < 120) {
self.currentLocation = newLocation;
}
NSLog(@"lat: %f long:%f",currentLocation.coordinate.latitude,currentLocation.coordinate.longitude);
}
감사합니다.