Diogo Ferrer
Diogo Ferrer

Reputation: 119

iOS Location Manager - isAuthorizedForPreciseLocation doesn't seem to exist

In the LocationManager's desiredAccuracy documentation page, Apple says

If your app isn’t authorized to access precise location information (isAuthorizedForPreciseLocation is false), changes to this property’s value have no effect; the accuracy is always kCLLocationAccuracyReduced.

I can't find this attribute anywhere, and no documentation about it either. Can someone give me some insight into this, please?

Upvotes: 11

Views: 6004

Answers (2)

user3826696
user3826696

Reputation: 1135

Swift

if #available(iOS 14.0, *) {
    if let locationManager {
        switch locationManager.accuracyAuthorization {
            case .fullAccuracy:
                print("Full Accuracy")
            case .reducedAccuracy:
                print("Reduced Accuracy")
            @unknown default:
                print("Unknown Precise Location...")
         }
    }
}

Upvotes: 13

davidgyoung
davidgyoung

Reputation: 64970

Desired accuracy is a new iOS 14 setting exposed to users in every app's location permission page like below.

If the user changes this to be off, this blocks beacon detections, core bluetooth scanning and nearby interaction scanning. Lat/lon location updates from CoreLocation are degraded to be similar to what you get from cell towers. Read more in my answer here

Desired Accuracy Setting

Upvotes: 4

Related Questions