Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS cron jobs without server code

Is it possible to set (Linux) cron like jobs in iOS apps (any version including iOS 8) that run at set times regardless of whether the app is open or in background mode?

For example, I'd like to run a network GET operation from an iPhone at 11:00 and 23:00. If the job doesn't run because the phone is powered down, that's ok.

like image 490
sneeze1 Avatar asked Sep 05 '14 05:09

sneeze1


Video Answer


1 Answers

There is no way to access the underlying cron on an non jailbroken device.

The closest would be UILocalNotification - effectively an alert with a specific fire date, or Background Fetch in iOS 7.

Background fetch lets your device wake on a requested interval to do some network activity. However you're still at the mercy of the system.

http://www.appcoda.com/ios7-background-fetch-programming/

like image 88
Woodstock Avatar answered Sep 21 '22 20:09

Woodstock