Pregunta

¿Alguien puede hacerme saber si es posible manejar eventos como OrientationChanged, Shake, UbicationChanged, etc. cuando mi aplicación se ejecuta en segundo plano?

¡Intenté seguir el código, pero se invoca solo cuando mi aplicación se ejecuta en primer plano!

- (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);
}

Gracias.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top