i'm developing an iPhone application, which should update the gps location and deliver it to my server every 15 minutes, when the app is in background or in foreground.
I am using a NSTimer which calls a method every second to do several things (My Method does only update the location every 15 minutes) I tried it in my ViewController to keep my Timer in background running by using this:
(...)
TimerTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^{
}];
CurrentTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target: self selector: @selector(timerTicked:) userInfo: nil repeats: YES];
(...)
But the problem is that after approximately 10 minutes my timer seems to stop, when the app is in background.
Is there any possibility to do it right?
Thank you