3

Hi I am trying to create a location based application for iOS7. I have enabled the UIBackgroundMode for location update. Most of time my app will be running on background. In background state App works fine when user is motion but I found that if user is stationary at one place for about 15 min the application gets suspended. Application does not wakes even when user is again in motion after the app goes to suspended state.

I need location update continuously so deferred update won't work for me. Is there a way to prevent app going to suspended mode?

nmh
  • 2,497
  • 1
  • 15
  • 27
Mendis
  • 93
  • 7

2 Answers2

4

Found an easier solution for this problem. iOS has provided a property called pausesLocationUpdatesAutomatically. set this property to NO and it works in background pretty well

Mendis
  • 93
  • 7
0

The background time for locationManager in iOS 7 has been reduced from 10 minutes (iOS 6) to 3 minutes. So, you will need to know when and how to restart the locationManager at the right delegate method. You also need to know how to handle the backgroundTask Properly.

I have shared a sample project on Github with a detail blog post on how to keep the location update running in iOS 7 here, please check that out: Background Location Services not working in iOS 7

Community
  • 1
  • 1
Ricky
  • 10,485
  • 6
  • 36
  • 49
  • You are setting timer and adding new background task after a certain interval right? Can you provide a bit more on Background tasks. – Mendis May 26 '14 at 08:50
  • You will have to check the source code that I share on Github. It has a manager that manages all the background tasks. Please upvote on that post if you think that it is useful. – Ricky May 26 '14 at 10:02