user3147791
user3147791

Reputation: 13

Ios schedule task for specific time even when app closed?

is it possible to run a cllocationmanager at a specific time even when the app has been closed (not terminated)?

For example I need to maintain a location between 22:00 and 01:00 and pass it to my server at 15minute intervals. It will be disabled as default to protect privacy as well as battery life.

It's not integral to sucess but could add a new revenue stream.

Any ideas?

Thank you for your time.

Upvotes: 1

Views: 946

Answers (1)

Matteo Pacini
Matteo Pacini

Reputation: 22846

On iOS 7 you can (link -> "Multitasking Enhancements").

Apps that regularly update their content by contacting a server can register with the system and be launched periodically to retrieve that content in the background. To register, include the UIBackgroundModes key with the fetch value in your app’s Info.plist file. Then, when your app is launched, call the setMinimumBackgroundFetchInterval: method to determine how often it receives update messages. Finally, you must also implement the application:performFetchWithCompletionHandler: method in your app delegate.

Upvotes: 1

Related Questions