1

What is the most energy efficient way to call a web service in the background under OS X?

On iOS I would use the fetch background mode, but I haven't seen anything similar for OS X. Right now I have an NSTimer that fires every 25 minutes, but the schedule gets messed up if the device goes to sleep while the timer is waiting to fire.

Before I write some code to deal with sleep/wake I wanted to see if OS X has a better mechanism for my use case. I have not found anything in the docs.

jessecurry
  • 22,068
  • 8
  • 52
  • 44
  • Isn't using `cron` an option? – Etheryte Jun 04 '14 at 20:17
  • I'd only want the calls to the web service to happen if my App was open. It's my understanding that `cron` (or `launchd`now) would execute an App, but maybe I'm off base. – jessecurry Jun 04 '14 at 20:19
  • 1
    Would using events be an option? Have cron trigger an event if your app is open and have your app act upon that. I haven't used them myself so this advice might be off-course. – Etheryte Jun 04 '14 at 20:24
  • 1
    It seems like Apple has answered my question for the next version of OS X. I'll come back when the NDA is lifted and add an answer. – jessecurry Jun 06 '14 at 14:58

0 Answers0