アプリがバックグラウンドで実行されているときに、OrientationChanged、Shake、LocationChanged などのイベントを処理できるかどうかを教えてください。
次のコードを試してみましたが、アプリがフォアグラウンドで実行されている場合にのみ呼び出されます!
- (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);
}
ありがとう。