User382
User382

Reputation: 874

MonoTouch - Location services in background

I have an app using MonoTouch which requires to capture GPS data every 2 mins in background. I found two ways to do it

  1. using startMonitoringSignificantLocationChanges- works in background but not every 2 mins.
  2. Using Timer and StartUpdatingLocation - Timer will be called every 2 mins and then update location.

The problem with startMonitoringSignificantLocationChanges is it doesn't get fired every 2 mins. So i cant use it. The other option of using Timer is better since it gives me a handle over time. But, will it run till my app is in the background for example one hour? Usually, ios apps gets 10 mins in background.

Thanks

Upvotes: 0

Views: 282

Answers (1)

Maxim Korobov
Maxim Korobov

Reputation: 2572

  • You could set app's UIBackgroundModes to location and gets current location changes in background. Battery killer yet works.
  • Other way is interpolate data from Significant Location Changes between UIApplicationLaunchOptionsLocationKey events.

Upvotes: 2

Related Questions