【发布时间】:2018-03-02 08:51:51
【问题描述】:
说明
应用未请求用户访问位置的权限并获取未确定状态
在 iOS-10 之前完美运行
var locationManager : CLLocationManager!
func getLocationDetails()
{
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.requestAlwaysAuthorization()
locationManager.allowsBackgroundLocationUpdates = true
locationManager.startUpdatingLocation()
}
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus)
{
if status == CLAuthorizationStatus.authorizedAlways || status == CLAuthorizationStatus.authorizedWhenInUse
{
locationManager.startUpdatingLocation()
}
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
}
后台模式
【问题讨论】:
标签: ios location core-location ios11 xcode9