Skip to content

Getting Location Events in the Background iOS

Umer Asif edited this page Oct 20, 2016 · 2 revisions

You need to enable background location updates for your App in order to receive location updates even when application is in background, All you have to do is add "App registers for location updates" under the "Required background modes" you can either edit plist file in a text editor and add following code or can use Xcode to add required background modes.

<key>UIBackgroundModes</key>
<array>
    <string>location</string>
</array>

Additionally for iOS 8, you need to add one more key to your info.plist file i.e NSLocationAlwaysUsageDescription. This key should contain a text string, which will be displayed when iOS display Locations services permission's alert in your app.

<key>NSLocationAlwaysUsageDescription</key>
<string>Data stays secure on your phone. GPS will help you find parking. Vacancy will be posted anonymously.</string>