Skip to content

CLASS

IPSGeofencing

@objc public class IPSGeofencing: NSObject

This class represents the Indoor Positioning System (IPS) Geofencing Client. It helps to make a one-time check or continuously monitor if user is in proximity of one of the buildings.

  • Since: 2.18.0

Properties

enableSystemGeofencing

@objc public static var enableSystemGeofencing: Bool

If enabled, the SDK will use system geofencing service to wake up the application nearby one of the buildings in the selected space. Requires 'Always Allow' location permission to perform.

Default value: false

  • Since: 2.20.0

continueLiveGeofencingInBackground

@objc public static var continueLiveGeofencingInBackground: Bool

Live geofencing continuously monitors location to evaluate buildings' IPSBuildingGeofencingState In case it is not important for the application logic to monitor the state while the app is in background this property should be set to false so the service will not use location service in background

Default value: false

  • Since: 2.18.0

liveGeofencingObserversReportingQueue

@objc public static var liveGeofencingObserversReportingQueue: DispatchQueue

The queue will be used for the observers' event reporting.

Default value: DispatchQueue.global(qos: .userInitiated)

  • Since: 2.18.0

enableBuildingsGeofencing

@objc public static var enableBuildingsGeofencing: Bool

If enabled, the SDK will actively monitor the device location and report whenever it is nearby one of the building in the selected space.

Default value: false

  • Since: 2.20.0

currentlyInsideBuildings

public static var currentlyInsideBuildings: [IPSBuilding]

List of the buildings the device is currently nearby.

  • Since: 2.20.0

readyForPositioning

public static var readyForPositioning: IPSExternalRegionPlacementInBuilding?

The placement available for positioning start

  • Since: 2.20.0

Methods

addLiveGeofencingObserver(_:for:)

@objc public static func addLiveGeofencingObserver(_ observer: IPSLiveGeofencingObserver, for building: IPSBuilding)

This method will request the service to start monitoring live geofencing updates on the IPSLiveGeofencingObserver for the building.

  • Since: 2.18.0

  • Parameters:

  • observer: the observer to receive the live geofencing updates.

Parameters

Name Description
observer the observer to receive the live geofencing updates.

removeLiveGeofencingObserver(_:for:)

@objc public static func removeLiveGeofencingObserver(_ observer: IPSLiveGeofencingObserver, for building: IPSBuilding)

Use this method to stop the observer receiving live geofencing updates for the building.

  • Since: 2.18.0

removeAllLiveGeofencingObservers()

@objc public static func removeAllLiveGeofencingObservers()

Use this method to stop the observerving for all current observers and buildings at once.

  • Since: 2.18.0

geofencingState(of:)

@objc public static func geofencingState(of building: IPSBuilding) -> IPSBuildingGeofencingState

Check current IPSBuildingGeofencingState for the building.

  • Since: 2.18.0

searchResultGeofencingState(_:)

@objc public static func searchResultGeofencingState(_ buildingSearchResult: IPSBuildingsSearchResult) -> IPSBuildingGeofencingState

Check current IPSBuildingGeofencingState for the building.

  • Since: 2.20.0

accurateLocation(for:)

public static func accurateLocation(for buildingId: String) -> CLLocation?

Provides the recent GPS location but only if it is stable and accurate.

  • Since: 2.20.0

addBuildingsGeofencingObserver(_:)

@objc public static func addBuildingsGeofencingObserver(_ observer: IPSBuildingsGeofencingObserver)

Adds IPSBuildingsGeofencingObserver to monitor buildings geofencing related events. Use IPSGeofencing.enableBuildingsGeofencing to enable/disable the service.

  • Since: 2.20.0

removeBuildingsGeofencingObserver(_:)

@objc public static func removeBuildingsGeofencingObserver(_ observer: IPSBuildingsGeofencingObserver)

Removes the observer from monitoring ig buildings geofencing related events. Use IPSGeofencing.enableBuildingsGeofencing to enable/disable the service.

  • Since: 2.20.0

prepareService()

@objc public static func prepareService()

Call this method to allow SDK to prepare the service. In case you are planning to use geofence-related features of the SDK, call this method before IPSCore.login(apiKey:).

  • Since: 3.9.0