14

I want to set required background mode key value so that my app also works in background. Actually i want to get the user location updates when the app is in background, but there is no key called required background mode key in my info-plist file. How to set this key and jow to bring this in my file?

Saurabh Gulia
  • 285
  • 1
  • 3
  • 13

3 Answers3

26

In Xcode 5, Project setting -> Target -> Capabilities -> Background modes -> check Location updates.

If you are using an earlier version of Xcode, set the background mode for Location as in the following screenshot.

plist background modes

shim
  • 9,289
  • 12
  • 69
  • 108
Mani
  • 17,549
  • 13
  • 79
  • 100
  • Is this a BUG? when Required background modes > "App provides Voice over IP services" is selected then instead of GREEN UI it shows a RED ui on top. Also in iPad the RED ui say its recording but my app does not do recording it only do Voice over. –  Mar 22 '17 at 15:02
  • I am still getting this issue and some more https://forum.ionicframework.com/t/issue-in-firebase-push-notification-in-ios/128842.please have a look – Anuj Apr 25 '18 at 07:20
  • Could not find Background modes under Signing & Capabilities (Xcode 11.1) – Saleh Enam Shohag May 14 '20 at 11:45
12

In Xcode 5, Select your app, then enabled background modes and select location updates

Target > Capabilities

Xcode background mode settings screenshot

shim
  • 9,289
  • 12
  • 69
  • 108
Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121
12

You can add that key to the info.plist. If you are using Xcode 5 it's very simple. In Capabilities just turn on the Background Modes.

Xcode Capabilities screenshot

shim
  • 9,289
  • 12
  • 69
  • 108
Anil Varghese
  • 42,757
  • 9
  • 93
  • 110