user3129761
user3129761

Reputation: 61

How we run the app in the background on iOS7

I want a way to keep my app running in the background and receive location updates. We should be able to detect phone motion and then start data collection in the background as we do in Android. My application is a driving application.

Upvotes: 0

Views: 98

Answers (1)

codercat
codercat

Reputation: 23291

The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended. However, an app that requests extra execution time may remain in this state for a period of time. In addition, an app being launched directly into the background enters this state instead of the inactive state. For information about how to execute code while in the background, see “Background Execution and Multitasking.

Edited:

Support for some types of background execution must be declared in advance by the app that uses them. In Xcode 5 and later, you declare the background modes your app supports from the Capabilities tab of your project settings. Enabling the Background Modes option adds the UIBackgroundModes key to your app’s Info.plist file. Selecting one or more checkboxes adds the corresponding background mode values to that key. Table 3-4 lists the background modes you can specify and the values that Xcode assigns to the UIBackgroundModes key in your app’s Info.plist file.

Upvotes: 1

Related Questions