1

Possible Duplicate:
iOS: Get location update every n minutes

How can I get location updates in the Background every 5 Minutes?

Community
  • 1
  • 1
Ujwal
  • 154
  • 1
  • 10
  • 5
    Downvoted because this question shows no research effort at all. @user927298, there's basically two ways how you could have done better: **1.** Use the search facility on SO to find existing questions concerning this particular issue. There's no reason to ask something that's been answered before. **2.** If you find your question has *not* been asked before, don't just ask the question; also give some information what you have already tried, so that you won't get duplicate advice or random guesses. – stakx - no longer contributing Sep 04 '11 at 07:58

1 Answers1

7

You should read the section Implementing Long-Running Background Tasks of in here. And then pursue either register for significant location changes or declare itself as needing continuous background location updates.

Furthermore a solution to this problem was given here by wjans. And I quote:

Found a solution to implement this with the help of the Apple Developer Forums. I did the following:
•Specify location background mode
•Use an NSTimer in the background by using UIApplication:beginBackgroundTaskWithExpirationHandler:
•In case n is smaller than UIApplication:backgroundTimeRemaining it does works just fine, in case n is larger, the location manager should be enabled (and disabled) again before there is no time remaining to avoid the background task being killed. This does work since location is one of the three allowed types of background execution.

Good luck :)

Community
  • 1
  • 1
Guy
  • 5,370
  • 6
  • 25
  • 30