Class CLLocationManager

  • All Implemented Interfaces:
    NSObject

    public class CLLocationManager
    extends NSObject
    CLLocationManager Discussion: The CLLocationManager object is your entry point to the location service.
    • Constructor Detail

      • CLLocationManager

        protected CLLocationManager​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • authorizationStatus_static

        public static int authorizationStatus_static()
        authorizationStatus Discussion: Deprecated. Use the instance property authorizationStatus instead.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • deferredLocationUpdatesAvailable

        public static boolean deferredLocationUpdatesAvailable()
        deferredLocationUpdatesAvailable Discussion: Returns YES if the device supports deferred location updates, otherwise NO.
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • headingAvailable_static

        public static boolean headingAvailable_static()
        headingAvailable Discussion: Returns YES if the device supports the heading service, otherwise NO.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isMonitoringAvailableForClass

        public static boolean isMonitoringAvailableForClass​(org.moe.natj.objc.Class regionClass)
        isMonitoringAvailableForClass: Discussion: Determines whether the device supports monitoring for the specified type of region. If NO, all attempts to monitor the specified type of region will fail.
      • isRangingAvailable

        public static boolean isRangingAvailable()
        isRangingAvailable Discussion: Determines whether the device supports ranging. If NO, all attempts to range beacons will fail.
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • locationServicesEnabled_static

        public static boolean locationServicesEnabled_static()
        locationServicesEnabled Discussion: Determines whether the user has location services enabled. If NO, and you proceed to call other CoreLocation API, user will be prompted with the warning dialog. You may want to check this property and use location services only when explicitly requested by the user.
      • new_objc

        public static java.lang.Object new_objc()
      • regionMonitoringAvailable

        @Deprecated
        public static boolean regionMonitoringAvailable()
        Deprecated.
        regionMonitoringAvailable Discussion: Deprecated. Use +isMonitoringAvailableForClass: instead.
      • regionMonitoringEnabled

        @Deprecated
        public static boolean regionMonitoringEnabled()
        Deprecated.
        regionMonitoringEnabled Discussion: Deprecated. Use +isMonitoringAvailableForClass: and -authorizationStatus instead.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • significantLocationChangeMonitoringAvailable

        public static boolean significantLocationChangeMonitoringAvailable()
        significantLocationChangeMonitoringAvailable Discussion: Returns YES if the device supports significant location change monitoring, otherwise NO.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • activityType

        public long activityType()
        activityType Discussion: Specifies the type of user activity. Currently affects behavior such as the determination of when location updates may be automatically paused. By default, CLActivityTypeOther is used.
      • allowDeferredLocationUpdatesUntilTraveledTimeout

        public void allowDeferredLocationUpdatesUntilTraveledTimeout​(double distance,
                                                                     double timeout)
        allowDeferredLocationUpdatesUntilTraveled:timeout: Discussion: Indicate that the application will allow the location manager to defer location updates until an exit criterion is met. This may allow the device to enter a low-power state in which updates are held for later delivery. Once an exit condition is met, the location manager will continue normal updates until this method is invoked again. Exit conditions, distance and timeout, can be specified using the constants CLLocationDistanceMax and CLTimeIntervalMax, respectively, if you are trying to achieve an unlimited distance or timeout. The CLLocationManagerDelegate will continue to receive normal updates as long as the application remains in the foreground. While the process is in the background, the device may be able to enter a low-power state for portions of the specified distance and time interval. While in this state, locations will be coalesced for later delivery. Location updates will be deferred as much as is reasonable to save power. If another process is using location, the device may not enter a low-power state and instead updates will continue normally. Deferred updates may be interspersed with normal updates if the device exits and re-enters a low-power state. All location updates, including deferred updates, will be delivered via the delegate callback locationManager:didUpdateLocations: When deferred updates have ended, the manager will invoke the delegate callback locationManagerDidFinishDeferredUpdates:withError:. An error will be returned if the manager will not defer updates and the exit criteria have not been met.
      • allowsBackgroundLocationUpdates

        public boolean allowsBackgroundLocationUpdates()
        allowsBackgroundLocationUpdates Discussion: By default, this is NO for applications linked against iOS 9.0 or later, regardless of minimum deployment target. With UIBackgroundModes set to include "location" in Info.plist, you must also set this property to YES at runtime whenever calling -startUpdatingLocation with the intent to continue in the background. Setting this property to YES when UIBackgroundModes does not include "location" is a fatal error. Resetting this property to NO is equivalent to omitting "location" from the UIBackgroundModes value. Access to location is still permitted whenever the application is running (ie not suspended), and has sufficient authorization (ie it has WhenInUse authorization and is in use, or it has Always authorization). However, the app will still be subject to the usual task suspension rules. See -requestWhenInUseAuthorization and -requestAlwaysAuthorization for more details on possible authorization values.
      • desiredAccuracy

        public double desiredAccuracy()
        desiredAccuracy Discussion: The desired location accuracy. The location service will try its best to achieve your desired accuracy. However, it is not guaranteed. To optimize power performance, be sure to specify an appropriate accuracy for your usage scenario (eg, use a large accuracy value when only a coarse location is needed). Use kCLLocationAccuracyBest to achieve the best possible accuracy. Use kCLLocationAccuracyBestForNavigation for navigation. The default value varies by platform.
      • disallowDeferredLocationUpdates

        public void disallowDeferredLocationUpdates()
        disallowDeferredLocationUpdates Discussion: Disallow deferred location updates if previously enabled. Any outstanding updates will be sent and regular location updates will resume.
      • dismissHeadingCalibrationDisplay

        public void dismissHeadingCalibrationDisplay()
        dismissHeadingCalibrationDisplay Discussion: Dismiss the heading calibration immediately.
      • distanceFilter

        public double distanceFilter()
        distanceFilter Discussion: Specifies the minimum update distance in meters. Client will not be notified of movements of less than the stated value, unless the accuracy has improved. Pass in kCLDistanceFilterNone to be notified of all movements. By default, kCLDistanceFilterNone is used.
      • heading

        public CLHeading heading()
        heading Discussion: Returns the latest heading update received, or nil if none is available.
      • headingAvailable

        @Deprecated
        public boolean headingAvailable()
        Deprecated.
        headingAvailable Discussion: Deprecated. Use +headingAvailable instead.
      • headingFilter

        public double headingFilter()
        headingFilter Discussion: Specifies the minimum amount of change in degrees needed for a heading service update. Client will not be notified of updates less than the stated filter value. Pass in kCLHeadingFilterNone to be notified of all updates. By default, 1 degree is used.
      • headingOrientation

        public int headingOrientation()
        headingOrientation Discussion: Specifies a physical device orientation from which heading calculation should be referenced. By default, CLDeviceOrientationPortrait is used. CLDeviceOrientationUnknown, CLDeviceOrientationFaceUp, and CLDeviceOrientationFaceDown are ignored.
      • location

        public CLLocation location()
        location Discussion: The last location received. Will be nil until a location has been received.
      • locationServicesEnabled

        @Deprecated
        public boolean locationServicesEnabled()
        Deprecated.
        locationServicesEnabled Discussion: Deprecated. Use +locationServicesEnabled instead.
      • maximumRegionMonitoringDistance

        public double maximumRegionMonitoringDistance()
        maximumRegionMonitoringDistance Discussion: the maximum region size, in terms of a distance from a central point, that the framework can support. Attempts to register a region larger than this will generate a kCLErrorRegionMonitoringFailure. This value may vary based on the hardware features of the device, as well as on dynamically changing resource constraints.
      • monitoredRegions

        public NSSet<? extends CLRegion> monitoredRegions()
        monitoredRegions Discussion: Retrieve a set of objects for the regions that are currently being monitored. If any location manager has been instructed to monitor a region, during this or previous launches of your application, it will be present in this set.
      • pausesLocationUpdatesAutomatically

        public boolean pausesLocationUpdatesAutomatically()
        pausesLocationUpdatesAutomatically Discussion: Specifies that location updates may automatically be paused when possible. By default, this is YES for applications linked against iOS 6.0 or later.
      • purpose

        @Deprecated
        public java.lang.String purpose()
        Deprecated.
        purpose Discussion: Allows the application to specify what location will be used for in their app. This will be displayed along with the standard Location permissions dialogs. This property will need to be set prior to calling startUpdatingLocation. Deprecated. Set the purpose string in Info.plist using key NSLocationUsageDescription.
      • rangedRegions

        public NSSet<? extends CLRegion> rangedRegions()
        rangedRegions Discussion: Retrieve a set of objects representing the regions for which this location manager is actively providing ranging.
      • requestAlwaysAuthorization

        public void requestAlwaysAuthorization()
        requestAlwaysAuthorization Discussion: When -authorizationStatus == kCLAuthorizationStatusNotDetermined, calling this method will start the process of requesting "always" authorization from the user. Any authorization change as a result of the prompt will be reflected via the usual delegate callback: -locationManager:didChangeAuthorizationStatus:. If possible, perform this call in response to direct user request for a location-based service so that the reason for the prompt will be clear, and the utility of a one-time grant is maximized. If received, "always" authorization grants access to the user's location via any CLLocationManager API. In addition, monitoring APIs may launch your app into the background when they detect an event. Even if killed by the user, launch events triggered by monitoring APIs will cause a relaunch. "Always" authorization presents a significant risk to user privacy, and as such requesting it is discouraged unless background launch behavior is genuinely required. Do not call +requestAlwaysAuthorization unless you think users will thank you for doing so. An application which currently has "when-in-use" authorization and has never before requested "always" authorization may use this method to request "always" authorization one time only. Otherwise, if -authorizationStatus != kCLAuthorizationStatusNotDetermined, (ie generally after the first call) this method will do nothing. If your app is not currently in use, this method will do nothing. Both the NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys must be specified in your Info.plist; otherwise, this method will do nothing, as your app will be assumed not to support Always authorization.
      • requestLocation

        public void requestLocation()
        requestLocation Discussion: Request a single location update. The service will attempt to determine location with accuracy according to the desiredAccuracy property. The location update will be delivered via the standard delegate callback, i.e. locationManager:didUpdateLocations: If the best available location has lower accuracy, then it will be delivered via the standard delegate callback after timeout. If no location can be determined, the locationManager:didFailWithError: delegate callback will be delivered with error location unknown. There can only be one outstanding location request and this method can not be used concurrently with startUpdatingLocation or allowDeferredLocationUpdates. Calling either of those methods will immediately cancel the location request. The method stopUpdatingLocation can be used to explicitly cancel the request.
      • requestStateForRegion

        public void requestStateForRegion​(CLRegion region)
        requestStateForRegion: Discussion: Asynchronously retrieve the cached state of the specified region. The state is returned to the delegate via locationManager:didDetermineState:forRegion:.
      • requestWhenInUseAuthorization

        public void requestWhenInUseAuthorization()
        requestWhenInUseAuthorization Discussion: When -authorizationStatus == kCLAuthorizationStatusNotDetermined, calling this method will trigger a prompt to request "when-in-use" authorization from the user. Any authorization change as a result of the prompt will be reflected via the usual delegate callback: -locationManager:didChangeAuthorizationStatus:. If possible, perform this call in response to direct user request for a location-based service so that the reason for the prompt will be clear, and the utility of a one-time grant is maximized. If received, "when-in-use" authorization grants access to the user's location via any CoreLocation API as long as your app is being actively used by the user. Typically this means your app must be in the foreground. If you start a Continuous Background Location session (see -allowsBackgroundLocationUpdates), then CoreLocation will maintain visibility for your app as it enters the background. This will enable your app to continue receiving location information even as another app enters the foreground. Your app will remain visible in this way until location updates are stopped or your app is killed by the user. When -authorizationStatus != kCLAuthorizationStatusNotDetermined, (ie generally after the first call) this method will do nothing. If your app is not currently in use, this method will do nothing. The NSLocationWhenInUseUsageDescription key must be specified in your Info.plist; otherwise, this method will do nothing, as your app will be assumed not to support WhenInUse authorization.
      • setActivityType

        public void setActivityType​(long value)
        activityType Discussion: Specifies the type of user activity. Currently affects behavior such as the determination of when location updates may be automatically paused. By default, CLActivityTypeOther is used.
      • setAllowsBackgroundLocationUpdates

        public void setAllowsBackgroundLocationUpdates​(boolean value)
        allowsBackgroundLocationUpdates Discussion: By default, this is NO for applications linked against iOS 9.0 or later, regardless of minimum deployment target. With UIBackgroundModes set to include "location" in Info.plist, you must also set this property to YES at runtime whenever calling -startUpdatingLocation with the intent to continue in the background. Setting this property to YES when UIBackgroundModes does not include "location" is a fatal error. Resetting this property to NO is equivalent to omitting "location" from the UIBackgroundModes value. Access to location is still permitted whenever the application is running (ie not suspended), and has sufficient authorization (ie it has WhenInUse authorization and is in use, or it has Always authorization). However, the app will still be subject to the usual task suspension rules. See -requestWhenInUseAuthorization and -requestAlwaysAuthorization for more details on possible authorization values.
      • setDesiredAccuracy

        public void setDesiredAccuracy​(double value)
        desiredAccuracy Discussion: The desired location accuracy. The location service will try its best to achieve your desired accuracy. However, it is not guaranteed. To optimize power performance, be sure to specify an appropriate accuracy for your usage scenario (eg, use a large accuracy value when only a coarse location is needed). Use kCLLocationAccuracyBest to achieve the best possible accuracy. Use kCLLocationAccuracyBestForNavigation for navigation. The default value varies by platform.
      • setDistanceFilter

        public void setDistanceFilter​(double value)
        distanceFilter Discussion: Specifies the minimum update distance in meters. Client will not be notified of movements of less than the stated value, unless the accuracy has improved. Pass in kCLDistanceFilterNone to be notified of all movements. By default, kCLDistanceFilterNone is used.
      • setHeadingFilter

        public void setHeadingFilter​(double value)
        headingFilter Discussion: Specifies the minimum amount of change in degrees needed for a heading service update. Client will not be notified of updates less than the stated filter value. Pass in kCLHeadingFilterNone to be notified of all updates. By default, 1 degree is used.
      • setHeadingOrientation

        public void setHeadingOrientation​(int value)
        headingOrientation Discussion: Specifies a physical device orientation from which heading calculation should be referenced. By default, CLDeviceOrientationPortrait is used. CLDeviceOrientationUnknown, CLDeviceOrientationFaceUp, and CLDeviceOrientationFaceDown are ignored.
      • setPausesLocationUpdatesAutomatically

        public void setPausesLocationUpdatesAutomatically​(boolean value)
        pausesLocationUpdatesAutomatically Discussion: Specifies that location updates may automatically be paused when possible. By default, this is YES for applications linked against iOS 6.0 or later.
      • setPurpose

        @Deprecated
        public void setPurpose​(java.lang.String value)
        Deprecated.
        purpose Discussion: Allows the application to specify what location will be used for in their app. This will be displayed along with the standard Location permissions dialogs. This property will need to be set prior to calling startUpdatingLocation. Deprecated. Set the purpose string in Info.plist using key NSLocationUsageDescription.
      • startMonitoringForRegion

        public void startMonitoringForRegion​(CLRegion region)
        startMonitoringForRegion: Discussion: Start monitoring the specified region. If a region of the same type with the same identifier is already being monitored for this application, it will be removed from monitoring. For circular regions, the region monitoring service will prioritize regions by their size, favoring smaller regions over larger regions. This is done asynchronously and may not be immediately reflected in monitoredRegions.
      • startMonitoringForRegionDesiredAccuracy

        @Deprecated
        public void startMonitoringForRegionDesiredAccuracy​(CLRegion region,
                                                            double accuracy)
        Deprecated.
        startMonitoringForRegion:desiredAccuracy: Discussion: Start monitoring the specified region. desiredAccuracy represents the distance past the border of the region at which the application would like to be notified that the region border has been crossed. This is useful to prevent repeated notifications when the user is on the border of the region. This value will be honored on a best-effort basis, and may not be respected if desiredAccuracy is large with respect to the size of the region, or if the device is not capable of providing the precision desired. If a region of the same type with the same identifier is already being monitored for this application, it will be removed from monitoring. This is done asynchronously and may not be immediately reflected in monitoredRegions.
      • startMonitoringSignificantLocationChanges

        public void startMonitoringSignificantLocationChanges()
        startMonitoringSignificantLocationChanges Discussion: Start monitoring significant location changes. The behavior of this service is not affected by the desiredAccuracy or distanceFilter properties. Locations will be delivered through the same delegate callback as the standard location service.
      • startMonitoringVisits

        public void startMonitoringVisits()
        startMonitoringVisits Discussion: Begin monitoring for visits. All CLLLocationManagers allocated by your application, both current and future, will deliver detected visits to their delegates. This will continue until -stopMonitoringVisits is sent to any such CLLocationManager, even across application relaunch events. Detected visits are sent to the delegate's -locationManager:didVisit: method.
      • startRangingBeaconsInRegion

        public void startRangingBeaconsInRegion​(CLBeaconRegion region)
        startRangingBeaconsInRegion: Discussion: Start calculating ranges for beacons in the specified region.
      • startUpdatingHeading

        public void startUpdatingHeading()
        startUpdatingHeading Discussion: Start updating heading.
      • startUpdatingLocation

        public void startUpdatingLocation()
        startUpdatingLocation Discussion: Start updating locations.
      • stopMonitoringForRegion

        public void stopMonitoringForRegion​(CLRegion region)
        stopMonitoringForRegion: Discussion: Stop monitoring the specified region. It is valid to call stopMonitoringForRegion: for a region that was registered for monitoring with a different location manager object, during this or previous launches of your application. This is done asynchronously and may not be immediately reflected in monitoredRegions.
      • stopMonitoringSignificantLocationChanges

        public void stopMonitoringSignificantLocationChanges()
        stopMonitoringSignificantLocationChanges Discussion: Stop monitoring significant location changes.
      • stopMonitoringVisits

        public void stopMonitoringVisits()
        stopMonitoringVisits Discussion: Stop monitoring for visits. To resume visit monitoring, send -startMonitoringVisits. Note that stopping and starting are asynchronous operations and may not immediately reflect in delegate callback patterns.
      • stopRangingBeaconsInRegion

        public void stopRangingBeaconsInRegion​(CLBeaconRegion region)
        stopRangingBeaconsInRegion: Discussion: Stop calculating ranges for the specified region.
      • stopUpdatingHeading

        public void stopUpdatingHeading()
        stopUpdatingHeading Discussion: Stop updating heading.
      • stopUpdatingLocation

        public void stopUpdatingLocation()
        stopUpdatingLocation Discussion: Stop updating locations.
      • setShowsBackgroundLocationIndicator

        public void setShowsBackgroundLocationIndicator​(boolean value)
        showsBackgroundLocationIndicator Discussion: Specifies that an indicator be shown when the app makes use of continuous background location updates. Starting continuous background location updates requires the app to set UIBackgroundModes to include "location" and to set the property allowsBackgroundLocationUpdates to YES before calling -startUpdatingLocation with the intent to continue in the background. Note that this property only applies to apps with Always authorization. For apps with WhenInUse authorization, the indicator is always shown when using continuous background location updates in order to maintain user visibility and that the app is still in use. The default value of this property is NO.
      • showsBackgroundLocationIndicator

        public boolean showsBackgroundLocationIndicator()
        showsBackgroundLocationIndicator Discussion: Specifies that an indicator be shown when the app makes use of continuous background location updates. Starting continuous background location updates requires the app to set UIBackgroundModes to include "location" and to set the property allowsBackgroundLocationUpdates to YES before calling -startUpdatingLocation with the intent to continue in the background. Note that this property only applies to apps with Always authorization. For apps with WhenInUse authorization, the indicator is always shown when using continuous background location updates in order to maintain user visibility and that the app is still in use. The default value of this property is NO.
      • rangedBeaconConstraints

        public NSSet<? extends CLBeaconIdentityConstraint> rangedBeaconConstraints()
        rangedBeaconConstraints Discussion: Retrieve a set of beacon constraints for which this location manager is actively providing ranging.
      • startRangingBeaconsSatisfyingConstraint

        public void startRangingBeaconsSatisfyingConstraint​(CLBeaconIdentityConstraint constraint)
        startRangingBeaconsSatisfyingConstraint: Discussion: Start producing ranging measurements for beacons that satisfy the provided constraint. Ranging will continue until you pass an equivalent constraint to stopRangingBeaconsSatisfyingConstraint:.
      • stopRangingBeaconsSatisfyingConstraint

        public void stopRangingBeaconsSatisfyingConstraint​(CLBeaconIdentityConstraint constraint)
        stopRangingBeaconsSatisfyingConstraint: Discussion: Stop an earlier beacon ranging request. See startRangingBeaconsSatisfyingConstraint:.
      • accuracyAuthorization

        public long accuracyAuthorization()
        accuracyAuthorization Discussion: Returns information about the calling application's access to accurate location. See the documentation for CLAccuracyAuthorization for information about how to interpret the return value. Note that this property should generally be interpreted in the context of the authorizationStatus property. For example, if authorizationStatus == kCLAuthorizationStatusNotDetermined then accurate location information cannot be received even when accuracyAuthorization is CLAccuracyAuthorizationFullAccuracy.
      • authorizationStatus

        public int authorizationStatus()
        authorizationStatus Discussion: Returns the current authorization status of the calling application.
      • isAuthorizedForWidgetUpdates

        public boolean isAuthorizedForWidgetUpdates()
        authorizedForWidgetUpdates Discussion: Returns true if widgets of the calling application may be eligible to receive location updates. If the calling application has authorizationStatus == kCLAuthorizationStatusAuthorizedWhenInUse, and authorizedForWidgetUpdates == YES, then widgets will be able to get location updates if called upon to refresh within a few minutes of having been seen. If the calling application has authorizationStatus == kCLAuthorizationStatusAuthorizedAlways, then authorizedForWidgetUpdates will always be YES.
      • requestTemporaryFullAccuracyAuthorizationWithPurposeKey

        public void requestTemporaryFullAccuracyAuthorizationWithPurposeKey​(java.lang.String purposeKey)
        requestTemporaryFullAccuracyAuthorizationWithPurposeKey: Discussion: This is a variant of requestTemporaryAccurateLocationAuthorizationWithPurposeKey:completion: which doesn't take a completion block. This is equivalent to passing in a nil completion block.
      • requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion

        public void requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion​(java.lang.String purposeKey,
                                                                                      CLLocationManager.Block_requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion completion)
        requestTemporaryFullAccuracyAuthorizationWithPurposeKey:completion: Discussion: If your app doesn't have permission to access accurate location (see -accuracyAuthorization), you can use this method to request temporary access to accurate location. This access will expire automatically, but it won't expire while the user is still engaged with your app. So, for example, while your app is in the foreground your app will retain the temporary access it was granted. Similarly, if your app starts a Continuous Background Location session with the background location indicator enabled (see -showsBackgroundLocationIndicator), your access to accurate location will remain as long as the background location indicator remains enabled. This allows your app to provide session-oriented experiences which require accurate location (e.g. fitness or navigation), even if the user has decided not to grant your app persistent access to accurate location. When CoreLocation prepares the prompt for display, it will look at the NSLocationTemporaryUsageDescriptionDictionary key in your Info.plist. The value should be a dictionary containing usage descriptions. The purposeKey you provide to this method must correspond to an entry in that dictionary. To retrieve a localized string, CoreLocation will load your InfoPlist.strings file and try to look up a string using the purposeKey you provided. If that fails, CoreLocation will use the content provided in your Info.plist. For example, suppose your Info.plist contains the following. NSLocationTemporaryUsageDescriptionDictionary ExampleUsageDescription This app needs accurate location so it can verify that you're in a supported region. AnotherUsageDescription This app needs accurate location so it can show you relevant results. In this case, you would be able to provide either "ExampleUsageDescription" or "AnotherUsageDescription" for the purposeKey argument. Passing any other string would result in the prompt not being displayed. To localize these usage descriptions, you would add entries for "ExampleUsageDescription" and "AnotherUsageDescription" to your InfoPlist.strings file. CoreLocation may decide against showing the user a prompt. For example, if your app already has access to accurate location or it is currently in the background. When that happens, your completion block will be called with an appropriate NSError. If the user responded to the prompt, your completion block will be called with a nil error. At that point, you may query the state of your CLLocationManager to see if you have been granted accurate access. The completion block will be called in the same threading context where delegate callbacks occur. That is, it will be called on the runloop where the CLLocationManager was originally initialized.