ios info-plist 文件中没有所需的后台模式键
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21524421/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Required Background modes key is not there in info-plist file
提问by Saurabh Gulia
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?
我想设置所需的后台模式键值,以便我的应用程序也可以在后台运行。实际上,我想在应用程序处于后台时获取用户位置更新,但是在我的 info-plist 文件中没有称为所需后台模式键的键。如何设置此键和 jow 以将其放入我的文件中?
回答by Mani
In Xcode 5, Project setting -> Target -> Capabilities -> Background modes -> check Location updates.
在 Xcode 5 中, 项目设置 -> 目标 -> 功能 -> 背景模式 -> 检查位置更新。
If you are using an earlier version of Xcode, set the background mode for Location as in the following screenshot.
如果您使用的是早期版本的 Xcode,请按照以下屏幕截图设置 Location 的背景模式。