I just upgraded to Xcode 14.0 and when I run our app on iOS 16 devices, calls to:
CLLocationManager.locationServicesEnabled()
Are returning the warning:
This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization:
callback and checking authorizationStatus
first.
I'd need to make significant changes to my code if I have to wait for a failure/callback rather than just calling the CLLocationManager.locationServicesEnabled()
method directly. This only seems to happen on iOS 16 devices. Any suggests on how to address this?
authorizationStatus
andlocationServicesEnabled()
are returning two entirely distinct statuses, right? – SpectrohelioscopelocationServicesEnabled
when user didn't authorize the access to location services, while authorization is a prerequisite to be able to obtainlocationServicesEnabled
status. – EnclaspauthorizationStatus
on aCLLocationManager
instance without having permission. If the user has not granted permission, then the status will bedenied
. – Grimsleystatus = denied, locationServicesEnabled = false
2) If you disable location services only for your app:status = denied, locationServicesEnabled = true
3) If you enable for both of them:status = always/while using.., locationServicesEnabled = true
– Questor