Core Location permission

hi developer



in my app use core location and get permission with

this settings in viewController viewDidLoad (not in AppDelegate didFinishLaunchingWithOptions)



...

locationManager = CLLocationManager()

locationManager.delegate = self



// and get request with

locationManager!.requestAlwaysAuthorization()





// and or


// self.locationManager!.requestWhenInUseAuthorization()

both are not working successful



but no Message appear to grant access to User but the keys



Privacy - Location When In Use Usage Description

and

Privacy - Location Always and When In Use Usage Description



is set in my Info.plist



now have print the status and the result from access

from authorization status



the result is "when in use"

or

"always"





with this delegateMethod





func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {


switch status {

case .authorizedAlways:

print("always")

break

case .authorizedWhenInUse:

print("when in use")

break

case .denied:

print("denied")

break

case .notDetermined:

print("notDetermined")

break

case .restricted:

print("restricted")

break

}


}




following the the Message "when in use" or "always"



Insufficient Location Services authorization. Monitoring will pause until appropriate authorization is granted.



appear in console too.



Xcode Verion 9.1 (9B46)

iOS 11