Alo*_*lok 7 location core-location ios ios11 xcode9
描述
应用程序不要求用户访问位置和获取状态未确定的权限
完美地工作到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])
{
}
Run Code Online (Sandbox Code Playgroud)
背景模式
Alo*_*lok 14
我已经浏览了Apple文档并找到了这个问题的解决方案.
Apple已经改变了一些指导方针来获取用户位置.
以下是视频链接:Apple-位置技术的新功能
解:
现在我们需要在Plist中添加三个身份验证密钥: