| Modifier and Type | Class and Description |
|---|---|
static interface |
CLLocationManager.Block_requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion |
static interface |
CLLocationManager.Block_startMonitoringLocationPushesWithCompletion |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
CLLocationManager(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
long |
accuracyAuthorization()
accuracyAuthorization
|
long |
activityType()
activityType
|
static CLLocationManager |
alloc() |
static CLLocationManager |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
void |
allowDeferredLocationUpdatesUntilTraveledTimeout(double distance,
double timeout)
allowDeferredLocationUpdatesUntilTraveled:timeout:
|
boolean |
allowsBackgroundLocationUpdates()
allowsBackgroundLocationUpdates
|
static int |
authorizationStatus_static()
authorizationStatus
|
int |
authorizationStatus()
authorizationStatus
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static boolean |
deferredLocationUpdatesAvailable()
deferredLocationUpdatesAvailable
|
CLLocationManagerDelegate |
delegate() |
static java.lang.String |
description_static() |
double |
desiredAccuracy()
desiredAccuracy
|
void |
disallowDeferredLocationUpdates()
disallowDeferredLocationUpdates
|
void |
dismissHeadingCalibrationDisplay()
dismissHeadingCalibrationDisplay
|
double |
distanceFilter()
distanceFilter
|
static long |
hash_static() |
CLHeading |
heading()
heading
|
static boolean |
headingAvailable_static()
headingAvailable
|
boolean |
headingAvailable()
Deprecated.
|
double |
headingFilter()
headingFilter
|
int |
headingOrientation()
headingOrientation
|
CLLocationManager |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isAuthorizedForWidgetUpdates()
authorizedForWidgetUpdates
|
static boolean |
isMonitoringAvailableForClass(org.moe.natj.objc.Class regionClass)
isMonitoringAvailableForClass:
|
static boolean |
isRangingAvailable()
isRangingAvailable
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
CLLocation |
location()
location
|
static boolean |
locationServicesEnabled_static()
locationServicesEnabled
|
boolean |
locationServicesEnabled()
Deprecated.
|
double |
maximumRegionMonitoringDistance()
maximumRegionMonitoringDistance
|
NSSet<? extends CLRegion> |
monitoredRegions()
monitoredRegions
|
static CLLocationManager |
new_objc() |
boolean |
pausesLocationUpdatesAutomatically()
pausesLocationUpdatesAutomatically
|
java.lang.String |
purpose()
Deprecated.
|
NSSet<? extends CLBeaconIdentityConstraint> |
rangedBeaconConstraints()
rangedBeaconConstraints
|
NSSet<? extends CLRegion> |
rangedRegions()
rangedRegions
|
static boolean |
regionMonitoringAvailable()
Deprecated.
|
static boolean |
regionMonitoringEnabled()
Deprecated.
|
void |
requestAlwaysAuthorization()
requestAlwaysAuthorization
|
void |
requestLocation()
requestLocation
|
void |
requestStateForRegion(CLRegion region)
requestStateForRegion:
|
void |
requestTemporaryFullAccuracyAuthorizationWithPurposeKey(java.lang.String purposeKey)
requestTemporaryFullAccuracyAuthorizationWithPurposeKey:
|
void |
requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion(java.lang.String purposeKey,
CLLocationManager.Block_requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion completion)
requestTemporaryFullAccuracyAuthorizationWithPurposeKey:completion:
|
void |
requestWhenInUseAuthorization()
requestWhenInUseAuthorization
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setActivityType(long value)
activityType
|
void |
setAllowsBackgroundLocationUpdates(boolean value)
allowsBackgroundLocationUpdates
|
void |
setDelegate_unsafe(CLLocationManagerDelegate value) |
void |
setDelegate(CLLocationManagerDelegate value) |
void |
setDesiredAccuracy(double value)
desiredAccuracy
|
void |
setDistanceFilter(double value)
distanceFilter
|
void |
setHeadingFilter(double value)
headingFilter
|
void |
setHeadingOrientation(int value)
headingOrientation
|
void |
setPausesLocationUpdatesAutomatically(boolean value)
pausesLocationUpdatesAutomatically
|
void |
setPurpose(java.lang.String value)
Deprecated.
|
void |
setShowsBackgroundLocationIndicator(boolean value)
showsBackgroundLocationIndicator
|
static void |
setVersion_static(long aVersion) |
boolean |
showsBackgroundLocationIndicator()
showsBackgroundLocationIndicator
|
static boolean |
significantLocationChangeMonitoringAvailable()
significantLocationChangeMonitoringAvailable
|
void |
startMonitoringForRegion(CLRegion region)
startMonitoringForRegion:
|
void |
startMonitoringForRegionDesiredAccuracy(CLRegion region,
double accuracy)
Deprecated.
|
void |
startMonitoringLocationPushesWithCompletion(CLLocationManager.Block_startMonitoringLocationPushesWithCompletion completion)
startMonitoringLocationPushes
|
void |
startMonitoringSignificantLocationChanges()
startMonitoringSignificantLocationChanges
|
void |
startMonitoringVisits()
startMonitoringVisits
|
void |
startRangingBeaconsInRegion(CLBeaconRegion region)
startRangingBeaconsInRegion:
|
void |
startRangingBeaconsSatisfyingConstraint(CLBeaconIdentityConstraint constraint)
startRangingBeaconsSatisfyingConstraint:
|
void |
startUpdatingHeading()
startUpdatingHeading
|
void |
startUpdatingLocation()
startUpdatingLocation
|
void |
stopMonitoringForRegion(CLRegion region)
stopMonitoringForRegion:
|
void |
stopMonitoringLocationPushes()
stopMonitoringLocationPushes
|
void |
stopMonitoringSignificantLocationChanges()
stopMonitoringSignificantLocationChanges
|
void |
stopMonitoringVisits()
stopMonitoringVisits
|
void |
stopRangingBeaconsInRegion(CLBeaconRegion region)
stopRangingBeaconsInRegion:
|
void |
stopRangingBeaconsSatisfyingConstraint(CLBeaconIdentityConstraint constraint)
stopRangingBeaconsSatisfyingConstraint:
|
void |
stopUpdatingHeading()
stopUpdatingHeading
|
void |
stopUpdatingLocation()
stopUpdatingLocation
|
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static CLLocationManager alloc()
public static CLLocationManager allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static int authorizationStatus_static()
Discussion: Deprecated. Use the instance property authorizationStatus instead.
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static boolean deferredLocationUpdatesAvailable()
Discussion: Returns YES if the device supports deferred location updates, otherwise NO.
public static java.lang.String description_static()
public static long hash_static()
public static boolean headingAvailable_static()
Discussion: Returns YES if the device supports the heading service, otherwise NO.
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isMonitoringAvailableForClass(org.moe.natj.objc.Class regionClass)
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.
public static boolean isRangingAvailable()
Discussion: Determines whether the device supports ranging. If NO, all attempts to range beacons will fail.
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static boolean locationServicesEnabled_static()
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.
public static CLLocationManager new_objc()
@Deprecated public static boolean regionMonitoringAvailable()
Discussion: Deprecated. Use +isMonitoringAvailableForClass: instead.
@Deprecated public static boolean regionMonitoringEnabled()
Discussion: Deprecated. Use +isMonitoringAvailableForClass: and -authorizationStatus instead.
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static boolean significantLocationChangeMonitoringAvailable()
Discussion: Returns YES if the device supports significant location change monitoring, otherwise NO.
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public long 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.
public void allowDeferredLocationUpdatesUntilTraveledTimeout(double distance,
double 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.
public boolean 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.
public CLLocationManagerDelegate delegate()
public double 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.
public void disallowDeferredLocationUpdates()
Discussion: Disallow deferred location updates if previously enabled. Any outstanding updates will be sent and regular location updates will resume.
public void dismissHeadingCalibrationDisplay()
Discussion: Dismiss the heading calibration immediately.
public double 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.
public CLHeading heading()
Discussion: Returns the latest heading update received, or nil if none is available.
@Deprecated public boolean headingAvailable()
Discussion: Deprecated. Use +headingAvailable instead.
public double 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.
public int 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.
public CLLocationManager init()
public CLLocation location()
Discussion: The last location received. Will be nil until a location has been received.
@Deprecated public boolean locationServicesEnabled()
Discussion: Deprecated. Use +locationServicesEnabled instead.
public double 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.
public NSSet<? extends CLRegion> 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.
public boolean 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.
@Deprecated public java.lang.String 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.
public NSSet<? extends CLRegion> rangedRegions()
Discussion: Retrieve a set of objects representing the regions for which this location manager is actively providing ranging.
public void 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.
public void 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.
public void requestStateForRegion(CLRegion region)
Discussion: Asynchronously retrieve the cached state of the specified region. The state is returned to the delegate via locationManager:didDetermineState:forRegion:.
public void 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.
public void setActivityType(long value)
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.
public void setAllowsBackgroundLocationUpdates(boolean value)
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.
public void setDelegate_unsafe(CLLocationManagerDelegate value)
public void setDelegate(CLLocationManagerDelegate value)
public void setDesiredAccuracy(double value)
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.
public void setDistanceFilter(double value)
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.
public void setHeadingFilter(double value)
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.
public void setHeadingOrientation(int value)
Discussion: Specifies a physical device orientation from which heading calculation should be referenced. By default, CLDeviceOrientationPortrait is used. CLDeviceOrientationUnknown, CLDeviceOrientationFaceUp, and CLDeviceOrientationFaceDown are ignored.
public void setPausesLocationUpdatesAutomatically(boolean value)
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.
@Deprecated public void setPurpose(java.lang.String value)
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.
public void startMonitoringForRegion(CLRegion region)
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.
@Deprecated public void startMonitoringForRegionDesiredAccuracy(CLRegion region, double accuracy)
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.
public void 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.
public void 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.
public void startRangingBeaconsInRegion(CLBeaconRegion region)
Discussion: Start calculating ranges for beacons in the specified region.
public void startUpdatingHeading()
Discussion: Start updating heading.
public void startUpdatingLocation()
Discussion: Start updating locations.
public void stopMonitoringForRegion(CLRegion region)
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.
public void stopMonitoringSignificantLocationChanges()
Discussion: Stop monitoring significant location changes.
public void 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.
public void stopRangingBeaconsInRegion(CLBeaconRegion region)
Discussion: Stop calculating ranges for the specified region.
public void stopUpdatingHeading()
Discussion: Stop updating heading.
public void stopUpdatingLocation()
Discussion: Stop updating locations.
public void setShowsBackgroundLocationIndicator(boolean value)
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.
public boolean 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.
public NSSet<? extends CLBeaconIdentityConstraint> rangedBeaconConstraints()
Discussion: Retrieve a set of beacon constraints for which this location manager is actively providing ranging.
public void startRangingBeaconsSatisfyingConstraint(CLBeaconIdentityConstraint constraint)
Discussion: Start producing ranging measurements for beacons that satisfy the provided constraint. Ranging will continue until you pass an equivalent constraint to stopRangingBeaconsSatisfyingConstraint:.
public void stopRangingBeaconsSatisfyingConstraint(CLBeaconIdentityConstraint constraint)
Discussion: Stop an earlier beacon ranging request. See startRangingBeaconsSatisfyingConstraint:.
public long 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.
public int authorizationStatus()
Discussion: Returns the current authorization status of the calling application.
public boolean isAuthorizedForWidgetUpdates()
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.
public void requestTemporaryFullAccuracyAuthorizationWithPurposeKey(java.lang.String purposeKey)
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.
public void requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion(java.lang.String purposeKey,
CLLocationManager.Block_requestTemporaryFullAccuracyAuthorizationWithPurposeKeyCompletion 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.
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.
public void startMonitoringLocationPushesWithCompletion(CLLocationManager.Block_startMonitoringLocationPushesWithCompletion completion)
Discussion: Request an Apple Push Notification service token to be used to send location pushes. Incoming location pushes launch the app's Location Push Service Extension. Requires the com.apple.developer.location.push entitlement.
public void stopMonitoringLocationPushes()
Discussion: Stop monitoring for location pushes.