【发布时间】:2016-02-07 03:13:03
【问题描述】:
我在 plist 上有这段代码:
<key>NSLocationUsageDescription</key> <string>Usage</string>
<key>NSLocationWhenInUsageDescription</key> <string>WhenIn</string>
<key>NSLocationAlwaysUsageDescription</key> <string>Always</string>
这个在 viewController 的 viewDidLoad 上:
self.locationManager.requestWhenInUseAuthorization()
self.locationManager.requestAlwaysAuthorization()
但是 requestWhenInUseAuthorization() 警报没有出现。只能“在后台使用”。这是正常的吗?有什么问题?
谢谢
【问题讨论】:
-
如果使用
requestAlwaysAuthorization,则不需要requestWhenInUseAuthorization,因为“always”包括in use和background的case
标签: ios swift plist cllocationmanager