SITLocationRequest

Objective-C

@interface SITLocationRequest : NSObject <NSCopying, SITMapperProtocol>

Swift

class SITLocationRequest : NSObject, NSCopying, SITMapperProtocol

A data object that contains parameters for the location service (SITLocationManager)

Initializers

  • Constructor.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithBuildingId:(NSString *_Nonnull)buildingId;

    Swift

    init(buildingId: String)

    Parameters

    buildingId

    Unique identifier of the building in which you want to locate a user.

    Return Value

    Initialized SITLocationRequest object.

Properties

  • The time interval indicating how often the position should be uploaded to realtime.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SITRealtimeUpdateInterval realtimeUpdateInterval;

    Swift

    var realtimeUpdateInterval: SITRealtimeUpdateInterval { get }
  • The time interval indicating how often the position should be uploaded to realtime.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SITMotionMode motionMode;

    Swift

    var motionMode: SITMotionMode { get }
  • Set if you want to use dead reckoning to get fast position updates using only the inertial sensors, between the server position updates. This parameter is incompatible with interval. If interval is set, dead reckoning will be deactivated for this request.

    Declaration

    Objective-C

    @property (nonatomic) BOOL useDeadReckoning;

    Swift

    var useDeadReckoning: Bool { get set }
  • Set if you want to use Gps for positioning indoor.

    Declaration

    Objective-C

    @property (nonatomic) BOOL useGps;

    Swift

    var useGps: Bool { get set }
  • Unique identifier of the building in which you want to locate a user. From SDK version 2.43.0, if this value is not set (it is nil or an empty string), the positioning will start in indoor-outdoor mode, regardless of the value of the deprecated property useGlobalLocation.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nullable buildingID;

    Swift

    var buildingID: String? { get set }
  • The thread where the location updates will be provided. If not provided, the main thread will be used.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSOperationQueue *_Nullable operationQueue;

    Swift

    var operationQueue: OperationQueue? { get set }
  • Additional options to modify the internal operation of the Location provider (private usage only).

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDictionary *_Nullable options;

    Swift

    var options: [AnyHashable : Any]? { get set }
  • Custom UUIDs. The system will also scan beacons with the specified UUIDs. Prior to SDK version 2.45.0 these scans were used only to position the user inside a building. From SDK version 2.45.0 on, if Global Location is active, these scans are also used to detect in which building the user is located.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSArray<SITBeaconFilter *> *_Nullable beaconFilters;

    Swift

    var beaconFilters: [SITBeaconFilter]? { get set }
  • Set the desired interval for location updates, in milliseconds. This interval is inexact, the service will try to keep this rate in a “best effort” way. This parameter is incompatible with dead reckoning. If set, dead reckoning will be deactivated for this request.

    Declaration

    Objective-C

    @property (nonatomic) int interval;

    Swift

    var interval: Int32 { get set }
  • Minimum displacement between location updates

    Declaration

    Objective-C

    @property (nonatomic) float smallestDisplacement;

    Swift

    var smallestDisplacement: Float { get set }
  • Set if you want to use barometer data for positioning.

    Declaration

    Objective-C

    @property (nonatomic) BOOL useBarometer;

    Swift

    var useBarometer: Bool { get set }
  • Set if you want to use compass sensor for positioning (default to true).

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL useCompass;

    Swift

    var useCompass: Bool { get }
  • Set if you want to use bluetooth sensor for positioning (default to true).

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL useBle;

    Swift

    var useBle: Bool { get }
  • Object containing several options to configure the indoor/outdoor positioning. This parameter will only be read if useGlobalLocation is set to YES

    Declaration

    Objective-C

    @property (nonatomic, strong) SITOutdoorLocationOptions *_Nullable outdoorLocationOptions;

    Swift

    var outdoorLocationOptions: SITOutdoorLocationOptions? { get set }
  • Boolean value indicating if the floorplan images and the POI categories images for the building should be download to cache while starting positioning. Set to YES to preload the images. Set to NO to skip that process. Default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL preloadInfo;

    Swift

    var preloadInfo: Bool { get set }
  • Activate to use the location cache. It will smooth dispersion of initial positions on starts that occur shortly after stopping.

    Declaration

    Objective-C

    @property (nonatomic) BOOL useLocationsCache;

    Swift

    var useLocationsCache: Bool { get set }
  • Configure to use route adjustment on the location engine.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SITRouteAdjustment *_Nullable routeAdjustment;

    Swift

    var routeAdjustment: SITRouteAdjustment? { get }

