What can I do in the background stream "location"?

For this question, suppose I plan to create a Google Latitude client application for iOS 4. My application needs to download the gps user's location every two minutes, as well as download the locations of users' friends. - in the background!

My application cannot wait for the OS on the switches of the cell tower to wake you up (because they can happen only after 2 KM, while my application needs to constantly update gps), so I understand that I can create a stream similar to the ones used GPS navigators to work in the background.

I don’t have programming knowledge on iPhone, I just need to know if my application is possible.

  • Will I have access to the Internet from the background stream (and download the user's gps location of the user), or is it limited only to fetching the GPS location. 1.
  • Will Apple endorse such an application or is it forbidden to use this type of use? because my application is not very important, for example, a GPS navigator

Thanks!

+4
source share
2 answers

As Don said, iOS will send location events to apps that support it. From there, the application can do what needs to be done with the location event.

Background apps can register for one of three options:

  • Significant changes: A low-power location tracking method that only wakes up the application when a “significant” change in location occurs.
  • Standard location services: compatible with all iOS devices that can use location services, allow you to indicate a change in distance and work in the background. However, if the application was terminated or suspended, iOS will not try to restart the application.
  • Continuous location services: allows the program to receive continuous location updates, and iOS does not pause the application when sent to the background.

Additional Information: Code Execution in the Background and Positioning Programming Guide

If you look at “Code Execution in the Background," Apple provides recommendations on which multitasking apps should and shouldn't.

+3
source

You will receive the message locationManager:didUpdateToLocation:fromLocation: in your application. There you can do whatever you need, although you should not update the user interface or use Open GL if you are in the background.

0
source

All Articles