1
我正在开发一款iPhone应用程序,当应用程序处于后台或前台时,应用程序应每隔15分钟更新一次gps位置并将其传递到我的服务器。我试图在我的ViewController中使我的计时器在后台运行,使用这个:如何每15分钟执行一次后台任务?
(...)
TimerTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^{
}];
CurrentTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target: self selector: @selector(timerTicked:) userInfo: nil repeats: YES];
(...)
但问题是,约10分钟后,我的计时器似乎停止,当应用程序在后台。
有没有可能做到这一点的权利?
谢谢