UALocation

@interface UALocation

Main class for interacting with Airship location. Used to send location updates for the user to 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 }
  • Check if the user has opted in to location updates.

    Declaration

    Objective-C

    - (BOOL)isLocationOptedIn;

    Swift

    func isLocationOptedIn() -> Bool

    Return Value

    YES if UALocation location updates are enabled and the user has authorized the app to use location services.

  • Check if the user has denied the app’s request to use location services.

    Declaration

    Objective-C

    - (BOOL)isLocationDeniedOrRestricted;

    Swift

    func isLocationDeniedOrRestricted() -> Bool

    Return Value

    YES if Uthe user has denied the app’s request to use location services.

  • Returns an enum representing the app’s permission status for location services.

    Declaration

    Objective-C

    - (id)locationPermissionStatus;

    Swift

    func locationPermissionStatus() -> Any!

    Return Value

    The location permission status.