I'm trying to build an iPhone app that requires me to keep track of the user's location at all times using Core Location. I am using startMonitoringSignificantLocationChanges so that it updates in the background and because the accuracy is not as important as it being updated whenever there is a significant change.
Currently I make an HTTP request to a web service to update the location. This works perfectly when I am running the app - my location gets updated in the MySQL database I'm storing location data in. But when the app enters into the background - I can see the location services icon in the top right corner of the phone still running, but when I go back and look at the database, it didn't update my location at all. I tested this by taking a drive across town, one way with the app running, and one way with the app in the background.
From Apple's documentation:
If you leave this service running and your application is subsequently suspended or terminated, the service automatically wakes up your application when new location data arrives. At wake-up time, your application is put into the background and given a small amount of time to process the location data. Because your application is in the background, it should do minimal work and avoid any tasks (such as querying the network) that might prevent it from returning before the allocated time expires. If it does not, your application may be terminated.
How long exactly is this "small amount of time to process location data"? And is it just not recommended to query the network, or is it not possible to query the network in that time? Is there a better way to keep track of the location of several different users even when the app is in the background?