Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Keep application running in background

Tags:

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.

like image 397
Dennis Avatar asked May 20 '12 13:05

Dennis


People also ask

Can a typical app run in the background iOS?

In iOS, only specific app types are allowed to run in the background: Apps that play audible content to the user while in the background, such as a music player app. Apps that record audio content while in the background. Apps that keep users informed of their location at all times, such as a navigation app.

How long can iOS app run in background?

On iOS 6, apps could get 10 minutes of background running time using this technique, but Apple quietly reduced this to three minutes starting with iOS 7. It is quite possible the maximum running time could be reduced in a future operating system update.


1 Answers

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.)

like image 183
user523234 Avatar answered Sep 29 '22 19:09

user523234