Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can we use instead of nstimer?

I can get the GPS location in the background using [locationManager startUpdatingLocation], but I don't know how to schedule it. I have used NSTimer for scheduling but many of them are saying that NSTimer will get expire if the application enters background.

I want to know how to schedule calling the method , if we are not using NSTimers.

like image 238
Perseus Avatar asked Nov 04 '22 01:11

Perseus


1 Answers

Apple provides 5 kinds of app task to run in background:

  • Apps that play audible content to the user while in the background, such as a music player app
  • Apps that keep users informed of their location at all times, such as a navigation app
  • Apps that support Voice over Internet Protocol (VoIP)
  • Newsstand apps that need to download and process new content
  • Apps that receive regular updates from external accessories

Refer this link for location updates while app is in background

Also refer this tutorial for further help

like image 169
DivineDesert Avatar answered Nov 10 '22 16:11

DivineDesert