問題描述
我想設置所需的后臺模式鍵值,以便我的應用程序也可以在后臺運行.實際上,我想在應用程序處于后臺時獲取用戶位置更新,但是在我的 info-plist 文件中沒有稱為必需后臺模式鍵的鍵.如何設置此密鑰并如何將其帶入我的文件中?
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?
推薦答案
在 Xcode 5 中,項目設置 -> 目標 -> 功能 -> 背景模式 -> 檢查位置更新.
In Xcode 5, Project setting -> Target -> Capabilities -> Background modes -> check Location updates.
如果您使用的是早期版本的 Xcode,請設置 Location 的背景模式,如下圖所示.
If you are using an earlier version of Xcode, set the background mode for Location as in the following screenshot.
這篇關于info-plist 文件中沒有所需的背景模式鍵的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!