Methods

  • Check if the request is valid.

    Declaration

    Objective-C

    - (BOOL)isValid;

    Swift

    func isValid() -> Bool

    Return Value

    BOOL value that indicates if the request is valid (YES) or not (NO).

  • Check if indoor-outdoor mode is being used. From SDK version 2.43.0, indoor-outdoor mode is activated if location request, either the deprectated property useGlobalLocation is set to YES or buildingID is not set (it is nil or an empty string).

    Declaration

    Objective-C

    - (BOOL)isUsingGlobalLocation;

    Swift

    func isUsingGlobalLocation() -> Bool

    Return Value

    BOOL value that indicates if indoor-outdoor mode is being used (YES) or not (NO).

Private

  • Method that combines two location request updating the values of the receiving object with the ones on the request.

    Note

    You should not use this method directly. Insted you can use the method SITCommunicationManager.fetchRemoteConfig(...) or [SITLocationInterface locationManager:didInitiatedWithRequest:] methods.

    Declaration

    Objective-C

    - (SITLocationRequest *_Nonnull)merge:(SITLocationRequest *_Nonnull)request;

    Swift

    func merge(_ request: SITLocationRequest) -> SITLocationRequest

    Return Value

    new ‘SITLocationRequest` with merged values.

Deprecated

  • Deprecated

    Location provider is no longer selectable. Provider will always be kSITInPhoneProvider

    One of SITLocationProvider.

    Declaration

    Objective-C

    @property (nonatomic) SITLocationProvider provider;

    Swift

    var provider: SITLocationProvider { get set }
  • Deprecated

    Use realtimeUpdateInterval instead

    The time interval indicating how often the position should be uploaded to realtime. Deprecated, use realtimeUpdateInterval instead.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger updateInterval;

    Swift

    var updateInterval: Int { get set }
  • Set to true if you want to use indoor/outdoor positioning. Deprecated on SDK version 2.43.0. From that version on if buildingID is not set (it is nil or an empty string), indoor/outdoor positioning will be used, regardless of the value of this variable.

    @deprecated v2.43.0

    Declaration

    Objective-C

    @property (nonatomic) BOOL useGlobalLocation;

    Swift

    var useGlobalLocation: Bool { get set }
  • Deprecated

    Use base constructor instead

    Constructor.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithPriority:(SITLocationPriority)priority
                                     provider:(SITLocationProvider)provider
                               updateInterval:(NSInteger)updateInterval
                                   buildingID:(NSString *_Nonnull)buildingID
                               operationQueue:
                                   (NSOperationQueue *_Nonnull)operationQueue
                                      options:(NSDictionary *_Nullable)options;

    Swift

    init(priority: SITLocationPriority, provider: SITLocationProvider, updateInterval: Int, buildingID: String, operationQueue: OperationQueue, options: [AnyHashable : Any]? = nil)

    Parameters

    priority

    one of SITLocationPriority

    provider

    one of SITLocationProvider

    updateInterval

    The time interval at which location will be uploaded to realtime

    buildingID

    unique identifier of the building in which you want to locate a user. (This property is mandatory).

    operationQueue

    the thread where the location updates will be provided. If not provided, the main thread will be used.

    options

    additional options to modify the internal operation of the Location provider (private usage only).

    Return Value

    initialized object.

  • Deprecated

    Use base constructor instead

    Constructor.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithPriority:(SITLocationPriority)priority
                                     provider:(SITLocationProvider)provider
                               updateInterval:(NSInteger)updateInterval
                                   buildingID:(NSString *_Nonnull)buildingID
                               operationQueue:
                                   (NSOperationQueue *_Nonnull)operationQueue
                             useDeadReckoning:(BOOL)useDeadReckoning
                                      options:(NSDictionary *_Nullable)options;

    Swift

    init(priority: SITLocationPriority, provider: SITLocationProvider, updateInterval: Int, buildingID: String, operationQueue: OperationQueue, useDeadReckoning: Bool, options: [AnyHashable : Any]? = nil)

    Parameters

    priority

    one of SITLocationPriority

    provider

    one of SITLocationProvider

    updateInterval

    The time interval at which location will be uploaded to realtime

    buildingID

    unique identifier of the building in which you want to locate a user. (This property is mandatory).

    operationQueue

    the thread where the location updates will be provided. If not provided, the main thread will be used.

    useDeadReckoning

    determines if dead reckoning should be used

    options

    additional options to modify the internal operation of the Location provider (private usage only).

    Return Value

    initialized object.

  • Compares the receiving locationRequest to another locationRequest

    Declaration

    Objective-C

    - (BOOL)isEqualToLocationRequest:(SITLocationRequest *_Nonnull)aLocationRequest;

    Swift

    func isEqual(to aLocationRequest: SITLocationRequest) -> Bool

    Parameters

    aLocationRequest

    SITLocationRequest The location Request to compare with the receiver

    Return Value

    YES if aLocationRequest is equivalent to the receiving locationRequest, otherwise NO.