UALocation

@interface UALocation : NSObject

Main class for interacting with Urban Airship location. Used to send location updates for the user to Urban Airship.

  • Flag to enable/disable requesting location authorization when the location service needs to start. Defaults to YES.

    Declaration

    Objective-C

    @property (getter=isAutoRequestAuthorizationEnabled, assign, readwrite,
              nonatomic) BOOL autoRequestAuthorizationEnabled;

    Swift

    var isAutoRequestAuthorizationEnabled: Bool { get set }
  • Flag to enable/disable location updates. Defaults to NO.

    Declaration

    Objective-C

    @property (getter=isLocationUpdatesEnabled, assign, readwrite, nonatomic)
        BOOL locationUpdatesEnabled;

    Swift

    var isLocationUpdatesEnabled: Bool { get set }
  • Flag to allow/disallow location updates in the background. Defaults to NO.

    Declaration

    Objective-C

    @property (getter=isBackgroundLocationUpdatesAllowed, assign, readwrite,
              nonatomic) BOOL backgroundLocationUpdatesAllowed;

    Swift

    var isBackgroundLocationUpdatesAllowed: Bool { get set }
  • UALocationDelegate to receive location callbacks.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<UALocationDelegate> delegate;

    Swift

    weak var delegate: UALocationDelegate? { get set }
  • Returns the last received location. Can be nil if no location has been received.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) CLLocation *lastLocation;

    Swift

    var lastLocation: CLLocation? { get }