相关疑难解决方法(0)

位置访问 - 应用程序不要求用户访问位置的权限 - iOS 11

描述

应用程序不要求用户访问位置和获取状态未确定的权限

完美地工作到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)

Plist截图 在此输入图像描述

背景模式

在此输入图像描述

location core-location ios ios11 xcode9

7
推荐指数
1
解决办法
6607
查看次数

标签 统计

core-location ×1

ios ×1

ios11 ×1

location ×1

xcode9 ×1