6

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?

Diogo Ferrer
  • 69
  • 1
  • 3
  • Are you using Xcode 12 and iOS 14 beta? – Paulw11 Jul 16 '20 at 10:34
  • Xcode 11.5 and my target is iOS 11.0. Is this a new part of CLLocationManager? – Diogo Ferrer Jul 16 '20 at 11:15
  • 1
    Yes. User control over location precision is only available in iOS 14. You don’t have to worry about it in iOS 13 and earlier. – Paulw11 Jul 16 '20 at 11:22
  • Ok, thanks! I do think they should make that clearer, I spent a little bit of time trying to find out where that came from :) – Diogo Ferrer Jul 16 '20 at 11:23
  • 1
    It can be tricky this time of year when the new betas comes out. It is worth checking for WWDC videos on topics you are working with as they will typically have “what’s new” sessions – Paulw11 Jul 16 '20 at 11:26
  • 1
    Documentation of this setting are in my answer here: https://stackoverflow.com/a/64068829/1461050 Sadly, Apple has not documented this well at all. – davidgyoung Sep 25 '20 at 18:22

2 Answers2

11

Swift

   if #available(iOS 14.0, *) {
            if locationManager != nil {
                switch locationManager!.accuracyAuthorization {
                case .fullAccuracy:
                    print("Full Accuracy")
                case .reducedAccuracy:
                    print("Reduced Accuracy")
                @unknown default:
                    print("Unknown Precise Location...")
                }
            }
        }
user3826696
  • 1,045
  • 12
  • 13
4

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

davidgyoung
  • 63,876
  • 14
  • 121
  • 204