The UIBackgroundModes key identifies which background tasks your application supports. Its value is an array that contains one or more strings with the following values:
- audio – The application plays audible content to the user while in the background.
- location – The application keeps users informed of their location, even while running in the background.
- voip – The application provides the ability for the user to make phone calls using an Internet connection.
You can edit the Info.plist file on Xcode. To add a new key, click on the + sign and write:
iOS 4
"UIBackgroundModes" as the key, make sure the type is set to string and then in value write audio, location or voip depending on your needs:
iOS 6
"Required background modes" as the key and then set the type in drop down menu.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…