Instance Property

pausesLocationUpdatesAutomatically

A Boolean value indicating whether the location manager object may pause location updates.

Declaration

@property(assign, nonatomic) BOOL pausesLocationUpdatesAutomatically;

Discussion

Allowing the location manager to pause updates can improve battery life on the target device without sacrificing location data. When this property is set to YES, the location manager pauses updates (and powers down the appropriate hardware) at times when the location data is unlikely to change. For example, if the user stops for food while using a navigation app, the location manager might pause updates for a period of time. You can help the determination of when to pause location updates by assigning a value to the activityType property.

After a pause occurs, it is your responsibility to restart location services again when you determine that they are needed. Core Location calls the locationManagerDidPauseLocationUpdates: method of your location manager's delegate to let you know that a pause has occurred. In that method, you might configure a local notification whose trigger is of type UNLocationNotificationTrigger and is set to notify when the user exits the current region. The message for the local notification should prompt the user to launch your app again so that it can resume updates.

The default value of this property is YES.

See Also

Initiating Standard Location Updates

- startUpdatingLocation

Starts the generation of updates that report the user’s current location.

- stopUpdatingLocation

Stops the generation of location updates.

- requestLocation

Requests the one-time delivery of the user’s current location.

allowsBackgroundLocationUpdates

A Boolean value indicating whether the app should receive location updates when suspended.

showsBackgroundLocationIndicator

A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background.

distanceFilter

The minimum distance (measured in meters) a device must move horizontally before an update event is generated.

CLLocationDistanceMax

A constant indicating the maximum distance.

kCLDistanceFilterNone

A constant indicating that all movement should be reported.

desiredAccuracy

The accuracy of the location data.

activityType

The type of user activity associated with the location updates.

CLActivityType

Constants indicating the type of activity associated with location updates.