iOS: Keep application running in background

Dennis picture Dennis · May 20, 2012 · Viewed 84.4k times · Source

How do I keep my application running in the background? Would I have to jailbreak my iPhone to do this? I just need this app to check something from the internet every set interval and notify when needed, for my own use.

Answer

user523234 picture user523234 · May 20, 2012

Yes, no need to jailbreak. Check out the "Implementing long-running background tasks" section of this doc from Apple.

From Apple's doc: Declaring Your App’s Supported Background Tasks

Support for some types of background execution must be declared in advance by the app that uses them. An app declares support for a service using its Info.plist file. Add the UIBackgroundModes key to your Info.plist file and set its value to an array containing one or more of the following strings: (see Apple's doc from link mentioned above.)